-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
WIP: test code hash #241
WIP: test code hash #241
Conversation
src/tests/tokens/nf-token.test.ts
Outdated
}); | ||
|
||
const logs = sendsToSelfOnConstruct.logs; | ||
ctx.is(logs.events.Received, undefined); |
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.
Deploy is a bit different then other transactions. It returns an object with an instance
which is an instance of the deployed contract and receipt
with information about the deployment. Receipt is what you should look at. If receipt does not contain what you need try updating to the latest specron version: 0.16.0
@MoMannn Updated to latest, using receipt. Have one little issue with testing the event. |
@fulldecent What kind of issue? |
src/tests/tokens/nf-token.test.ts
Outdated
|
||
const receipt = sendsToSelfOnConstruct.receipt; | ||
console.log(receipt.events.Received()); | ||
ctx.not(receipt.events.Received, undefined); // I want to confirm here that there is only one event (the mint(), and not the safeTransferFrom) |
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.
You have all the emmited events here. So even if you are expecting same kind of event. Lets say Transfer
you will have an array of Transfer
events here and can check if there is only one and how it is constructed.
@fulldecent what should we do with this? |
We should fix this up and merge. Can bill the effort to our client because 721 is being used on that other blockchain. And this PR is useful for blockchains other than Ethereum Mainnet. |
@fulldecent status? |
…to test-extcodehash
@fulldecent Don't know how to fix / make this work if I don't know what the context is for this... |
This test is checking whether a token contract, which sends itself a token during contract creation, will trigger This behavior is expected to be different based on using EXTCODESIZE and EXTCODEHASH (pre- and post- Homestead versions). The implementation here supports Ethereum (EXTCODEHASH) but the implementation in 0xcert Framework supports pre-Homestead (notably, other chains pre Homestead) so I wanted to make a test that illustrates this difference. |
@fulldecent I fixed the check so it verifies there is no Received event emitted. There are only 2 Transfer events (first for creating the token, the second for sending the token to yourself.) If this is the expected result we can merge. |
@fulldecent please verify. |
Thank you, LGTM |
Blockers