Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wormhole-foundation/wormhole-sdk-ts
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 99d540eca55e8f30f571f166c2f97c94c5af6903
Choose a base ref
..
head repository: wormhole-foundation/wormhole-sdk-ts
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 040f8e4b2a97998365794dcf19256cf37d4ddd80
Choose a head ref
18 changes: 9 additions & 9 deletions platforms/solana/__tests__/integration/tokenBridge.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
@@ -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);
});
});

@@ -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);
}
@@ -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);
// ...
});

@@ -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);
}
@@ -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);
});
});
});
4 changes: 2 additions & 2 deletions platforms/solana/protocols/tokenBridge/src/tokenBridge.ts
Original file line number Diff line number Diff line change
@@ -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,
);

3 changes: 3 additions & 0 deletions platforms/solana/src/testing/sendSigner.ts
Original file line number Diff line number Diff line change
@@ -67,6 +67,9 @@ export class SolanaSendSigner<

// Probably caused by storage account not seen yet
if (loggedErr.includes('Not enough bytes')) return true;
if (loggedErr.includes('Unexpected length of input')) return true;

return false;
}

async signAndSend(tx: UnsignedTransaction[]): Promise<any[]> {