Skip to content

Commit

Permalink
Updates from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Jul 1, 2019
1 parent 7b42a27 commit af9743a
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions x/auth/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func NewAnteHandler(ak AccountKeeper, supplyKeeper types.SupplyKeeper, feeDelega
if len(feeAddr) != 0 {
// check if fees can be delegated
if feeDelegationHandler == nil {
return newCtx, sdk.ErrUnknownRequest("delegated fees aren't supported").Result(), true
return newCtx, sdk.ErrUnknownRequest("delegated fees aren't supported").Result(), true
}
if !feeDelegationHandler.AllowDelegatedFees(ctx, signerAddrs[0], feeAddr, stdTx.Fee.Amount) {
return newCtx, res, true
Expand All @@ -142,24 +142,16 @@ func NewAnteHandler(ak AccountKeeper, supplyKeeper types.SupplyKeeper, feeDelega
if !res.IsOK() {
return newCtx, res, true
}

// reload the account as fees have been deducted
signerAccs[0] = ak.GetAccount(newCtx, signerAccs[0].GetAddress())
}

// stdSigs contains the sequence number, account number, and signatures.
// When simulating, this would just be a 0-length slice.
stdSigs := stdTx.GetSignatures()

for i := 0; i < len(stdSigs); i++ {
// use cached fee account if not using a delegated fee account
if i == 0 && len(stdTx.FeeAccount) == 0 {
signerAccs[0] = feeAccount
} else {
signerAccs[i], res = GetSignerAcc(newCtx, ak, signerAddrs[i])
if !res.IsOK() {
return newCtx, res, true
}
signerAccs[i], res = GetSignerAcc(newCtx, ak, signerAddrs[i])
if !res.IsOK() {
return newCtx, res, true
}

// check signature, return account with incremented nonce
Expand Down

0 comments on commit af9743a

Please sign in to comment.