-
Notifications
You must be signed in to change notification settings - Fork 77
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
Consider syntactic sugar for "slice" functionality #170
Comments
this would also simplify part of the anyhedge contract // Extract previous message's content sequence.
int previousSequence = int(previousMessage.split(8)[1].split(4)[0]);
// If the "content sequence" is negative it represents metadata rather than a price message
// and cannot be used inside the contract.
require(previousSequence > 0);
// Extract settlement message's content sequence.
int settlementSequence = int(settlementMessage.split(8)[1].split(4)[0]);
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should consider adding syntactic sugar for "slice" functionality
so instead of
bytes stateItem = fullState.split(4)[1].split(10)[0];
it would be
bytes stateItem = fullState.slice(4,10);
suggesting the name
slice
becausesubstr
could be confusing working on bytes (and was previously the opcode name for OP_SPLIT)The text was updated successfully, but these errors were encountered: