Skip to content

Commit

Permalink
refactor: respond to AI comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Oct 11, 2024
1 parent 98f95df commit d0c1b62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 2 additions & 4 deletions precompiles/assets/IAssets.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/assets/keeper/client_chain_asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
6 changes: 5 additions & 1 deletion x/assets/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
)

0 comments on commit d0c1b62

Please sign in to comment.