Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdks] bump versions + minor fixes #85

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions deployment/test/test-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ async function sendEvmTestTransaction(
wrapEthersProvider(provider!),
chain.network,
chainIdToChain(chain.chainId),
undefined,
tbrv3ProxyAddress
);
const targetChains = availableChains.filter((c) => c.name === testTransfer.toChain);
Expand Down Expand Up @@ -215,7 +216,7 @@ async function sendEvmTestTransaction(
const feeEstimation = feeEstimations[0];
log(`Fee estimation ${chain.name}->${targetChain.name}: ${inspect(feeEstimation)}`);

allAllowances = {...allAllowances, allowances};
allAllowances = {...allAllowances, ...allowances};
return {
args: {
method: testTransfer.tokenAddress ? 'TransferTokenWithRelay' : 'TransferGasTokenWithRelay',
Expand Down Expand Up @@ -389,9 +390,6 @@ function getAta(signer: Buffer, mint: PublicKey) {
return address;
}


run().then(() => console.log('Done!'));

const uniqueTestTransfers: TestTransfer[] = [
// EVM to Solana and viceversa
{
Expand All @@ -403,7 +401,7 @@ const uniqueTestTransfers: TestTransfer[] = [
tokenChain: "Sepolia",
fromChain: "Sepolia",
toChain: "Solana",
skip: false,
skip: true,
},
{
// case A with gas dropoff
Expand All @@ -418,17 +416,17 @@ const uniqueTestTransfers: TestTransfer[] = [
},
{
// case B gas token with no gas dropoff
transferredAmount: '1',
transferredAmount: '1000000000000',
gasDropoffAmount: '0',
unwrapIntent: false,
tokenChain: "Celo",
fromChain: "Celo",
tokenChain: "Sepolia",
fromChain: "Sepolia",
toChain: "Solana",
skip: true,
},
{
// case B gas token with gas dropoff
transferredAmount: '1',
transferredAmount: '1000000000000',
gasDropoffAmount: '0.00001',
unwrapIntent: false,
tokenChain: "Celo",
Expand All @@ -444,8 +442,8 @@ const uniqueTestTransfers: TestTransfer[] = [
tokenAddress: usdcAddresses.Solana,
tokenChain: "Solana",
fromChain: "Solana",
toChain: "OptimismSepolia",
skip: true,
toChain: "Sepolia",
skip: false,
},
{
// case C (native sol token)
Expand Down Expand Up @@ -512,7 +510,7 @@ const uniqueTestTransfers: TestTransfer[] = [
tokenChain: "Sepolia",
fromChain: "Solana",
toChain: "Sepolia",
skip: false,
skip: true,
},
{
// case E native evm token (wrapped on solana)
Expand Down Expand Up @@ -593,3 +591,5 @@ const uniqueTestTransfers: TestTransfer[] = [
},

];

run().then(() => console.log('Done!'));
2 changes: 1 addition & 1 deletion sdk/evm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xlabs-xyz/evm-arbitrary-token-transfers",
"version": "0.0.2-alpha0",
"version": "0.0.2-alpha1",
"description": "",
"type": "module",
"module": "ts-build/tbrv3/index.js",
Expand Down
4 changes: 2 additions & 2 deletions sdk/evm/tbrv3/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ export class Tbrv3 {

const queryResults = await this.query([...relayFeeQueries, ...allowanceQueries]);

const ret: any = {allowanceQueries: {}, feeEstimations: []};
const ret: any = {allowances: {}, feeEstimations: []};
for (const qRes of queryResults)
if (qRes.query === "RelayFee") {
const {result, ...args} = qRes;
ret.feeEstimations.push({...result, ...args});
}
else
ret.allowanceQueries[qRes.inputToken.toString()] = qRes.result;
ret.allowances[qRes.inputToken.toString()] = qRes.result;

return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/solana/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xlabs-xyz/solana-arbitrary-token-transfers",
"version": "0.0.2-alpha4",
"version": "0.0.2-alpha5",
"license": "ISC",
"type": "module",
"module": "ts-build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion solana/programs/token-bridge-relayer/network.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"wormholeMintAuthority": "BCD75RNBHrJJpW4dXVagL5mPjzRLnVZq4YirJdjEYMV7"
},
"testnet": {
"programId": "46kv4wCpfEtLsHPDh4zm7jJb2pVdvke8Pj2ABYYJotFD",
"programId": "AttmP2dVtvNgHhMjMqKquMSnrNJC9HxH9rXrFqZ9EDHA",
"wormholeMintAuthority": "8P2wAnHr2t4pAVEyJftzz7k6wuCE7aP1VugNwehzCJJY"
}
}