Skip to content

Commit

Permalink
feat :add 2 rpc method (#7)
Browse files Browse the repository at this point in the history
* feat :add 2 rpc method

* feat :add 2 rpc method

* fix peer test

* fix  test failed that ckb-light update too slow

---------

Co-authored-by: linguopeng <[email protected]>
  • Loading branch information
gpBlockchain and linguopeng authored Jun 29, 2023
1 parent 19567ea commit 9c1c918
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
12 changes: 12 additions & 0 deletions test/get_local_info.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {request} from "../service";
import {CKB_LIGHT_RPC_URL} from "../config/config";
import {expect} from "chai";

describe('local_node_info', function () {
it("demo",async ()=>{
const res = await request(1,CKB_LIGHT_RPC_URL,"local_node_info",[])
expect(res.active).to.be.equal(true)

})
});

11 changes: 11 additions & 0 deletions test/get_peers.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {request} from "../service";
import {CKB_LIGHT_RPC_URL} from "../config/config";
import {expect} from "chai";

describe('get_peers', function () {

it("demo",async ()=>{
const res = await request(1,CKB_LIGHT_RPC_URL,"get_peers",[])
expect(res).to.be.not.equal("")
})
});
4 changes: 3 additions & 1 deletion test/runners/mocha/.mocharc.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"test/set_scripts.spec.ts",
"test/scenes.test.ts",
"test/set_script_with_command.spec.ts",
"test/set_script_with_remove.spec.ts"
"test/set_script_with_remove.spec.ts",
"test/get_local_info.spec.ts",
"test/get_peers.spec.ts"
]
}
1 change: 1 addition & 0 deletions test/set_script_with_remove.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('set_script_with_remove', function () {
scriptType: "lock"
})
let afterCap;
await waitScriptsUpdate(BI.from("3000"))
for (let i = 0; i < 5; i++) {
afterCap = await getCellsCapacityRequest({
script: testScript,
Expand Down

0 comments on commit 9c1c918

Please sign in to comment.