Skip to content

Upgrade sdk used by e2e tests #1435

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
"blakejs": "^1.1.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"codechain-primitives": "^0.4.8",
"codechain-sdk": "https://github.com/sgkim126/codechain-sdk-js.git#result-lib",
"codechain-keystore": "^0.6.1",
"codechain-primitives": "^0.5.0",
"codechain-sdk": "^1.0.1",
"crypto": "^1.0.1",
"dgram": "^1.0.1",
"elliptic": "^6.4.1",
Expand Down
89 changes: 42 additions & 47 deletions test/src/e2e.long/orders.test.ts

Large diffs are not rendered by default.

28 changes: 15 additions & 13 deletions test/src/e2e.long/staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ describe("Staking", function() {
receiverAddress: validator0Address,
quantity: 100
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
await wait(500);
}

Expand Down Expand Up @@ -289,7 +289,7 @@ describe("Staking", function() {
receiverAddress: validator0Address,
quantity: 100
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
await wait(500);
}

Expand Down Expand Up @@ -329,7 +329,7 @@ describe("Staking", function() {
});

while (
!(await nodes[0].sdk.rpc.chain.containTransaction(pay1.hash()))
!(await nodes[0].sdk.rpc.chain.containsTransaction(pay1.hash()))
) {
await wait(500);
}
Expand All @@ -341,7 +341,7 @@ describe("Staking", function() {
receiverAddress: validator0Address,
quantity: 200
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash1))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash1))) {
await wait(500);
}

Expand All @@ -364,7 +364,9 @@ describe("Staking", function() {
});
await nodes[0].waitBlockNumber(blockNumber + 1);

while (!(await nodes[0].sdk.rpc.chain.containTransaction(pay.hash()))) {
while (
!(await nodes[0].sdk.rpc.chain.containsTransaction(pay.hash()))
) {
await wait(500);
}
const err0 = await nodes[0].sdk.rpc.chain.getErrorHint(hash);
Expand All @@ -386,7 +388,7 @@ describe("Staking", function() {
quantity: 50000,
fee
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
await wait(500);
}
// faucet: 20000, alice: 20000, bob: 10000, val0: 50000,
Expand Down Expand Up @@ -482,7 +484,7 @@ describe("Staking", function() {
quantity: 50000,
fee: 1000
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash1))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash1))) {
await wait(500);
}

Expand All @@ -491,7 +493,7 @@ describe("Staking", function() {
recipient: validator0Address,
quantity: fee
})).hash();
while (!(await nodes[0].sdk.rpc.chain.containTransaction(payHash))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(payHash))) {
await wait(500);
}

Expand All @@ -504,7 +506,7 @@ describe("Staking", function() {
fee
});

while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash2))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash2))) {
await wait(500);
}
// faucet: 20000, alice: 20000, bob: 10000, val0: 0 (delegated 50000 to val1), val1: 0
Expand Down Expand Up @@ -622,7 +624,7 @@ describe("Staking", function() {
quantity: 30000,
fee: 1000
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash1))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash1))) {
await wait(500);
}

Expand All @@ -634,7 +636,7 @@ describe("Staking", function() {
quantity: 30000,
fee: 1000
});
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash2))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash2))) {
await wait(500);
}

Expand All @@ -644,7 +646,7 @@ describe("Staking", function() {
quantity: fee,
fee
})).hash();
while (!(await nodes[0].sdk.rpc.chain.containTransaction(payHash))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(payHash))) {
await wait(500);
}

Expand All @@ -657,7 +659,7 @@ describe("Staking", function() {
fee
});

while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash3))) {
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash3))) {
await wait(500);
}
// faucet: 20000, alice: 20000, bob: 10000, val0: 0 (delegated 30000 to val1), val1: 30000
Expand Down
4 changes: 2 additions & 2 deletions test/src/e2e.long/sync3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("sync 3 nodes", function() {
const blockNumber = await nodes[0].getBestBlockNumber();
const payTx = await nodes[0].sendPayTx();
expect(
await nodes[0].sdk.rpc.chain.containTransaction(
await nodes[0].sdk.rpc.chain.containsTransaction(
payTx.hash()
)
).be.true;
Expand Down Expand Up @@ -135,7 +135,7 @@ describe("sync 3 nodes", function() {
it("It should be synced when the first node created a block", async function() {
const payTx = await nodes[0].sendPayTx();
expect(
await nodes[0].sdk.rpc.chain.containTransaction(payTx.hash())
await nodes[0].sdk.rpc.chain.containsTransaction(payTx.hash())
).be.true;
const transaction = (await nodes[0].sdk.rpc.chain.getTransaction(
payTx.hash()
Expand Down
8 changes: 2 additions & 6 deletions test/src/e2e.long/timelock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@

import { expect } from "chai";
import { H256 } from "codechain-primitives/lib";
import {
Asset,
AssetTransferAddress,
Timelock
} from "codechain-sdk/lib/core/classes";
import { Asset, AssetAddress, Timelock } from "codechain-sdk/lib/core/classes";
import "mocha";
import { wait } from "../helper/promise";
import CodeChain from "../helper/spawn";
Expand Down Expand Up @@ -239,7 +235,7 @@ describe("Timelock", function() {
});

describe("Multiple timelocks", async function() {
let recipient: AssetTransferAddress;
let recipient: AssetAddress;

beforeEach(async function() {
recipient = await node.createP2PKHAddress();
Expand Down
Loading