forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register Web3Api extension (paritytech#147)
* Remove unnecessary re-export * Register Web3Api extension * Add test * Fix checker * Prettify
- Loading branch information
Showing
3 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { expect } from "chai"; | ||
import { step } from "mocha-steps"; | ||
import { describeWithMoonbeam, customRequest } from "./util"; | ||
|
||
describeWithMoonbeam("Moonbeam RPC (Web3Api)", `simple-specs.json`, (context) => { | ||
step("should get client version", async function () { | ||
const version = await context.web3.eth.getNodeInfo(); | ||
expect(version).to.be.equal("moonbeam-standalone/v6.0/fc-rpc-0.1.0"); | ||
}); | ||
|
||
step("should remote sha3", async function () { | ||
const data = context.web3.utils.stringToHex("hello"); | ||
const hash = await customRequest(context.web3, "web3_sha3", [data]); | ||
const local_hash = context.web3.utils.sha3("hello"); | ||
expect(hash.result).to.be.equal(local_hash); | ||
}); | ||
}); |