From 55f5cebd1b1119d2d2fa46fbe37525bf7052d91a Mon Sep 17 00:00:00 2001 From: bear Date: Mon, 4 Mar 2024 15:25:32 +0800 Subject: [PATCH] Update metadata --- precompile/metadata/abi/staking.json | 24 ++++++++++++------------ precompile/metadata/sol/staking.sol | 6 +++--- precompile/staking/src/tests.rs | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/precompile/metadata/abi/staking.json b/precompile/metadata/abi/staking.json index 5c7f8a400..8274c2672 100644 --- a/precompile/metadata/abi/staking.json +++ b/precompile/metadata/abi/staking.json @@ -105,9 +105,9 @@ "type": "uint256" }, { - "internalType": "uint8[]", + "internalType": "uint16[]", "name": "depositIds", - "type": "uint8[]" + "type": "uint16[]" } ], "name": "restake", @@ -136,9 +136,9 @@ "type": "uint256" }, { - "internalType": "uint8[]", + "internalType": "uint16[]", "name": "depositIds", - "type": "uint8[]" + "type": "uint16[]" } ], "name": "stake", @@ -167,9 +167,9 @@ "type": "uint256" }, { - "internalType": "uint8[]", + "internalType": "uint16[]", "name": "depositIds", - "type": "uint8[]" + "type": "uint16[]" } ], "name": "unstake", @@ -242,7 +242,7 @@ "_0": "returns true on success, false otherwise." } }, - "restake(uint256,uint8[])": + "restake(uint256,uint16[])": { "details": "Re-stake the unstaking assets immediately.", "params": @@ -255,7 +255,7 @@ "_0": "true on success, false otherwise." } }, - "stake(uint256,uint256,uint8[])": + "stake(uint256,uint256,uint16[])": { "details": "Add stakes to the staking pool.", "params": @@ -269,7 +269,7 @@ "_0": "returns true on success, false otherwise." } }, - "unstake(uint256,uint256,uint8[])": + "unstake(uint256,uint256,uint16[])": { "details": "Withdraw stakes to the staking pool.", "params": @@ -294,9 +294,9 @@ "collect(uint32)": "10a66536", "nominate(address)": "b332180b", "payout(address)": "0b7e9c44", - "restake(uint256,uint8[])": "6dbcd550", - "stake(uint256,uint256,uint8[])": "757f9b3b", - "unstake(uint256,uint256,uint8[])": "ef20fcb3" + "restake(uint256,uint16[])": "1ed0818e", + "stake(uint256,uint256,uint16[])": "98e9fb50", + "unstake(uint256,uint256,uint16[])": "632efe00" } } }, diff --git a/precompile/metadata/sol/staking.sol b/precompile/metadata/sol/staking.sol index 6deec0a74..f090d026e 100644 --- a/precompile/metadata/sol/staking.sol +++ b/precompile/metadata/sol/staking.sol @@ -35,7 +35,7 @@ interface Staking { function stake( uint256 ringAmount, uint256 ktonAmount, - uint8[] memory depositIds + uint16[] memory depositIds ) external returns (bool); /// @dev Withdraw stakes to the staking pool. @@ -46,7 +46,7 @@ interface Staking { function unstake( uint256 ringAmount, uint256 ktonAmount, - uint8[] memory depositIds + uint16[] memory depositIds ) external returns (bool); /// @dev Re-stake the unstaking assets immediately. @@ -55,7 +55,7 @@ interface Staking { /// @return true on success, false otherwise. function restake( uint256 ringAmount, - uint8[] memory depositIds + uint16[] memory depositIds ) external returns (bool); /// @dev Claim the stakes from the pallet/contract account. diff --git a/precompile/staking/src/tests.rs b/precompile/staking/src/tests.rs index adfad7c24..0865fa706 100644 --- a/precompile/staking/src/tests.rs +++ b/precompile/staking/src/tests.rs @@ -33,9 +33,9 @@ fn precompiles() -> TestPrecompiles { #[test] fn selectors() { - // assert!(PCall::stake_selectors().contains(&0x757f9b3b)); - // assert!(PCall::unstake_selectors().contains(&0xef20fcb3)); - // assert!(PCall::restake_selectors().contains(&0x6dbcd550)); + assert!(PCall::stake_selectors().contains(&0x98e9fb50)); + assert!(PCall::unstake_selectors().contains(&0x632efe00)); + assert!(PCall::restake_selectors().contains(&0x1ed0818e)); assert!(PCall::claim_selectors().contains(&0x4e71d92d)); assert!(PCall::nominate_selectors().contains(&0xb332180b)); assert!(PCall::collect_selectors().contains(&0x10a66536));