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

Save ipfs rules string instead of bytes32 #159

Merged
merged 6 commits into from
Jan 11, 2024

Conversation

ckoopmann
Copy link
Collaborator

@ckoopmann ckoopmann commented Jan 11, 2024

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: ...."

@ckoopmann ckoopmann changed the title Save ipfs rules hash as string instead of bytes32 Save ipfs rules string instead of bytes32 Jan 11, 2024
@coveralls
Copy link

Coverage Status

coverage: 77.572%. remained the same
when pulling d72d84c on ckoopmann/change-rules-hash-encoding
into 3fc56f4 on master.

@@ -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)
Copy link
Contributor

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());
Copy link
Contributor

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

@pblivin0x pblivin0x self-requested a review January 11, 2024 14:04
Copy link
Contributor

@pblivin0x pblivin0x left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@pblivin0x pblivin0x merged commit f780e9c into master Jan 11, 2024
9 checks passed
@pblivin0x pblivin0x deleted the ckoopmann/change-rules-hash-encoding branch January 11, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants