Skip to content

Commit

Permalink
updateBridgeSdk (#218)
Browse files Browse the repository at this point in the history
* updateBridgeSdk

* update snap

* update sdk version

* update

* update
  • Loading branch information
StrawberryFlavor authored Dec 4, 2024
1 parent 4cceb95 commit 9e369cf
Show file tree
Hide file tree
Showing 7 changed files with 398 additions and 242 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@acala-network/sdk-core": "4.1.11",
"@polkadot/api": "12.4.2",
"@polkadot/util": "13.0.2",
"@polkawallet/bridge": "^0.1.7-11",
"@polkawallet/bridge": "^0.1.7-13",
"@swc/core": "^1.6.1",
"axios": "^1.7.2",
"dotenv": "^16.4.5",
Expand Down
6 changes: 3 additions & 3 deletions tests/bridge-sdk/__snapshots__/kusama.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross
}
`;

exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.02)"`;
exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.006)"`;

exports[`'karura' to 'assetHubKusama' using bridgeSDK cross-chain 'USDT' > Cross-chain using BridgeSDK works > initial 1`] = `
{
Expand All @@ -165,11 +165,11 @@ exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain
"address": "5FA9nQDVg267DEd8m1ZypXLBnvN7SFxYwV7ndqSYGiN9TTpu",
"decimals": 12,
"fromChain": 8,
"toChain": "(rounded 1.97)",
"toChain": "(rounded 1.84)",
}
`;

exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.03)"`;
exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain using BridgeSDK works > fee 1`] = `"(rounded 0.2)"`;

exports[`'karura' to 'bifrost' using bridgeSDK cross-chain 'KUSD' > Cross-chain using BridgeSDK works > initial 1`] = `
{
Expand Down
10 changes: 0 additions & 10 deletions tests/bridge-sdk/kusama.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ const tests = [
// // fee: 0.008012799999999931
// // },

// {
// from: 'karura',
// to: 'heiko',
// token: 'KAR',
// },
// {
// from: 'heiko',
// to: 'karura',
// token: 'HKO',
// },
// {
// from: 'crab',
// to: 'karura',
Expand Down
23 changes: 1 addition & 22 deletions tests/bridge-sdk/polkadot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const tests = [
to: 'interlay',
token: 'INTR',
},

// btc
// {
// from: 'interlay',
Expand All @@ -70,28 +71,6 @@ const tests = [
// fee: 0.008012799999999931
// },

// RpcError: 1: Error: createType(Lookup4):: Unable to construct number from multi-key object
// {
// from: 'parallel',
// to: 'acala',
// token: 'PARA',
// },
// {
// from: 'acala',
// to: 'parallel',
// token: 'PARA',
// },
// {
// from: 'parallel',
// to: 'acala',
// token: 'ACA',
// },
// {
// from: 'acala',
// to: 'parallel',
// token: 'ACA',
// },

// Chopsticks are currently not supported.
// {
// from: 'crust',
Expand Down
3 changes: 0 additions & 3 deletions tests/bridge-sdk/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { BasiliskAdapter } from '@polkawallet/bridge/adapters/hydradx'
import { BifrostAdapter } from '@polkawallet/bridge/adapters/bifrost'
import { Bridge } from '@polkawallet/bridge'
import { CrabAdapter } from '@polkawallet/bridge/adapters/darwinia'
import { HeikoAdapter, ParallelAdapter } from '@polkawallet/bridge/adapters/parallel'
import { InterlayAdapter, KintsugiAdapter } from '@polkawallet/bridge/adapters/interlay'
import { KaruraAdapter } from '@polkawallet/bridge/adapters/acala'
import { KhalaAdapter } from '@polkawallet/bridge/adapters/phala'
Expand Down Expand Up @@ -105,15 +104,13 @@ export const buildTests = (tests: ReadonlyArray<TestTtype>) => {
acala: AcalaAdapter,
bifrost: BifrostAdapter,
altair: AltairAdapter,
heiko: HeikoAdapter,
shiden: ShidenAdapter,
crust: ShadowAdapter,
quartz: QuartzAdapter,
unique: UniqueAdapter,
astar: AstarAdapter,
interlay: InterlayAdapter,
kintsugi: KintsugiAdapter,
parallel: ParallelAdapter,
khala: KhalaAdapter,
crab: CrabAdapter,
} as any
Expand Down
61 changes: 1 addition & 60 deletions tests/xcm-transfer/__snapshots__/polkadot-para.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -706,17 +706,6 @@ exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > balance o
}
`;

exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > balance on from chain 2`] = `
{
"balance": 9000000000000,
"extra": null,
"reason": {
"consumer": null,
},
"status": "Liquid",
}
`;

exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > balance on to chain 1`] = `
{
"free": "(rounded 11000000000000)",
Expand Down Expand Up @@ -851,52 +840,4 @@ exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > to chain
]
`;

exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > tx events 1`] = `
[
{
"data": {
"assets": [
{
"fun": {
"Fungible": 1000000000000,
},
"id": {
"interior": "Here",
"parents": 1,
},
},
],
"dest": {
"interior": {
"X2": [
{
"Parachain": 2000,
},
{
"AccountId32": {
"id": "(hash)",
"network": null,
},
},
],
},
"parents": 1,
},
"fee": {
"fun": {
"Fungible": 1000000000000,
},
"id": {
"interior": "Here",
"parents": 1,
},
},
"sender": "0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac",
},
"method": "TransferredAssets",
"section": "xTokens",
},
]
`;

exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > tx events 2`] = `[]`;
exports[`'moonbeam' -> 'acala' xcm transfer 'DOT' > xtokens transfer > tx events 1`] = `[]`;
Loading

0 comments on commit 9e369cf

Please sign in to comment.