-
Notifications
You must be signed in to change notification settings - Fork 46
Add accounts, blocks, & network status method tests #512
Add accounts, blocks, & network status method tests #512
Conversation
0c53981
to
ed6766a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of things, looks good otherwise
const expectedTransactionCountAtEaliestBlockTag = | ||
await blsProvider.getTransactionCount(address, "earliest"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same expression as transactionCountAtEaliestBlockTag
. Should we be using regularProvider
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, changed
await blsProvider.getTransactionCount(address, "earliest"); | ||
|
||
// Assert | ||
expect(transactionCount).to.equal(expectedTransactionCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the blsProvider
expected to give the same transaction count as regularProvider
?
Shouldn't blsProvider
be calling nonce()
on the contract? And regularProvider
would just return zero I suppose? Or error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does blsSigner.getAddress()
return an EOA account somehow? I'd expect a BLSWallet
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah missed this completely. Because blsProvider was just calling the ethers version of getTransactionCount, both calls were returning 0.
Does blsSigner.getAddress() return an EOA account somehow? I'd expect a BLSWallet.
blsSigner.getAddress() does return the bls wallet address.
Solution was to add a new getTransactionCount
method onto the blsProvider itself that follows similar logic to BlsWalletWrapper, with the addition of being able to query by block tag. let me know what you think
|
||
// Act | ||
const storage1 = await blsProvider.getStorageAt(mockERC20.address, 1); | ||
console.log(storage1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
2b96f5c
to
c9c03a6
Compare
What is this PR doing?
Add tests for provider Accounts, Blocks & Network Status Methods.
Relevant methods:
How can these changes be manually tested?
Run integration tests
Does this PR resolve or contribute to any issues?
#380
Checklist
Guidelines
resolve conversation
button is for reviewers, not authors