aboutsummaryrefslogtreecommitdiffstats
path: root/mobile/types.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-13 19:47:27 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-03 20:45:35 +0800
commit6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (patch)
treec92974f8b82209073ad1ee3faec6e149f834bf69 /mobile/types.go
parentb8caba97099ee5eed33c3b80dd4ea540722e7d8f (diff)
downloaddexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.gz
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.zst
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.zip
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'mobile/types.go')
-rw-r--r--mobile/types.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/mobile/types.go b/mobile/types.go
index b7f8a3bc1..4790afcef 100644
--- a/mobile/types.go
+++ b/mobile/types.go
@@ -112,8 +112,8 @@ func (h *Header) GetReceiptHash() *Hash { return &Hash{h.header.ReceiptHash} }
func (h *Header) GetBloom() *Bloom { return &Bloom{h.header.Bloom} }
func (h *Header) GetDifficulty() *BigInt { return &BigInt{h.header.Difficulty} }
func (h *Header) GetNumber() int64 { return h.header.Number.Int64() }
-func (h *Header) GetGasLimit() int64 { return h.header.GasLimit.Int64() }
-func (h *Header) GetGasUsed() int64 { return h.header.GasUsed.Int64() }
+func (h *Header) GetGasLimit() int64 { return int64(h.header.GasLimit) }
+func (h *Header) GetGasUsed() int64 { return int64(h.header.GasUsed) }
func (h *Header) GetTime() int64 { return h.header.Time.Int64() }
func (h *Header) GetExtra() []byte { return h.header.Extra }
func (h *Header) GetMixDigest() *Hash { return &Hash{h.header.MixDigest} }
@@ -189,8 +189,8 @@ func (b *Block) GetReceiptHash() *Hash { return &Hash{b.block.ReceiptHash()} }
func (b *Block) GetBloom() *Bloom { return &Bloom{b.block.Bloom()} }
func (b *Block) GetDifficulty() *BigInt { return &BigInt{b.block.Difficulty()} }
func (b *Block) GetNumber() int64 { return b.block.Number().Int64() }
-func (b *Block) GetGasLimit() int64 { return b.block.GasLimit().Int64() }
-func (b *Block) GetGasUsed() int64 { return b.block.GasUsed().Int64() }
+func (b *Block) GetGasLimit() int64 { return int64(b.block.GasLimit()) }
+func (b *Block) GetGasUsed() int64 { return int64(b.block.GasUsed()) }
func (b *Block) GetTime() int64 { return b.block.Time().Int64() }
func (b *Block) GetExtra() []byte { return b.block.Extra() }
func (b *Block) GetMixDigest() *Hash { return &Hash{b.block.MixDigest()} }
@@ -212,8 +212,8 @@ type Transaction struct {
}
// NewTransaction creates a new transaction with the given properties.
-func NewTransaction(nonce int64, to *Address, amount, gasLimit, gasPrice *BigInt, data []byte) *Transaction {
- return &Transaction{types.NewTransaction(uint64(nonce), to.address, amount.bigint, gasLimit.bigint, gasPrice.bigint, common.CopyBytes(data))}
+func NewTransaction(nonce int64, to *Address, amount *BigInt, gasLimit int64, gasPrice *BigInt, data []byte) *Transaction {
+ return &Transaction{types.NewTransaction(uint64(nonce), to.address, amount.bigint, uint64(gasLimit), gasPrice.bigint, common.CopyBytes(data))}
}
// NewTransactionFromRLP parses a transaction from an RLP data dump.
@@ -256,7 +256,7 @@ func (tx *Transaction) String() string {
}
func (tx *Transaction) GetData() []byte { return tx.tx.Data() }
-func (tx *Transaction) GetGas() int64 { return tx.tx.Gas().Int64() }
+func (tx *Transaction) GetGas() int64 { return int64(tx.tx.Gas()) }
func (tx *Transaction) GetGasPrice() *BigInt { return &BigInt{tx.tx.GasPrice()} }
func (tx *Transaction) GetValue() *BigInt { return &BigInt{tx.tx.Value()} }
func (tx *Transaction) GetNonce() int64 { return int64(tx.tx.Nonce()) }
@@ -353,10 +353,10 @@ func (r *Receipt) String() string {
return r.receipt.String()
}
-func (r *Receipt) GetPostState() []byte { return r.receipt.PostState }
-func (r *Receipt) GetCumulativeGasUsed() *BigInt { return &BigInt{r.receipt.CumulativeGasUsed} }
-func (r *Receipt) GetBloom() *Bloom { return &Bloom{r.receipt.Bloom} }
-func (r *Receipt) GetLogs() *Logs { return &Logs{r.receipt.Logs} }
-func (r *Receipt) GetTxHash() *Hash { return &Hash{r.receipt.TxHash} }
-func (r *Receipt) GetContractAddress() *Address { return &Address{r.receipt.ContractAddress} }
-func (r *Receipt) GetGasUsed() *BigInt { return &BigInt{r.receipt.GasUsed} }
+func (r *Receipt) GetPostState() []byte { return r.receipt.PostState }
+func (r *Receipt) GetCumulativeGasUsed() int64 { return int64(r.receipt.CumulativeGasUsed) }
+func (r *Receipt) GetBloom() *Bloom { return &Bloom{r.receipt.Bloom} }
+func (r *Receipt) GetLogs() *Logs { return &Logs{r.receipt.Logs} }
+func (r *Receipt) GetTxHash() *Hash { return &Hash{r.receipt.TxHash} }
+func (r *Receipt) GetContractAddress() *Address { return &Address{r.receipt.ContractAddress} }
+func (r *Receipt) GetGasUsed() int64 { return int64(r.receipt.GasUsed) }