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

add cidByHash #15

Merged
merged 1 commit into from
Aug 7, 2019
Merged

add cidByHash #15

merged 1 commit into from
Aug 7, 2019

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Aug 6, 2019

This PR adds a cidByHash mapping, which stores keccak256(CID) to CID. This enables linking emitted events to input CIDs, since the events only hold the hash. Previously, we were parsing the tx inputs to get the original CID, but that only works for external calls to pin and not for deposit wallets or any other contracts that could call us directly. Instead, we can look up the CID from the map on the contract, which will work reliably and consistently for any emitted Pinned event, no matter how it was produced. gofs.sol and GOFS.js are the only real changes - the rest is generated.

@jmank88 jmank88 requested a review from r-gochain August 6, 2019 22:39
@jmank88 jmank88 merged commit d7b7d31 into master Aug 7, 2019
@jmank88 jmank88 deleted the cidByHash branch August 7, 2019 15:37
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.

2 participants