Skip to content

Commit 040f8e4

Browse files
committed
fix tests
1 parent 692f654 commit 040f8e4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

platforms/solana/__tests__/integration/tokenBridge.test.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('TokenBridge Tests', () => {
204204
expect(attestTx.chain).toEqual(chain);
205205

206206
const { transaction } = attestTx;
207-
expect(transaction.instructions).toHaveLength(2);
207+
expect(transaction.transaction.instructions).toHaveLength(2);
208208
});
209209

210210
test('Submit Attestation', async () => {
@@ -229,17 +229,17 @@ describe('TokenBridge Tests', () => {
229229
});
230230
const submitAttestation = tb.submitAttestation(vaa, sender);
231231

232-
const allTxns = [];
232+
const allTxns: SolanaUnsignedTransaction<TNet>[] = [];
233233
for await (const atx of submitAttestation) {
234234
allTxns.push(atx);
235235
}
236236
expect(allTxns).toHaveLength(3);
237237

238238
const [verifySig, postVaa, create] = allTxns;
239239
//
240-
expect(verifySig.transaction.instructions).toHaveLength(2);
241-
expect(postVaa.transaction.instructions).toHaveLength(1);
242-
expect(create.transaction.instructions).toHaveLength(1);
240+
expect(verifySig.transaction.transaction.instructions).toHaveLength(2);
241+
expect(postVaa.transaction.transaction.instructions).toHaveLength(1);
242+
expect(create.transaction.transaction.instructions).toHaveLength(1);
243243
});
244244
});
245245

@@ -260,7 +260,7 @@ describe('TokenBridge Tests', () => {
260260
const xfer = tb.transfer(sender, recipient, token, amount, payload);
261261
expect(xfer).toBeTruthy();
262262

263-
const allTxns = [];
263+
const allTxns: SolanaUnsignedTransaction<TNet>[] = [];
264264
for await (const tx of xfer) {
265265
allTxns.push(tx);
266266
}
@@ -271,7 +271,7 @@ describe('TokenBridge Tests', () => {
271271
expect(xferTx!.chain).toEqual(chain);
272272

273273
const { transaction } = xferTx;
274-
expect(transaction.instructions).toHaveLength(6);
274+
expect(transaction.transaction.instructions).toHaveLength(6);
275275
// ...
276276
});
277277

@@ -285,7 +285,7 @@ describe('TokenBridge Tests', () => {
285285
);
286286
expect(xfer).toBeTruthy();
287287

288-
const allTxns = [];
288+
const allTxns: SolanaUnsignedTransaction<TNet>[] = [];
289289
for await (const tx of xfer) {
290290
allTxns.push(tx);
291291
}
@@ -296,7 +296,7 @@ describe('TokenBridge Tests', () => {
296296
expect(xferTx.chain).toEqual(chain);
297297

298298
const { transaction } = xferTx;
299-
expect(transaction.instructions).toHaveLength(2);
299+
expect(transaction.transaction.instructions).toHaveLength(2);
300300
});
301301
});
302302
});

platforms/solana/protocols/tokenBridge/src/tokenBridge.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ export class SolanaTokenBridge<N extends Network, C extends SolanaChains>
218218

219219
const fee = await this.coreBridge.getMessageFee();
220220
const transferIx = coreUtils.createBridgeFeeTransferInstruction(
221-
this.coreBridge.address,
222-
payer,
221+
this.coreBridge.coreBridge.programId,
222+
senderAddress,
223223
fee,
224224
);
225225

0 commit comments

Comments
 (0)