Skip to content

Commit

Permalink
rename protobuf field
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Aug 9, 2023
1 parent 3dceaac commit 34d2184
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 59 deletions.
6 changes: 3 additions & 3 deletions proto/fungible/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ service Msg {

message MsgUpdateZRC20WithdrawFee {
string creator = 1;
string zrc20 = 2; // zrc20 address
string newWithdrawFee = 6 [
string zrc20_address = 2; // zrc20 address
string new_withdraw_fee = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint",
(gogoproto.nullable) = false
];
Expand All @@ -27,7 +27,7 @@ message MsgUpdateZRC20WithdrawFeeResponse {}

message MsgUpdateSystemContract {
string creator = 1;
string newSystemContractAddress = 2;
string new_system_contract_address = 2;
}

message MsgUpdateSystemContractResponse {}
Expand Down
6 changes: 3 additions & 3 deletions x/fungible/keeper/msg_server_update_zrc20_withdraw_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func (k Keeper) UpdateZRC20WithdrawFee(goCtx context.Context, msg *types.MsgUpda
if msg.Creator != k.zetaobserverKeeper.GetParams(ctx).GetAdminPolicyAccount(zetaObserverTypes.Policy_Type_deploy_fungible_coin) {
return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Deploy can only be executed by the correct policy account")
}
zrc20Addr := ethcommon.HexToAddress(msg.Zrc20)
zrc20Addr := ethcommon.HexToAddress(msg.Zrc20Address)
if zrc20Addr == (ethcommon.Address{}) {
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid zrc20 contract address (%s)", msg.Zrc20)
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid zrc20 contract address (%s)", msg.Zrc20Address)
}

// update contracts
Expand All @@ -45,7 +45,7 @@ func (k Keeper) UpdateZRC20WithdrawFee(goCtx context.Context, msg *types.MsgUpda
}

if !found {
return nil, sdkerrors.Wrapf(types.ErrInvalidAddress, "no foreign coin match requested zrc20 address (%s)", msg.Zrc20)
return nil, sdkerrors.Wrapf(types.ErrInvalidAddress, "no foreign coin match requested zrc20 address (%s)", msg.Zrc20Address)
}

res, err := k.CallEVM(ctx, *zrc20ABI, types.ModuleAddressEVM, zrc20Addr, BigIntZero, nil, false, "PROTOCOL_FLAT_FEE")
Expand Down
6 changes: 3 additions & 3 deletions x/fungible/types/message_update_zrc20_withdraw_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var _ sdk.Msg = &MsgUpdateZRC20WithdrawFee{}
func NewMsgUpdateZRC20WithdrawFee(creator string, zrc20 string, newFee sdk.Uint) *MsgUpdateZRC20WithdrawFee {
return &MsgUpdateZRC20WithdrawFee{
Creator: creator,
Zrc20: zrc20,
Zrc20Address: zrc20,
NewWithdrawFee: newFee,
}
}
Expand Down Expand Up @@ -45,8 +45,8 @@ func (msg *MsgUpdateZRC20WithdrawFee) ValidateBasic() error {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}
// check if the system contract address is valid
if ethcommon.HexToAddress(msg.Zrc20) == (ethcommon.Address{}) {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid system contract address (%s)", msg.Zrc20)
if ethcommon.HexToAddress(msg.Zrc20Address) == (ethcommon.Address{}) {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid system contract address (%s)", msg.Zrc20Address)
}

return nil
Expand Down
102 changes: 52 additions & 50 deletions x/fungible/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 34d2184

Please sign in to comment.