@@ -34,12 +34,12 @@ import { WormholeTransceiver__factory } from "../../evm/ts/ethers-ci-contracts/f
34
34
35
35
import solanaTiltKey from "./solana-tilt.json" ; // from https://github.com/wormhole-foundation/wormhole/blob/main/solana/keys/solana-devnet.json
36
36
37
- import { Ntt } from "../definitions/src/index.js" ;
38
37
import "../../evm/ts/src/index.js" ;
39
38
import "../../solana/ts/sdk/index.js" ;
40
39
import { NTT } from "../../solana/ts/lib/index.js" ;
41
40
import { SolanaNtt } from "../../solana/ts/sdk/index.js" ;
42
- import { submitAccountantVAA } from "./accountant.js" ;
41
+ import { Ntt } from "../definitions/src/index.js" ;
42
+ import { submitAccountantVAAs } from "./accountant.js" ;
43
43
44
44
// Note: Currently, in order for this to run, the evm bindings with extra contracts must be build
45
45
// To do that, at the root, run `npm run generate:test`
@@ -134,7 +134,7 @@ export async function link(chainInfos: Ctx[]) {
134
134
} ;
135
135
136
136
const vaa = await wh . getVaa ( msgId , "Ntt:TransceiverInfo" ) ;
137
- await submitAccountantVAA ( serialize ( vaa ! ) ) ;
137
+ const vaas : Uint8Array [ ] = [ serialize ( vaa ! ) ] ;
138
138
139
139
// [target, peer, vaa]
140
140
const registrations : [ string , string , VAA < "Ntt:TransceiverRegistration" > ] [ ] =
@@ -164,47 +164,50 @@ export async function link(chainInfos: Ctx[]) {
164
164
}
165
165
}
166
166
167
- // Submit Hub to Spoke registrations
167
+ // Push Hub to Spoke registrations
168
168
const hubToSpokeRegistrations = registrations . filter (
169
169
( [ _ , peer ] ) => peer === hubChain
170
170
) ;
171
171
for ( const [ , , vaa ] of hubToSpokeRegistrations ) {
172
172
console . log (
173
- "Submitting hub to spoke registrations: " ,
173
+ "Pushing hub to spoke registrations: " ,
174
174
vaa . emitterChain ,
175
175
vaa . payload . chain ,
176
176
vaa . payload . transceiver . toString ( )
177
177
) ;
178
- await submitAccountantVAA ( serialize ( vaa ) ) ;
178
+ vaas . push ( serialize ( vaa ) ) ;
179
179
}
180
180
181
- // Submit Spoke to Hub registrations
181
+ // Push Spoke to Hub registrations
182
182
const spokeToHubRegistrations = registrations . filter (
183
183
( [ target , _ ] ) => target === hubChain
184
184
) ;
185
185
for ( const [ , , vaa ] of spokeToHubRegistrations ) {
186
186
console . log (
187
- "Submitting spoke to hub registrations: " ,
187
+ "Pushing spoke to hub registrations: " ,
188
188
vaa . emitterChain ,
189
189
vaa . payload . chain ,
190
190
vaa . payload . transceiver . toString ( )
191
191
) ;
192
- await submitAccountantVAA ( serialize ( vaa ) ) ;
192
+ vaas . push ( serialize ( vaa ) ) ;
193
193
}
194
194
195
- // Submit all other registrations
195
+ // Push all other registrations
196
196
const spokeToSpokeRegistrations = registrations . filter (
197
197
( [ target , peer ] ) => target !== hubChain && peer !== hubChain
198
198
) ;
199
199
for ( const [ , , vaa ] of spokeToSpokeRegistrations ) {
200
200
console . log (
201
- "Submitting spoke to spoke registrations: " ,
201
+ "Pushing spoke to spoke registrations: " ,
202
202
vaa . emitterChain ,
203
203
vaa . payload . chain ,
204
204
vaa . payload . transceiver . toString ( )
205
205
) ;
206
- await submitAccountantVAA ( serialize ( vaa ) ) ;
206
+ vaas . push ( serialize ( vaa ) ) ;
207
207
}
208
+
209
+ // Submit all registrations at once
210
+ await submitAccountantVAAs ( vaas ) ;
208
211
}
209
212
210
213
export async function transferWithChecks ( sourceCtx : Ctx , destinationCtx : Ctx ) {
0 commit comments