From 06cfbf5742335a18fd2e5d2ab2197f96fcadb72d Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Thu, 26 Mar 2020 22:11:06 +0100 Subject: [PATCH] Switch exitcodes Signed-off-by: Jakub Sztandera --- chain/vm/vm.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chain/vm/vm.go b/chain/vm/vm.go index 3c6281076..d3ec1b473 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -73,7 +73,7 @@ func ResolveToKeyAddr(state types.StateTree, cst cbor.IpldStore, addr address.Ad act, err := state.GetActor(addr) if err != nil { - return address.Undef, aerrors.Newf(byte(exitcode.SysErrSenderInvalid), "failed to find actor: %s", addr) + return address.Undef, aerrors.Newf(byte(exitcode.SysErrInternal), "failed to find actor: %s", addr) } if act.Code != builtin.AccountActorCodeID { @@ -292,12 +292,12 @@ func (vm *VM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet, } pl := PricelistByEpoch(vm.blockHeight) + msgGasCost := pl.OnChainMessage(cmsg.ChainLength()) - // TODO: charge miner?? if msgGasCost > msg.GasLimit { return &ApplyRet{ MessageReceipt: types.MessageReceipt{ - ExitCode: exitcode.SysErrOutOfGas, + ExitCode: exitcode.SysErrSenderStateInvalid, GasUsed: 0, }, Penalty: types.BigMul(msg.GasPrice, types.NewInt(uint64(msgGasCost))),