@@ -122,6 +122,7 @@ describe("example-native-token-transfers", () => {
122
122
let ntt : SolanaNtt < "Devnet" , "Solana" > ;
123
123
let signer : Signer ;
124
124
let sender : AccountAddress < "Solana" > ;
125
+ let tokenAddress : string ;
125
126
126
127
beforeAll ( async ( ) => {
127
128
try {
@@ -189,15 +190,14 @@ describe("example-native-token-transfers", () => {
189
190
TOKEN_PROGRAM
190
191
) ;
191
192
193
+ tokenAddress = mint . publicKey . toBase58 ( ) ;
192
194
// Create our contract client
193
195
ntt = new SolanaNtt ( "Devnet" , "Solana" , connection , {
194
196
...ctx . config . contracts ,
195
197
ntt : {
196
- token : mint . publicKey . toBase58 ( ) ,
198
+ token : tokenAddress ,
197
199
manager : NTT_ADDRESS ,
198
- transceiver : {
199
- wormhole : NTT_ADDRESS ,
200
- } ,
200
+ transceiver : { wormhole : NTT_ADDRESS } ,
201
201
} ,
202
202
} ) ;
203
203
} catch ( e ) {
@@ -374,35 +374,32 @@ describe("example-native-token-transfers", () => {
374
374
} ) ;
375
375
376
376
describe ( "Static Checks" , ( ) => {
377
- const wh = new Wormhole ( "Testnet " , [ SolanaPlatform ] ) ;
378
-
377
+ const wh = new Wormhole ( "Devnet " , [ SolanaPlatform ] ) ;
378
+ const ctx = wh . getChain ( "Solana" ) ;
379
379
const overrides = {
380
380
Solana : {
381
- token : "EetppHswYvV1jjRWoQKC1hejdeBDHR9NNzNtCyRQfrrQ" ,
382
- manager : "NTtAaoDJhkeHeaVUHnyhwbPNAN6WgBpHkHBTc6d7vLK" ,
383
- transceiver : {
384
- wormhole : "ExVbjD8inGXkt7Cx8jVr4GF175sQy1MeqgfaY53Ah8as" ,
385
- } ,
381
+ token : tokenAddress ,
382
+ manager : NTT_ADDRESS ,
383
+ transceiver : { wormhole : NTT_ADDRESS } ,
386
384
} ,
387
385
} ;
388
386
389
387
describe ( "ABI Versions Test" , function ( ) {
390
- const ctx = wh . getChain ( "Solana" ) ;
391
388
test ( "It initializes from Rpc" , async function ( ) {
392
- const ntt = await SolanaNtt . fromRpc ( await ctx . getRpc ( ) , {
389
+ const ntt = await SolanaNtt . fromRpc ( connection , {
393
390
Solana : {
394
391
...ctx . config ,
395
392
contracts : {
396
393
...ctx . config . contracts ,
397
- ... { ntt : overrides [ "Solana" ] } ,
394
+ ntt : overrides [ "Solana" ] ,
398
395
} ,
399
396
} ,
400
397
} ) ;
401
398
expect ( ntt ) . toBeTruthy ( ) ;
402
399
} ) ;
403
400
404
401
test ( "It initializes from constructor" , async function ( ) {
405
- const ntt = new SolanaNtt ( "Testnet " , "Solana" , await ctx . getRpc ( ) , {
402
+ const ntt = new SolanaNtt ( "Devnet " , "Solana" , connection , {
406
403
...ctx . config . contracts ,
407
404
...{ ntt : overrides [ "Solana" ] } ,
408
405
} ) ;
@@ -411,11 +408,11 @@ describe("example-native-token-transfers", () => {
411
408
412
409
test ( "It gets the correct version" , async function ( ) {
413
410
const version = await SolanaNtt . getVersion (
414
- await ctx . getRpc ( ) ,
411
+ connection ,
415
412
{ ntt : overrides [ "Solana" ] } ,
416
413
new SolanaAddress ( payer . publicKey . toBase58 ( ) )
417
414
) ;
418
- expect ( version ) . toBe ( "1 .0.0" ) ;
415
+ expect ( version ) . toBe ( "2 .0.0" ) ;
419
416
} ) ;
420
417
} ) ;
421
418
} ) ;
0 commit comments