-
Notifications
You must be signed in to change notification settings - Fork 48
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
Save ipfs rules string instead of bytes32 #159
Conversation
@@ -99,7 +99,7 @@ contract OptimisticAuctionRebalanceExtensionV1 is AuctionRebalanceExtension, As | |||
|
|||
struct ProductSettings{ | |||
OptimisticRebalanceParams optimisticParams; // OptimisticRebalanceParams struct containing optimistic rebalance parameters. | |||
bytes32 rulesHash; // IPFS hash of the rules for the product. | |||
string rules; // Definition of rules for the product. (including ipfs hash pointing to full rules) |
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.
const claim = assertEvent.args._claimData; | ||
expect(claim).to.eq(constructClaim()); | ||
expect(utils.toUtf8String(claim)).to.eq(constructClaim()); |
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.
Confirming this returns as natural language now
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.
LGTM 💯
While increasing gas costs, this makes decoding the whole claim a lot easier and fulfils the requirement of
ASSERT_TRUTH
claims to be utf8 decodable.It also adds flexibility by potentially extending the saved string beyond the hash itself to include some instructions such as: "Rules are stored on ipfs under hash: ...."