-
Notifications
You must be signed in to change notification settings - Fork 56
Generic Deposit CLI command and Generic Resources CLI fixes #283
base: main
Are you sure you want to change the base?
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 %\ ✨ ✨ ✨ |
} else { | ||
copy(DepositSigBytes[:], []byte(Deposit)[:]) | ||
copy(ExecuteSigBytes[:], []byte(Execute)[:]) | ||
depositBytes, err := hex.DecodeString(Deposit) |
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.
You could probably use the DepositSigBytes variable here, and then omit the copy stuff
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.
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
} | ||
copy(DepositSigBytes[:], depositBytes[:]) | ||
|
||
executeBytes, err := hex.DecodeString(Execute) |
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.
The same as above
…e-core into generic-deposit-cli
Go Test coverage is 55.6 %\ ✨ ✨ ✨ |
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-resource
method. 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 example0x00000000
will be encoded into30783030
.On top of this, we are also currently hashing both functions when
--hash
is 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: