Skip to content

Commit

Permalink
fix fee op return value
Browse files Browse the repository at this point in the history
  • Loading branch information
rockneiep committed Apr 28, 2019
1 parent d260b19 commit f23ba75
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions processor/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ var (
)

const (
AccountFee = 1
AssetFee = 2
AccountFee uint64 = 1
AssetFee uint64 = 2
)

func opAdd(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
Expand Down Expand Up @@ -1322,19 +1322,19 @@ func opWithdrawFee(pc *uint64, evm *EVM, contract *Contract, memory *Memory, sta
acct, err := evm.AccountDB.GetAccountById(objID)
if err != nil || acct == nil {
stack.push(evm.interpreter.intPool.getZero())
return nil, err
return nil, nil
}
name = acct.GetName()
} else if withdrawType == AssetFee {
assetInfo, err := evm.AccountDB.GetAssetInfoByID(objID)
if err != nil || assetInfo == nil {
stack.push(evm.interpreter.intPool.getZero())
return nil, err
return nil, nil
}
name = common.Name(assetInfo.GetAssetName())
} else {
stack.push(evm.interpreter.intPool.getZero())
return nil, fmt.Errorf("object type not correct")
return nil, nil
}

err := execWithdrawFee(evm, contract, name)
Expand All @@ -1346,7 +1346,7 @@ func opWithdrawFee(pc *uint64, evm *EVM, contract *Contract, memory *Memory, sta
}
evm.interpreter.intPool.put(feeType, feeId)

return nil, err
return nil, nil
}

func execWithdrawFee(evm *EVM, contract *Contract, withdrawTo common.Name) error {
Expand Down

0 comments on commit f23ba75

Please sign in to comment.