-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Extend the coverage of account nonce discrepancies tests #703
base: main
Are you sure you want to change the base?
test: Extend the coverage of account nonce discrepancies tests #703
Conversation
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.
Nice work but some comments
artifacts/contracts/discrepancies/nonce/ChainedContracts.sol/ChainedContracts.json
Outdated
Show resolved
Hide resolved
Signed-off-by: Anastasia Kovaliova <anastasiya.kovaliova@limechain.tech>
Signed-off-by: Anastasia Kovaliova <anastasiya.kovaliova@limechain.tech>
Signed-off-by: Anastasia Kovaliova <anastasiya.kovaliova@limechain.tech>
- added and adapted internalTransfer function in internalCallee contract - skipped the blocked tests due to some issues Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
- refactored some expected to fail function in test 030 Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
fa0b04c
to
6c4a873
Compare
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
This reverts commit 1697084.
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
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.
LG! Great work thanks!
test/discrepancies/Nonce.js
Outdated
erc721Contract = await Utils.deployERC721Contract(); | ||
tokenAddress = await Utils.createNonFungibleToken( | ||
tokenCreateContract, | ||
signers[0].address | ||
); |
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.
Let's avoid overriding variables which are reused in multiple tests - this creates dependencies between the tests where, depending on their execution order, the variable might hold a different value. This reduces the readability of code and makes it hard to trace what is happening without knowing the order of the tests or without going into debug mode.
If we are going to reuse a variable let's assign it only in one place (e.g., in a before()
method or, where possible, directly turn it into a const
.)
If there are subsets of tests which expect different values here for these variables, we can group them in multiple describes and declare + assign those variables there.
Please check for other such occurrences and try to fix them 🙂. Thank you!
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.
Unneeded override is removed
|
||
//NONCE-023 | ||
//need to update the get contract nonce - waiting for SDK | ||
xit('should update contract nonce for each deployed contract', async function () { |
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.
Just a lil reminder to enable this later (and other tests waiting for the SDK changes)
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.
Looking good, a few comments to address.
constructor() { | ||
owner = msg.sender; | ||
// Deploy Chain within ChildContract constructor | ||
// chainContract = new ChainContract(); |
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.
nit: remove and other commented out code
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.
done
@@ -525,6 +530,12 @@ class Utils { | |||
return accountInfo.accountId.toString(); | |||
} | |||
|
|||
static async getContractInfo(evmAddress, client){ |
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.
Can you add a comment to note that the only reason we're using the SDK is to call the consensus node to confirm that there are no discrepancies between CN and MN.
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.
done
|
||
//NONCE-022 | ||
//should fix the get contract nonce function - waiting for SDKs | ||
xit('should update all nonces when chained deploys of contracts', async function () { |
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.
Q: why is this disabled?
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.
There are few tests where we are not able to get nonce of a smart contract from the sdk - this issue: hashgraph/hedera-sdk-js#2192 . Basically we cannot assert that the nonce of a smart contract is correct. Also added a comments to the tests with the issue url
-added comments for additional info -removed test 29 Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
Signed-off-by: Nikolay Nikolov <nikolay.nikolov@limechain.tech>
This PR extends the coverage of account nonce discrepancies tests according to test plan - https://www.notion.so/limechain/Address-account-nonce-discrepancies-Test-Plan-4a186e8cfabc49888ba501750f68d8de?pvs=4