Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin committed Jan 3, 2024
1 parent c63fcd2 commit 15ca3fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
18 changes: 9 additions & 9 deletions platforms/solana/__tests__/integration/tokenBridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('TokenBridge Tests', () => {
expect(attestTx.chain).toEqual(chain);

const { transaction } = attestTx;
expect(transaction.instructions).toHaveLength(2);
expect(transaction.transaction.instructions).toHaveLength(2);
});

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

const allTxns = [];
const allTxns: SolanaUnsignedTransaction<TNet>[] = [];
for await (const atx of submitAttestation) {
allTxns.push(atx);
}
expect(allTxns).toHaveLength(3);

const [verifySig, postVaa, create] = allTxns;
//
expect(verifySig.transaction.instructions).toHaveLength(2);
expect(postVaa.transaction.instructions).toHaveLength(1);
expect(create.transaction.instructions).toHaveLength(1);
expect(verifySig.transaction.transaction.instructions).toHaveLength(2);
expect(postVaa.transaction.transaction.instructions).toHaveLength(1);
expect(create.transaction.transaction.instructions).toHaveLength(1);
});
});

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

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

const { transaction } = xferTx;
expect(transaction.instructions).toHaveLength(6);
expect(transaction.transaction.instructions).toHaveLength(6);
// ...
});

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

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

const { transaction } = xferTx;
expect(transaction.instructions).toHaveLength(2);
expect(transaction.transaction.instructions).toHaveLength(2);
});
});
});
Expand Down
2 changes: 0 additions & 2 deletions platforms/solana/protocols/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import {
} from '@wormhole-foundation/connect-sdk';
import { Wormhole as WormholeCoreContract } from './types';
import {
BridgeData,
createBridgeFeeTransferInstruction,
createPostMessageInstruction,
createPostVaaInstruction,
createReadOnlyWormholeProgramInterface,
Expand Down
2 changes: 1 addition & 1 deletion platforms/solana/protocols/tokenBridge/src/tokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class SolanaTokenBridge<N extends Network, C extends SolanaChains>

const msgFee = await this.coreBridge.getMessageFee();
const transferIx = coreUtils.createBridgeFeeTransferInstruction(
this.coreBridge.address,
this.coreBridge.coreBridge.programId,
senderAddress,
msgFee,
);
Expand Down

0 comments on commit 15ca3fc

Please sign in to comment.