Skip to content

Commit

Permalink
fix: make ABIVersion==3 a const
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Nov 26, 2019
1 parent d5c1b18 commit 0f45e0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion transactions/tx_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
rlp "github.com/randomshinichi/rlpae"
)

// ABIVersionFATE indicates that the bytecode payload is for the FATE VM. Only
// used in Tx fee calculation
const ABIVersionFATE = 3

func encodeVMABI(VMVersion, ABIVersion uint16) []byte {
vmBytes := big.NewInt(int64(VMVersion)).Bytes()
abiBytes := big.NewInt(int64(ABIVersion)).Bytes()
Expand Down Expand Up @@ -366,7 +370,7 @@ func (tx *ContractCallTx) GetFee() *big.Int {
// CalcGas implements Transaction
func (tx *ContractCallTx) CalcGas() (g *big.Int, err error) {
baseGas := new(big.Int)
if tx.AbiVersion == 3 {
if tx.AbiVersion == ABIVersionFATE {
baseGas.Mul(config.Client.BaseGas, big.NewInt(12))
} else {
baseGas.Mul(config.Client.BaseGas, big.NewInt(30))
Expand Down

0 comments on commit 0f45e0a

Please sign in to comment.