1
- import type { Address , Chain , LocalAccount } from "viem"
2
- import { base } from "viem/chains"
1
+ import type { Chain , LocalAccount } from "viem"
3
2
import { beforeAll , describe , expect , it } from "vitest"
4
- import { toNetwork } from "../../../test/testSetup"
3
+ import { getTestChains , toNetwork } from "../../../test/testSetup"
5
4
import type { NetworkConfig } from "../../../test/testUtils"
6
5
import { type MeeClient , createMeeClient } from "../../clients/createMeeClient"
7
6
import { mcUSDC } from "../../constants/tokens"
@@ -14,20 +13,21 @@ import { build } from "./build"
14
13
describe ( "mee:build" , ( ) => {
15
14
let network : NetworkConfig
16
15
let eoaAccount : LocalAccount
17
- let paymentChain : Chain
18
- let paymentToken : Address
16
+
19
17
let mcNexus : MultichainSmartAccount
20
18
let meeClient : MeeClient
21
19
20
+ let targetChain : Chain
21
+ let paymentChain : Chain
22
+
22
23
beforeAll ( async ( ) => {
23
24
network = await toNetwork ( "MAINNET_FROM_ENV_VARS" )
25
+ ; [ paymentChain , targetChain ] = getTestChains ( network )
24
26
25
- paymentChain = network . chain
26
- paymentToken = network . paymentToken !
27
27
eoaAccount = network . account !
28
28
29
29
mcNexus = await toMultichainNexusAccount ( {
30
- chains : [ base , paymentChain ] ,
30
+ chains : [ paymentChain , targetChain ] ,
31
31
signer : eoaAccount
32
32
} )
33
33
@@ -49,7 +49,7 @@ describe("mee:build", () => {
49
49
value : 0n
50
50
}
51
51
] ,
52
- chainId : 8453
52
+ chainId : targetChain . id
53
53
}
54
54
]
55
55
}
@@ -66,7 +66,7 @@ describe("mee:build", () => {
66
66
"value": 0n,
67
67
},
68
68
],
69
- "chainId": 8453 ,
69
+ "chainId": ${ targetChain . id } ,
70
70
},
71
71
]
72
72
` )
@@ -81,7 +81,7 @@ describe("mee:build", () => {
81
81
data : {
82
82
amount : BigInt ( 1000 ) ,
83
83
mcToken : mcUSDC ,
84
- chain : base
84
+ chain : targetChain
85
85
}
86
86
}
87
87
)
@@ -100,7 +100,7 @@ describe("mee:build", () => {
100
100
value : 0n
101
101
}
102
102
] ,
103
- chainId : 8453
103
+ chainId : targetChain . id
104
104
}
105
105
]
106
106
}
0 commit comments