This repository was archived by the owner on May 9, 2024. It is now read-only.
Generic Deposit CLI command and Generic Resources CLI fixes#283
Open
Generic Deposit CLI command and Generic Resources CLI fixes#283
Conversation
… and execute function signatures for registering a generic resource
|
Go Test coverage is 55.7 %\ ✨ ✨ ✨ |
|
Go Test coverage is 55.6 %\ ✨ ✨ ✨ |
|
Go Test coverage is 55.6 %\ ✨ ✨ ✨ |
|
Go Test coverage is 55.6 %\ ✨ ✨ ✨ |
tcar121293
reviewed
Apr 19, 2022
| } else { | ||
| copy(DepositSigBytes[:], []byte(Deposit)[:]) | ||
| copy(ExecuteSigBytes[:], []byte(Execute)[:]) | ||
| depositBytes, err := hex.DecodeString(Deposit) |
Contributor
There was a problem hiding this comment.
You could probably use the DepositSigBytes variable here, and then omit the copy stuff
Contributor
Author
There was a problem hiding this comment.
Do you mean substituting depositBytes with DepositSigBytes from the hex.DecodeString call? Currently DepositSigBytes is type [4]byte whereas DecodeString returns []byte and can be used to assign a value to DepositSigBytes. This could probably still be done but would require slight changes to all other places that use DepositSigBytes
tcar121293
reviewed
Apr 19, 2022
| } | ||
| copy(DepositSigBytes[:], depositBytes[:]) | ||
|
|
||
| executeBytes, err := hex.DecodeString(Execute) |
…e-core into generic-deposit-cli
|
Go Test coverage is 55.6 %\ ✨ ✨ ✨ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There is currently no CLI deposit method for bridging with the generic handler on the EVM side of the bridge. This PR adds a deposit command to the centrifuge CLI for depositing generic data on the bridge.
Related Issue Or Context
While testing this method an error was discovered in the
register-generic-resourcemethod. Usingcopy(DepositSignatureBytes[:], []byte(DepositSignatureString)[:])does not directly convert the hex string into the hex representation in bytes. Rather the string is transformed into its hex values. For example0x00000000will be encoded into30783030.On top of this, we are also currently hashing both functions when
--hashis specified and not checking if one function is still its default value ofbytes4(0). This results in an incorrect function signature being registered (bytes4(keccack256(00000000))).Closes: #
How Has This Been Tested? Testing details.
Types of changes
Checklist: