-
Notifications
You must be signed in to change notification settings - Fork 384
Update RelayEncoder to be 9430 compatible #2376
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
Changes from 9 commits
2d8bd61
3c71de4
50b283f
f7a44e4
4f08767
1ff9920
55ac996
6227d71
0a69344
927f590
cd1857c
0550ca0
c1e4f6a
cc58dbc
56ec9b8
22b50ab
0eb1b01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,12 +18,10 @@ RelayEncoder constant RELAY_ENCODER_CONTRACT = RelayEncoder( | |
| interface RelayEncoder { | ||
| /// @dev Encode 'bond' relay call | ||
| /// @custom:selector a82948d4 | ||
| /// @param controllerAddress: Address of the controller | ||
| /// @param amount: The amount to bond | ||
| /// @param rewardDestination: the account that should receive the reward | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeBond( | ||
| uint256 controllerAddress, | ||
| uint256 amount, | ||
| bytes memory rewardDestination | ||
| ) external pure returns (bytes memory result); | ||
|
|
@@ -32,47 +30,43 @@ interface RelayEncoder { | |
| /// @custom:selector 813667a0 | ||
| /// @param amount: The extra amount to bond | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeBondExtra(uint256 amount) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeBondExtra( | ||
| uint256 amount | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'unbond' relay call | ||
| /// @custom:selector 51b14e57 | ||
| /// @param amount The amount to unbond | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeUnbond(uint256 amount) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeUnbond( | ||
| uint256 amount | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'withdrawUnbonded' relay call | ||
| /// @custom:selector d5ad108e | ||
| /// @param slashes Weight hint, number of slashing spans | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeWithdrawUnbonded(uint32 slashes) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeWithdrawUnbonded( | ||
| uint32 slashes | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'validate' relay call | ||
| /// @custom:selector bb64ca0c | ||
| /// @param comission: Comission of the validator as partsPerBillion | ||
| /// @param blocked: Whether or not the validator is accepting more nominations | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeValidate(uint256 comission, bool blocked) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeValidate( | ||
| uint256 comission, | ||
fgamundi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| bool blocked | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'nominate' relay call | ||
| /// @custom:selector d2ea7b08 | ||
| /// @param nominees: An array of AccountIds corresponding to the accounts we will nominate | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeNominate(uint256[] memory nominees) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeNominate( | ||
| uint256[] memory nominees | ||
fgamundi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'chill' relay call | ||
| /// @custom:selector b5eaac43 | ||
|
|
@@ -83,64 +77,59 @@ interface RelayEncoder { | |
| /// @custom:selector 414be337 | ||
| /// @param rewardDestination: the account that should receive the reward | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeSetPayee(bytes memory rewardDestination) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeSetPayee( | ||
| bytes memory rewardDestination | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this would better be bytes32 I think as well, what do you think? now that we are breaking the API..
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could update it, but I feel that having it static size makes it harder to manually test it. We would also need to change |
||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'setController' relay call | ||
| /// @custom:selector 07f7c6dc | ||
fgamundi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /// @param controller: The controller address | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeSetController(uint256 controller) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeSetController() external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'rebond' relay call | ||
| /// @custom:selector 0922ee17 | ||
| /// @param amount: The amount to rebond | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeRebond(uint256 amount) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeRebond( | ||
| uint256 amount | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'hrmp.init_open_channel' relay call | ||
| /// @custom:selector e5e20a64 | ||
| /// @param recipient: The paraId to whom we want to initiate the open channel | ||
| /// @param maxCapacity: The maximum capacity for the channel | ||
| /// @param maxMessageSize: The maximum message size for the channel | ||
| /// @return result The bytes associated with the encoded call | ||
| function encodeHrmpInitOpenChannel(uint32 recipient, uint32 maxCapacity, uint32 maxMessageSize) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
|
|
||
| function encodeHrmpInitOpenChannel( | ||
| uint32 recipient, | ||
| uint32 maxCapacity, | ||
| uint32 maxMessageSize | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'hrmp.accept_open_channel' relay call | ||
| /// @custom:selector 98a76477 | ||
| /// @param sender: The paraId from which we want to accept the channel | ||
| function encodeHrmpAcceptOpenChannel(uint32 sender) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeHrmpAcceptOpenChannel( | ||
| uint32 sender | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'hrmp.close_channel' relay call | ||
| /// @custom:selector 9cfbdfc5 | ||
| /// @param sender: The paraId of the sender | ||
| /// @param sender: The paraId of the recipient | ||
| function encodeHrmpCloseChannel(uint32 sender, uint32 recipient) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeHrmpCloseChannel( | ||
| uint32 sender, | ||
| uint32 recipient | ||
| ) external pure returns (bytes memory result); | ||
|
|
||
| /// @dev Encode 'hrmp.cancel_open_request' relay call | ||
| /// @custom:selector 8fd5ce49 | ||
| /// @param sender: The paraId of the sender | ||
| /// @param recipient: The paraId of the recipient | ||
| /// @param openRequests: The number of open requests | ||
| function encodeHrmpCancelOpenRequest(uint32 sender, uint32 recipient, uint32 openRequests) | ||
| external | ||
| pure | ||
| returns (bytes memory result); | ||
| function encodeHrmpCancelOpenRequest( | ||
| uint32 sender, | ||
| uint32 recipient, | ||
| uint32 openRequests | ||
| ) external pure returns (bytes memory result); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.