Skip to content

Commit

Permalink
Fix deposit add and subtract events
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Aug 15, 2023
1 parent 2cef0ca commit c0d4401
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 91 deletions.
13 changes: 2 additions & 11 deletions proto/sentinel/deposit/v1/events.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
syntax = "proto3";
package sentinel.deposit.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/sentinel-official/hub/x/deposit/types";
Expand All @@ -10,18 +9,10 @@ option (gogoproto.goproto_getters_all) = false;

message EventAdd {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
repeated cosmos.base.v1beta1.Coin coins = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"coins\""
];
string coins = 2 [ (gogoproto.moretags) = "yaml:\"coins\"" ];
}

message EventSubtract {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
repeated cosmos.base.v1beta1.Coin coins = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"coins\""
];
string coins = 2 [ (gogoproto.moretags) = "yaml:\"coins\"" ];
}
6 changes: 3 additions & 3 deletions x/deposit/keeper/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (k *Keeper) SendCoinsFromAccountToDeposit(ctx sdk.Context, fromAddr, toAddr
ctx.EventManager().EmitTypedEvent(
&types.EventAdd{
Address: toAddr.String(),
Coins: coins,
Coins: coins.String(),
},
)

Expand Down Expand Up @@ -124,7 +124,7 @@ func (k *Keeper) SendCoinsFromDepositToAccount(ctx sdk.Context, fromAddr, toAddr
ctx.EventManager().EmitTypedEvent(
&types.EventSubtract{
Address: fromAddr.String(),
Coins: coins,
Coins: coins.String(),
},
)

Expand Down Expand Up @@ -152,7 +152,7 @@ func (k *Keeper) SendCoinsFromDepositToModule(ctx sdk.Context, fromAddr sdk.AccA
ctx.EventManager().EmitTypedEvent(
&types.EventSubtract{
Address: fromAddr.String(),
Coins: coins,
Coins: coins.String(),
},
)

Expand Down
126 changes: 49 additions & 77 deletions x/deposit/types/events.pb.go

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

0 comments on commit c0d4401

Please sign in to comment.