Skip to content

Commit

Permalink
chore: adjust phala fees and chopsticks configs
Browse files Browse the repository at this point in the history
  • Loading branch information
bvotteler committed Jul 31, 2024
1 parent e22835d commit d0ac656
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
5 changes: 5 additions & 0 deletions scripts/configs/interlay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ import-storage:
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice, hdx
- foreignAsset: 13
- free: '1000000000000000'
-
-
- 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY # Alice, pha
- foreignAsset: 14
- free: '1000000000000000'
10 changes: 5 additions & 5 deletions src/adapters/interlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,25 @@ export const interlayRoutersConfig: Omit<CrossChainRouterConfigs, "from">[] = [
to: "phala",
token: "PHA",
xcm: {
// TODO: get chopsticks test data
fee: { token: "PHA", amount: "101200000000" },
// chopsticks test data: 2_810_000_095, use ~10x buffer
fee: { token: "PHA", amount: "28000000000" },
weightLimit: DEST_WEIGHT,
},
},
{
to: "phala",
token: "INTR",
xcm: {
// TODO: get chopsticks test data: fee = 6_535_947_712 Add 10x margin
fee: { token: "INTR", amount: "65359477120" },
// chopsticks test data: fee = 642_960_000, use ~10x buffer
fee: { token: "INTR", amount: "6400000000" },
weightLimit: DEST_WEIGHT,
},
},
{
to: "phala",
token: "IBTC",
xcm: {
// chopsticks test: fee = 6429600. Add ~3x margin
// chopsticks test: fee = 6429600. Use ~3x buffer
fee: { token: "IBTC", amount: "20000000" },
weightLimit: DEST_WEIGHT

Check failure on line 92 in src/adapters/interlay.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`
},
Expand Down
12 changes: 6 additions & 6 deletions src/adapters/phala.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ export const phalaRoutersConfig: Omit<CrossChainRouterConfigs, "from">[] = [
to: "interlay",
token: "PHA",
xcm: {
// TODO: confirm via chopsticks test
fee: { token: "PHA", amount: "1016604720" },
// TODO: confirm via chopsticks test, best guess: 8_000_0000_000_000
fee: { token: "PHA", amount: "5000000000000000" },
weightLimit: DEST_WEIGHT,
},
},
{
to: "interlay",
token: "IBTC",
xcm: {
// during chopsticks test: fee = 71 Add 10x margin
fee: { token: "IBTC", amount: "710" },
// during chopsticks test: fee = 63, use ~10x buffer
fee: { token: "IBTC", amount: "600" },
weightLimit: DEST_WEIGHT,
},
},
{
to: "interlay",
token: "INTR",
xcm: {
// during chopsticks test: fee = 21_660_472 Add 10x margin
fee: { token: "INTR", amount: "216604720" },
// during chopsticks test: fee = 19_213_457, use ~10x buffer
fee: { token: "INTR", amount: "200000000" },
weightLimit: DEST_WEIGHT,
},
},
Expand Down
10 changes: 8 additions & 2 deletions src/bridge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AcalaAdapter, KaruraAdapter } from "./adapters/acala";
import { BifrostKusamaAdapter, BifrostPolkadotAdapter } from "./adapters/bifrost";
import { HydraAdapter } from "./adapters/hydradx";
import { AstarAdapter } from "./adapters/astar";
import { PhalaAdapter } from "./adapters/phala";

describe.skip("Bridge sdk usage", () => {
jest.setTimeout(30000);
Expand All @@ -34,6 +35,7 @@ describe.skip("Bridge sdk usage", () => {
hydra: new HydraAdapter(),
parallel: new ParallelAdapter(),
astar: new AstarAdapter(),
phala: new PhalaAdapter(),
};

const bridge = new Bridge({
Expand Down Expand Up @@ -183,6 +185,9 @@ describe.skip("Bridge sdk usage", () => {

// interlay
// printBidirectionalTxs("interlay", "polkadot", "DOT");
printBidirectionalTxs("interlay", "phala", "PHA");
printBidirectionalTxs("interlay", "phala", "INTR");
printBidirectionalTxs("interlay", "phala", "IBTC");
// printBidirectionalTxs("interlay", "statemint", "USDT");
// printBidirectionalTxs("interlay", "hydra", "IBTC");
// printBidirectionalTxs("interlay", "hydra", "INTR");
Expand All @@ -192,11 +197,11 @@ describe.skip("Bridge sdk usage", () => {
// printBidirectionalTxs("interlay", "parallel", "IBTC");
// printBidirectionalTxs("interlay", "astar", "INTR");
// printBidirectionalTxs("interlay", "astar", "IBTC");
printBidirectionalTxs("interlay", "bifrost_polkadot", "VDOT");
// printBidirectionalTxs("interlay", "bifrost_polkadot", "VDOT");
// printBidirectionalTxs("polkadot", "statemint", "DOT");
});

test("5. getNativeToken should work", () => {
test.skip("5. getNativeToken should work", () => {
const testCases: [ChainName, String][] = [
// kusama network
["kusama", "KSM"],
Expand All @@ -213,6 +218,7 @@ describe.skip("Bridge sdk usage", () => {
["parallel", "PARA"],
["bifrost_polkadot", "BNC"],
["statemint", "DOT"],
["phala", "PHA"],
];

for (const [chainName, expectedNativeToken] of testCases) {
Expand Down

0 comments on commit d0ac656

Please sign in to comment.