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 692f654 commit 040f8e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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
4 changes: 2 additions & 2 deletions platforms/solana/protocols/tokenBridge/src/tokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ export class SolanaTokenBridge<N extends Network, C extends SolanaChains>

const fee = await this.coreBridge.getMessageFee();
const transferIx = coreUtils.createBridgeFeeTransferInstruction(
this.coreBridge.address,
payer,
this.coreBridge.coreBridge.programId,
senderAddress,
fee,
);

Expand Down

0 comments on commit 040f8e4

Please sign in to comment.