forked from polkadot-evm/frontier
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `safe` and `finalized` block tags support * prettier
- Loading branch information
Showing
5 changed files
with
52 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
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,30 @@ | ||
import { expect } from "chai"; | ||
import { step } from "mocha-steps"; | ||
|
||
import { GENESIS_ACCOUNT, GENESIS_ACCOUNT_PRIVATE_KEY, GENESIS_ACCOUNT_BALANCE, EXISTENTIAL_DEPOSIT } from "./config"; | ||
import { createAndFinalizeBlock, describeWithFrontier, customRequest } from "./util"; | ||
|
||
describeWithFrontier("Frontier RPC (BlockNumber tags)", (context) => { | ||
before("Send some transactions across blocks", async function () { | ||
// block #1 finalized | ||
await createAndFinalizeBlock(context.web3); | ||
// block #2 not finalized | ||
await createAndFinalizeBlock(context.web3, false); | ||
}); | ||
|
||
step("`earliest` returns genesis", async function () { | ||
expect((await context.web3.eth.getBlock("earliest")).number).to.equal(0); | ||
}); | ||
|
||
step("`latest` returns `BlockchainInfo::best_hash` number", async function () { | ||
expect((await context.web3.eth.getBlock("latest")).number).to.equal(2); | ||
}); | ||
|
||
step("`finalized` uses `BlockchainInfo::finalized_hash` number", async function () { | ||
expect((await context.web3.eth.getBlock("finalized")).number).to.equal(1); | ||
}); | ||
|
||
step("`safe` is an alias for `finalized` in Polkadot", async function () { | ||
expect((await context.web3.eth.getBlock("safe")).number).to.equal(1); | ||
}); | ||
}); |
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