forked from cerc-io/laconicd-deprecated
Finish and clean up module queries and txs (#152)
* Basic transactions set up (to be separated) * Change transaction command to not include create operation (to include other command in next commit) * set up create command and made minor changes * wip implements module queries * Added tests for query address decoding * Added ambiguous encoding of to address in transaction and added tests * Fix linting issue * Move registering key types to application level to allow module usage to ignore * Move genaccounts code to be reused * Switches nonce increase to always happen in ante handler * change SetNonce from keeper to point to actual nonce operation * Remove no op nonce switch (not needed with clearing cache) * Changes to update all accounts pre state transition and clear cache at end of block * Update accounts before end of block commit (edge case where necessary) * Fix nonce of sender going into evm in case it's checked, and let evm set contract starting nonce
This commit is contained in:
+10
@@ -155,6 +155,16 @@ func ethAnteHandler(
|
||||
gas, _ := ethcore.IntrinsicGas(ethTxMsg.Data.Payload, ethTxMsg.To() == nil, true)
|
||||
newCtx.GasMeter().ConsumeGas(gas, "eth intrinsic gas")
|
||||
|
||||
// no need to increment sequence on CheckTx or RecheckTx
|
||||
if !(ctx.IsCheckTx() && !sim) {
|
||||
// increment sequence of sender
|
||||
acc := ak.GetAccount(ctx, senderAddr)
|
||||
if err := acc.SetSequence(acc.GetSequence() + 1); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
ak.SetAccount(ctx, acc)
|
||||
}
|
||||
|
||||
return newCtx, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user