-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ethereum block tag para-test (#1831)
* Add Ethereum block tag para-test * unskip
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { expect } from "chai"; | ||
import { ALITH_ADDRESS, ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../util/accounts"; | ||
|
||
import { describeParachain } from "../../util/setup-para-tests"; | ||
|
||
describeParachain( | ||
"Ethereum RPC block tags", | ||
{ | ||
parachain: { | ||
chain: "moonbase-local", | ||
}, | ||
}, | ||
(context) => { | ||
it("should support pending tag", async function () { | ||
this.timeout(150000); | ||
await context.waitBlocks(1); | ||
const expectedBalance = await context.web3.eth.getBalance(ALITH_ADDRESS, "pending"); | ||
expect(BigInt(expectedBalance)).to.equal(ALITH_GENESIS_TRANSFERABLE_BALANCE); | ||
}); | ||
it("should support merge tags in the parachain context", async function () { | ||
this.timeout(150000); | ||
await context.waitBlocks(3); | ||
// We waited for 3 more blocks, expect best block to be number 4. | ||
expect((await context.web3.eth.getBlock("latest")).number).to.equal(4); | ||
// `finalized` block to be 2. | ||
expect((await context.web3.eth.getBlock("finalized")).number).to.equal(2); | ||
// `safe` block to be an alias of `finalized` in the Polkadot context. | ||
expect((await context.web3.eth.getBlock("safe")).number).to.equal(2); | ||
}); | ||
} | ||
); |