Skip to content

Commit

Permalink
feat: move fee payer into fee struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Jan 23, 2023
1 parent b22703c commit 147aae4
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 202 deletions.
1 change: 1 addition & 0 deletions proto/feerefunder/fee.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ message Fee {
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string payer = 4;
}

message PacketID {
Expand Down
4 changes: 1 addition & 3 deletions proto/interchaintxs/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ message MsgSubmitTx {

neutron.feerefunder.Fee fee = 7
[ (gogoproto.nullable) = false ];

string fee_payer = 8;
}

// MsgSubmitTxResponse defines the response for Msg/SubmitTx
message MsgSubmitTxResponse {
// channel's sequence_id for outgoing ibc packet. Unique per a channel.
// channel's sequence_id for outgoing ibc packet. Unique per a channel.y
uint64 sequence_id = 1;
// channel src channel on neutron side trasaction was submitted from
string channel = 2;
Expand Down
1 change: 0 additions & 1 deletion proto/transfer/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ message MsgTransfer {

neutron.feerefunder.Fee fee = 8
[ (gogoproto.nullable) = false ];
string fee_payer = 9;
}

// MsgTransferResponse is the modified response type for
Expand Down
102 changes: 77 additions & 25 deletions x/feerefunder/types/fee.pb.go

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

8 changes: 4 additions & 4 deletions x/interchaintxs/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func (k Keeper) SubmitTx(goCtx context.Context, msg *ictxtypes.MsgSubmitTx) (*ic
return nil, sdkerrors.Wrapf(ictxtypes.ErrNotContract, "%s is not a contract address", msg.FromAddress)
}

feePayerAddr, err := sdk.AccAddressFromBech32(msg.FeePayer)
if msg.FeePayer != "" && err != nil {
k.Logger(ctx).Debug("SubmitTx: failed to parse fee payer address", "fee_payer", msg.FeePayer)
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "failed to parse address: %s", msg.FeePayer)
feePayerAddr, err := sdk.AccAddressFromBech32(msg.Fee.Payer)
if msg.Fee.Payer != "" && err != nil {
k.Logger(ctx).Debug("SubmitTx: failed to parse fee payer address", "fee payer", msg.Fee.Payer)
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "failed to parse address: %s", msg.Fee.Payer)
}

params := k.GetParams(ctx)
Expand Down
125 changes: 40 additions & 85 deletions x/interchaintxs/types/tx.pb.go

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

Loading

0 comments on commit 147aae4

Please sign in to comment.