Skip to content
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

Fix transfer to contract #599

Merged
merged 1 commit into from
Sep 28, 2022
Merged

Fix transfer to contract #599

merged 1 commit into from
Sep 28, 2022

Conversation

MujkicA
Copy link
Contributor

@MujkicA MujkicA commented Sep 28, 2022

I've noticed that our transfer-to-contract script is calculating the offset of the asset id incorrectly.
The corresponding test was passing because it was checking for the base asset id which is all 0s.

This PR corrects the script, and adapts the test to use a random asset id.

@MujkicA MujkicA self-assigned this Sep 28, 2022
@MujkicA MujkicA requested a review from a team September 28, 2022 15:13
Opcode::TR(0x10, 0x11, 0x12),
Opcode::LW(0x12, 0x11, 0),
Opcode::ADDI(0x13, 0x11, WORD_SIZE as u16),
Opcode::TR(0x10, 0x12, 0x13),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, nice find!

Copy link
Contributor

@iqdecay iqdecay Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come we didn't catch in the tests? Because we used the base asset in the tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MujkicA mentioned in the PR title. Not because of the fact we're using the base asset, but because of what we were checking; we were checking the base asset ID only, which doesn't tell us much about the transfer itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, the previous test was just weak. My bad.

@MujkicA MujkicA added the bug Something isn't working label Sep 28, 2022
@MujkicA MujkicA merged commit ac25466 into master Sep 28, 2022
@MujkicA MujkicA deleted the ahmedm/fix-transfer-to-contract branch September 28, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants