Skip to content

Commit

Permalink
fixed balance
Browse files Browse the repository at this point in the history
  • Loading branch information
stackman27 committed Jan 17, 2023
1 parent 93a6f02 commit cfb1914
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/apps/transfer/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (q Keeper) EscrowAddress(c context.Context, req *types.QueryEscrowAddressRe
}, nil
}

// TotalNativeIBCOut implements the TotalNativeIBCOut gRPC method.
func (q Keeper) TotalNativeIBCOut(c context.Context, req *types.QueryTotalNativeIBCOutRequest) (*types.QueryTotalNativeIBCOutResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "empty request")
Expand Down
5 changes: 4 additions & 1 deletion modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ func (k Keeper) sendTransfer(
return 0, err
}

// get the existing amount in escrow.
existingAmount := k.bankKeeper.GetBalance(ctx, escrowAddress, token.Denom)

// store the token about to be IBC'd Out here
k.SetIBCOutDenomAmount(ctx, token.GetDenom(), token.Amount)
k.SetIBCOutDenomAmount(ctx, token.GetDenom(), existingAmount.Amount)
} else {
labels = append(labels, telemetry.NewLabel(coretypes.LabelSource, "false"))

Expand Down
1 change: 0 additions & 1 deletion modules/apps/transfer/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func (suite *KeeperTestSuite) TestSendTransfer() {
if tc.expPass {
suite.Require().NoError(err)
suite.Require().NotNil(res)
fmt.Println(res)
} else {
suite.Require().Error(err)
suite.Require().Nil(res)
Expand Down

0 comments on commit cfb1914

Please sign in to comment.