Skip to content

Commit

Permalink
Merge branch 'master' into test-chopsticks-multiple-endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
bvotteler committed Dec 21, 2023
2 parents cacf2a6 + d092599 commit 04b6837
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ All channels support transfers in both directions.
| ------------------ | --------- |
| acala | INTR IBTC |
| astar | INTR IBTC |
| bifrost | VDOT |
| parallel | INTR IBTC |
| polkadot | DOT |
| polkadot asset hub | USDT |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@polkadot/api": "^10.9.1",
"@polkadot/apps-config": "^0.132.1",
"@polkadot/types": "^10.9.1",
"axios": "^0.27.2",
"axios": "^1.6.2",
"lodash": "^4.17.20"
},
"devDependencies": {
Expand Down
20 changes: 18 additions & 2 deletions scripts/chopsticks-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,20 @@ async function checkTransfer(fromChain: ChainName, toChain: ChainName, token: st

// check existential deposit by sending exactly `actualFee + ed + [1 planck]`. The function
// will throw an error if the ed is set too low.
let amountToSend = actualFee.add(expectedEd).add(FN.fromInner("1", actualFee.getPrecision()));
const dust = FN.fromInner("1", actualFee.getPrecision());
let amountToSend = actualFee.add(expectedEd).add(dust);

if (toChain === "hydra") {
// bump fees in amount to send by a few percent for XCM to HydraDX
// token/HDX price pair changes can make this fail due to pair changes from previous tx increasing fee required
const bumpRate = new FN(1.1);
const bumpedFee = actualFee.mul(bumpRate);
amountToSend = bumpedFee.add(expectedEd).add(dust);
ret = {
message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped assumed fees by ${bumpRate.minus(FN.ONE).toNumber() * 100}%`,
result: ResultCode.OK
};
}
await sendTx(fromChain, toChain, token, bridge, amountToSend, TestCase.ExistentialDeposit);

return ret;
Expand Down Expand Up @@ -260,8 +273,11 @@ export async function runTestCasesAndExit(
process.stdout.write(`Testing ${token} transfer from ${from} to ${to}... `);
const result = await retryCheckTransfer(from, to, token, bridge, 2);
console.log(ResultCode[result.result]);
if (result.result != ResultCode.OK) {
if (result.message?.length > 0) {
console.log(iconOf(result.result), result.message);
}

if (result.result != ResultCode.OK) {
problematicTestCases.push({from: from as ChainName, to: to as ChainName, token, icon: iconOf(result.result), message: result.message});
if (aggregateTestResult == ResultCode.OK || (aggregateTestResult == ResultCode.WARN && result.result == ResultCode.FAIL)) {
// only 'increase' the aggregate error
Expand Down
2 changes: 1 addition & 1 deletion scripts/configs/kusama.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
endpoint:
- wss://kusama-rpc.polkadot.io
- wss://kusama-rpc.dwellir.com
- wss://kusama-rpc.polkadot.io
- wss://rpc-kusama.luckyfriday.io
- wss://kusama-rpc-tn.dwellir.com
mock-signature-host: true
Expand Down
4 changes: 2 additions & 2 deletions scripts/configs/polkadot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
endpoint:
- wss://rpc.polkadot.io
- wss://polkadot-rpc.dwellir.com
- wss://polkadot-rpc-tn.dwellir.com
- wss://rpc-polkadot.luckyfriday.io
- wss://rpc.polkadot.io
- wss://polkadot-rpc-tn.dwellir.com
mock-signature-host: true
block: ${env.POLKADOT_BLOCK_NUMBER}
db: ./db.sqlite
Expand Down
24 changes: 15 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4978,13 +4978,14 @@ axios@^0.24.0:
dependencies:
follow-redirects "^1.14.4"

axios@^0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
axios@^1.6.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2"
integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==
dependencies:
follow-redirects "^1.14.9"
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

babel-jest@^27.5.1:
version "27.5.1"
Expand Down Expand Up @@ -6838,10 +6839,10 @@ flatten@^1.0.2:
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b"
integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==

follow-redirects@^1.14.4, follow-redirects@^1.14.9:
version "1.15.2"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
follow-redirects@^1.14.4, follow-redirects@^1.15.0:
version "1.15.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==

for-each@^0.3.3:
version "0.3.3"
Expand Down Expand Up @@ -9799,6 +9800,11 @@ propagate@^2.0.0:
resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45"
integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==

proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
Expand Down

0 comments on commit 04b6837

Please sign in to comment.