diff --git a/precompiles/assets/IAssets.sol b/precompiles/assets/IAssets.sol index 31a82e329..cd75e86ca 100644 --- a/precompiles/assets/IAssets.sol +++ b/precompiles/assets/IAssets.sol @@ -14,10 +14,8 @@ IAssets constant ASSETS_CONTRACT = IAssets(ASSETS_PRECOMPILE_ADDRESS); interface IAssets { /// TRANSACTIONS - /// @dev deposit the client chain assets for the staker, + /// @dev deposit the client chain assets, only LSTs, for the staker, /// that will change the state in assets module - /// @dev deposit the client chain assets, mainly LSTs, for the staker, - /// that will change the state in deposit module /// Note that this address cannot be a module account. /// @param clientChainID is the layerZero chainID if it is supported. // It might be allocated by Exocore when the client chain isn't supported @@ -63,7 +61,7 @@ interface IAssets { uint256 opAmount ) external returns (bool success, uint256 latestAssetState); - /// @dev withdraw NST To the staker, that will change the state in withdraw module + /// @dev withdraw NST To the staker, that will change the state in assets module /// Note that this address cannot be a module account. /// @param clientChainID is the layerZero chainID if it is supported. // It might be allocated by Exocore when the client chain isn't supported diff --git a/x/assets/keeper/client_chain_asset.go b/x/assets/keeper/client_chain_asset.go index ef7b99f43..06a861cbb 100644 --- a/x/assets/keeper/client_chain_asset.go +++ b/x/assets/keeper/client_chain_asset.go @@ -48,7 +48,7 @@ func (k Keeper) SetStakingAssetInfo(ctx sdk.Context, info *assetstype.StakingAss store := prefix.NewStore(ctx.KVStore(k.storeKey), assetstype.KeyPrefixReStakingAssetInfo) _, assetID := assetstype.GetStakerIDAndAssetIDFromStr(info.AssetBasicInfo.LayerZeroChainID, "", info.AssetBasicInfo.Address) if store.Has([]byte(assetID)) { - return assetstype.ErrInvalidInputParameter.Wrapf( + return assetstype.ErrRegisterDuplicateAssetID.Wrapf( "the asset has already been registered,assetID:%v,LayerZeroChainID:%v,ClientChainAssetAddr:%v", assetID, info.AssetBasicInfo.LayerZeroChainID, info.AssetBasicInfo.Address, ) diff --git a/x/assets/types/errors.go b/x/assets/types/errors.go index 38bf37ebb..8cfc47fe0 100644 --- a/x/assets/types/errors.go +++ b/x/assets/types/errors.go @@ -89,8 +89,12 @@ var ( ModuleName, 18, "the operation type is invalid") - ErrParseJoinedKey = errorsmod.Register( + ErrRegisterDuplicateAssetID = errorsmod.Register( ModuleName, 19, + "register new asset with an existing assetID") + + ErrParseJoinedKey = errorsmod.Register( + ModuleName, 20, "the joined key can't be parsed", ) )