Skip to content

Commit

Permalink
Get coins from execution process if attached
Browse files Browse the repository at this point in the history
  • Loading branch information
krhubert committed Mar 4, 2020
1 parent 718aba3 commit d9e4ce9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/execution/internal/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ func (k *Keeper) Create(ctx sdk.Context, msg types.MsgCreateExecution) (*executi
M.InProgress.Add(1)
}

from := msg.Signer
if !msg.Request.ProcessHash.IsZero() {
from = sdk.AccAddress(crypto.AddressHash(msg.Request.ProcessHash))
}
execAddress := sdk.AccAddress(crypto.AddressHash(exec.Hash))
if err := k.bankKeeper.SendCoins(ctx, msg.Signer, execAddress, price); err != nil {
if err := k.bankKeeper.SendCoins(ctx, from, execAddress, price); err != nil {
return nil, err
}

Expand Down

0 comments on commit d9e4ce9

Please sign in to comment.