-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from zzGHzz/main
return block id in hex string for eth_chainId
- Loading branch information
Showing
4 changed files
with
30 additions
and
17 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,18 @@ | ||
import "mocha"; | ||
import { expect, assert } from "chai"; | ||
import { TestObject } from "../testSetup"; | ||
|
||
describe('Test function eth_chainId', function () { | ||
it('should return the correct mainnet genesis id', async function () { | ||
const { eip1193Providers, connexs } = this.testObject as TestObject; | ||
const provider = eip1193Providers.main; | ||
const connex = connexs.main; | ||
|
||
try { | ||
const id = await provider.request({ method: 'eth_chainId' }); | ||
expect(id).to.eql(connex.thor.genesis.id); | ||
} catch (err: any) { | ||
assert.fail(err.message || err); | ||
} | ||
}) | ||
}); |
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