Skip to content

Commit 715b2ff

Browse files
Seulgi Kimsgkim126
authored andcommitted
Upgrade sdk used by e2e tests
1 parent a68b325 commit 715b2ff

18 files changed

+177
-180
lines changed

test/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"blakejs": "^1.1.0",
4444
"chai": "^4.2.0",
4545
"chai-as-promised": "^7.1.1",
46-
"codechain-primitives": "^0.4.8",
47-
"codechain-sdk": "https://github.com/sgkim126/codechain-sdk-js.git#result-lib",
46+
"codechain-primitives": "^0.5.0",
47+
"codechain-sdk": "https://github.com/sgkim126/codechain-sdk-js.git#seq-lib",
4848
"crypto": "^1.0.1",
4949
"dgram": "^1.0.1",
5050
"elliptic": "^6.4.1",

test/src/e2e.long/orders.test.ts

Lines changed: 42 additions & 47 deletions
Large diffs are not rendered by default.

test/src/e2e.long/staking.test.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ describe("Staking", function() {
252252
receiverAddress: validator0Address,
253253
quantity: 100
254254
});
255-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
255+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
256256
await wait(500);
257257
}
258258

@@ -289,7 +289,7 @@ describe("Staking", function() {
289289
receiverAddress: validator0Address,
290290
quantity: 70000
291291
});
292-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
292+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
293293
await wait(500);
294294
}
295295

@@ -325,7 +325,7 @@ describe("Staking", function() {
325325
receiverAddress: validator0Address,
326326
quantity: 100
327327
});
328-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
328+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
329329
await wait(500);
330330
}
331331

@@ -365,7 +365,7 @@ describe("Staking", function() {
365365
receiverAddress: validator0Address,
366366
quantity: 70000
367367
});
368-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
368+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
369369
await wait(500);
370370
}
371371

@@ -405,7 +405,7 @@ describe("Staking", function() {
405405
});
406406

407407
while (
408-
!(await nodes[0].sdk.rpc.chain.containTransaction(pay1.hash()))
408+
!(await nodes[0].sdk.rpc.chain.containsTransaction(pay1.hash()))
409409
) {
410410
await wait(500);
411411
}
@@ -417,7 +417,7 @@ describe("Staking", function() {
417417
receiverAddress: validator0Address,
418418
quantity: 200
419419
});
420-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash1))) {
420+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash1))) {
421421
await wait(500);
422422
}
423423

@@ -440,7 +440,9 @@ describe("Staking", function() {
440440
});
441441
await nodes[0].waitBlockNumber(blockNumber + 1);
442442

443-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(pay.hash()))) {
443+
while (
444+
!(await nodes[0].sdk.rpc.chain.containsTransaction(pay.hash()))
445+
) {
444446
await wait(500);
445447
}
446448
const err0 = await nodes[0].sdk.rpc.chain.getErrorHint(hash);
@@ -462,7 +464,7 @@ describe("Staking", function() {
462464
quantity: 50000,
463465
fee
464466
});
465-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash))) {
467+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash))) {
466468
await wait(500);
467469
}
468470
// faucet: 20000, alice: 20000, bob: 10000, val0: 50000,
@@ -558,7 +560,7 @@ describe("Staking", function() {
558560
quantity: 50000,
559561
fee: 1000
560562
});
561-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash1))) {
563+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash1))) {
562564
await wait(500);
563565
}
564566

@@ -567,7 +569,7 @@ describe("Staking", function() {
567569
recipient: validator0Address,
568570
quantity: fee
569571
})).hash();
570-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(payHash))) {
572+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(payHash))) {
571573
await wait(500);
572574
}
573575

@@ -580,7 +582,7 @@ describe("Staking", function() {
580582
fee
581583
});
582584

583-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash2))) {
585+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash2))) {
584586
await wait(500);
585587
}
586588
// faucet: 20000, alice: 20000, bob: 10000, val0: 0 (delegated 50000 to val1), val1: 0
@@ -698,7 +700,7 @@ describe("Staking", function() {
698700
quantity: 30000,
699701
fee: 1000
700702
});
701-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash1))) {
703+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash1))) {
702704
await wait(500);
703705
}
704706

@@ -710,7 +712,7 @@ describe("Staking", function() {
710712
quantity: 30000,
711713
fee: 1000
712714
});
713-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash2))) {
715+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash2))) {
714716
await wait(500);
715717
}
716718

@@ -720,7 +722,7 @@ describe("Staking", function() {
720722
quantity: fee,
721723
fee
722724
})).hash();
723-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(payHash))) {
725+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(payHash))) {
724726
await wait(500);
725727
}
726728

@@ -733,7 +735,7 @@ describe("Staking", function() {
733735
fee
734736
});
735737

736-
while (!(await nodes[0].sdk.rpc.chain.containTransaction(hash3))) {
738+
while (!(await nodes[0].sdk.rpc.chain.containsTransaction(hash3))) {
737739
await wait(500);
738740
}
739741
// faucet: 20000, alice: 20000, bob: 10000, val0: 0 (delegated 30000 to val1), val1: 30000

test/src/e2e.long/sync3.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("sync 3 nodes", function() {
5151
const blockNumber = await nodes[0].getBestBlockNumber();
5252
const payTx = await nodes[0].sendPayTx();
5353
expect(
54-
await nodes[0].sdk.rpc.chain.containTransaction(
54+
await nodes[0].sdk.rpc.chain.containsTransaction(
5555
payTx.hash()
5656
)
5757
).be.true;
@@ -135,7 +135,7 @@ describe("sync 3 nodes", function() {
135135
it("It should be synced when the first node created a block", async function() {
136136
const payTx = await nodes[0].sendPayTx();
137137
expect(
138-
await nodes[0].sdk.rpc.chain.containTransaction(payTx.hash())
138+
await nodes[0].sdk.rpc.chain.containsTransaction(payTx.hash())
139139
).be.true;
140140
const transaction = (await nodes[0].sdk.rpc.chain.getTransaction(
141141
payTx.hash()

test/src/e2e.long/timelock.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616

1717
import { expect } from "chai";
1818
import { H256 } from "codechain-primitives/lib";
19-
import {
20-
Asset,
21-
AssetTransferAddress,
22-
Timelock
23-
} from "codechain-sdk/lib/core/classes";
19+
import { Asset, AssetAddress, Timelock } from "codechain-sdk/lib/core/classes";
2420
import "mocha";
2521
import { wait } from "../helper/promise";
2622
import CodeChain from "../helper/spawn";
@@ -239,7 +235,7 @@ describe("Timelock", function() {
239235
});
240236

241237
describe("Multiple timelocks", async function() {
242-
let recipient: AssetTransferAddress;
238+
let recipient: AssetAddress;
243239

244240
beforeEach(async function() {
245241
recipient = await node.createP2PKHAddress();

0 commit comments

Comments
 (0)