-
Notifications
You must be signed in to change notification settings - Fork 125
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
feature: Add new assertion instruction models #1939
feature: Add new assertion instruction models #1939
Conversation
Docker tags |
Benchmark for a93970bClick to view benchmark
|
LowerBound::Inclusive(decimal) => *decimal, | ||
} | ||
} | ||
} |
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.
Doesn't seem correct to me with the ONE
. Also, why not LowerBound(Decimal)
?
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.
Well Omar was the one advocating for it, but actually I think it makes sense to capture the intention of the caller with e.g. NonZero
.
e.g. NonZero
for a divisibility 18 Fungible means "at-least one atto", but for a Non-Fungible is actually "at least one". In practice, we interpret NonZero
to mean "an infinitesimal amount" when interpreting it as a lower bound.
match self { | ||
ManifestResourceConstraint::NonZeroAmount => true, | ||
ManifestResourceConstraint::ExactAmount(amount) => !amount.is_negative(), | ||
ManifestResourceConstraint::AtLeastAmount(amount) => !amount.is_negative(), |
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.
Minor: do we want to restrict granularity to 1?
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 idea, have added these constraints.
Summary
Adds the following instruction models, including compilation, decompilation and validation:
ASSERT_WORKTOP_RESOURCES_ONLY
ASSERT_WORKTOP_RESOURCES_INCLUDE
ASSERT_NEXT_CALL_RETURNS_ONLY
ASSERT_NEXT_CALL_RETURNS_INCLUDE
ASSERT_BUCKET_CONTENTS
Also:
ASSERT_WORKTOP_IS_EMPTY
, to be an instruction alias.e2e.rs
to properly format the error messages, making debugging much easier.Further work
Testing
e2e.rs
static_resource_movements_visitor.rs