-
Notifications
You must be signed in to change notification settings - Fork 8
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.
Some more ASM comments. It's just too tricky to do non-trivial ASM blocks this way. I think we need to rethink how we expect them to be used, perhaps provide a stricter context. Like they must be standalone functions, rather than embedded in other functions, or something.
@otrho Re: asm |
This has seen a significant refactor by @adlerjohn , including:
Still to do:
|
Should finally be ready |
} else { | ||
let unwrapped = result.unwrap(); | ||
if let Sender::ContractId(v) = unwrapped { | ||
assert(v == expected_id); |
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 test isn't perfect because of this assert which shouldn't be here, but the compiler panics if removed. Could be a compiler bug, will investigate later.
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.
cc @otrho
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 a bit contrived... ideally the test contracts would just pass the Result returned by msg_sender()
along to the rust tests and compare the returned values there.
But, I was having issues with contracts returning nested struct/enums (MissingData
error when using abigen
macro) and so I simplified the return values and make comparisons in the contracts themselves. This is also why we need to pass in the expected_id
value.
It feels hacky but works...
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.
Looks good. Some improvements to be made in tests, will open an issue to track.
Implements the third auth method (owners of all coin inputs are the same).