1
1
import anyTest from '@endo/ses-ava/prepare-endo.js' ;
2
2
3
- import { makeBlocksIterable } from '@agoric/client-utils/src/chain.js' ;
3
+ import {
4
+ makeBlocksIterable ,
5
+ queryBlock ,
6
+ } from '@agoric/client-utils/src/chain.js' ;
4
7
import { makeAPI } from '@agoric/client-utils/src/grpc-rest-api.js' ;
5
8
import { encodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js' ;
6
9
import type { QueryBalanceResponseSDKType } from '@agoric/cosmic-proto/cosmos/bank/v1beta1/query.js' ;
@@ -104,6 +107,7 @@ const makeTestContext = async t => {
104
107
105
108
return {
106
109
...common ,
110
+ api,
107
111
lpUser,
108
112
feeUser,
109
113
oracleWds,
@@ -210,6 +214,7 @@ const advanceAndSettleScenario = test.macro({
210
214
`advance ${ mintAmt } uusdc to ${ eudChain } and settle` ,
211
215
exec : async ( t , mintAmt : bigint , eudChain : string ) => {
212
216
const {
217
+ api,
213
218
nobleTools,
214
219
nobleAgoricChannelId,
215
220
txOracles,
@@ -267,10 +272,22 @@ const advanceAndSettleScenario = test.macro({
267
272
} ) ;
268
273
269
274
log ( 'User initiates EVM burn:' , evidence . txHash ) ;
275
+ const { block } = await queryBlock ( api ) ;
270
276
console . time ( `UX->${ eudChain } ` ) ;
277
+ console . timeLog (
278
+ `UX->${ eudChain } ` ,
279
+ 'initial height' ,
280
+ block . header . height ,
281
+ block . header . time ,
282
+ ) ;
271
283
272
284
// submit evidences
273
- await Promise . all ( txOracles . map ( o => o . submit ( evidence ) ) ) ;
285
+ await Promise . all (
286
+ txOracles . map ( async o => {
287
+ const { block } = await o . submit ( evidence ) ;
288
+ console . timeLog ( `UX->${ eudChain } ` , o . getName ( ) , block ) ;
289
+ } ) ,
290
+ ) ;
274
291
console . timeLog ( `UX->${ eudChain } ` , 'submitted x' , txOracles . length ) ;
275
292
276
293
const queryClient = makeQueryClient (
@@ -280,12 +297,22 @@ const advanceAndSettleScenario = test.macro({
280
297
await t . notThrowsAsync ( async ( ) => {
281
298
const q = await retryUntilCondition (
282
299
( ) => queryClient . queryBalance ( EUD , usdcOnOsmosis ) ,
283
- ( { balance } ) => ! ! balance ?. amount && BigInt ( balance . amount ) < mintAmt ,
300
+ ( { balance } ) =>
301
+ ! ! balance ?. amount &&
302
+ BigInt ( balance . amount ) > 0n &&
303
+ BigInt ( balance . amount ) < mintAmt ,
284
304
`${ EUD } advance available from fast-usdc` ,
285
305
// this resolves quickly, so _decrease_ the interval so the timing is more apparent
286
- { retryIntervalMs : 500 } ,
306
+ { retryIntervalMs : 500 , maxRetries : 12 } ,
307
+ ) ;
308
+ console . timeLog ( `UX->${ eudChain } ` , 'rxd' , q . balance ?. amount ) ;
309
+ const { block } = await queryBlock ( api ) ;
310
+ console . timeLog (
311
+ `UX->${ eudChain } ` ,
312
+ 'final block' ,
313
+ block . header . height ,
314
+ block . header . time ,
287
315
) ;
288
- console . timeLog ( `UX->${ eudChain } ` , 'rxd' , q . balance ) ;
289
316
} ) ;
290
317
console . timeEnd ( `UX->${ eudChain } ` ) ;
291
318
0 commit comments