1
1
import test from 'ava' ;
2
+ import { encodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js' ;
2
3
import transfer from '../../src/cli/transfer.js' ;
3
4
import {
4
5
mockOut ,
@@ -63,14 +64,18 @@ test('Transfer registers the noble forwarding account if it does not exist', asy
63
64
} ;
64
65
const out = mockOut ( ) ;
65
66
const file = mockFile ( path , JSON . stringify ( config ) ) ;
66
- const agoricSettlementAccount = 'agoric123456' ;
67
+ const agoricSettlementAccount =
68
+ 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek' ;
67
69
const settlementAccountVstoragePath = 'published.fastUsdc.settlementAccount' ;
68
70
const vstorageMock = makeVstorageMock ( {
69
71
[ settlementAccountVstoragePath ] : agoricSettlementAccount ,
70
72
} ) ;
71
73
const amount = '150' ;
72
- const destination = 'dydx1234' ;
73
- const nobleFwdAccountQuery = `${ nobleApi } /noble/forwarding/v1/address/${ nobleToAgoricChannel } /${ agoricSettlementAccount } ${ encodeURIComponent ( '?EUD=' ) } ${ destination } /` ;
74
+ const EUD = 'dydx1234' ;
75
+ const nobleFwdAccountQuery = `${ nobleApi } /noble/forwarding/v1/address/${ nobleToAgoricChannel } /${ encodeAddressHook (
76
+ agoricSettlementAccount ,
77
+ { EUD } ,
78
+ ) } /`;
74
79
const fetchMock = makeFetchMock ( {
75
80
[ nobleFwdAccountQuery ] : {
76
81
address : 'noble14lwerrcfzkzrv626w49pkzgna4dtga8c5x479h' ,
@@ -84,7 +89,7 @@ test('Transfer registers the noble forwarding account if it does not exist', asy
84
89
await transfer . transfer (
85
90
file ,
86
91
amount ,
87
- destination ,
92
+ EUD ,
88
93
// @ts -expect-error mocking console
89
94
out ,
90
95
fetchMock . fetch ,
@@ -114,14 +119,18 @@ test('Transfer signs and broadcasts the depositForBurn message on Ethereum', asy
114
119
} ;
115
120
const out = mockOut ( ) ;
116
121
const file = mockFile ( path , JSON . stringify ( config ) ) ;
117
- const agoricSettlementAccount = 'agoric123456' ;
122
+ const agoricSettlementAccount =
123
+ 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek' ;
118
124
const settlementAccountVstoragePath = 'published.fastUsdc.settlementAccount' ;
119
125
const vstorageMock = makeVstorageMock ( {
120
126
[ settlementAccountVstoragePath ] : agoricSettlementAccount ,
121
127
} ) ;
122
128
const amount = '150' ;
123
- const destination = 'dydx1234' ;
124
- const nobleFwdAccountQuery = `${ nobleApi } /noble/forwarding/v1/address/${ nobleToAgoricChannel } /${ agoricSettlementAccount } ${ encodeURIComponent ( '?EUD=' ) } ${ destination } /` ;
129
+ const EUD = 'dydx1234' ;
130
+ const nobleFwdAccountQuery = `${ nobleApi } /noble/forwarding/v1/address/${ nobleToAgoricChannel } /${ encodeAddressHook (
131
+ agoricSettlementAccount ,
132
+ { EUD } ,
133
+ ) } /`;
125
134
const fetchMock = makeFetchMock ( {
126
135
[ nobleFwdAccountQuery ] : {
127
136
address : 'noble14lwerrcfzkzrv626w49pkzgna4dtga8c5x479h' ,
@@ -135,7 +144,7 @@ test('Transfer signs and broadcasts the depositForBurn message on Ethereum', asy
135
144
await transfer . transfer (
136
145
file ,
137
146
amount ,
138
- destination ,
147
+ EUD ,
139
148
// @ts -expect-error mocking console
140
149
out ,
141
150
fetchMock . fetch ,
0 commit comments