aboutsummaryrefslogtreecommitdiffstats
path: root/mobile/types.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-24 17:49:20 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-13 20:00:02 +0800
commit833e4d1319336fbb66fd8f1e473c24472d65b17b (patch)
tree74d45d86d0c59c19f0ff67831f04e0cad9776eef /mobile/types.go
parent564b60520c68a1f06171abd705c01946b932492f (diff)
downloaddexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.tar
dexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.tar.gz
dexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.tar.bz2
dexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.tar.lz
dexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.tar.xz
dexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.tar.zst
dexon-833e4d1319336fbb66fd8f1e473c24472d65b17b.zip
accounts, cmd, eth, internal, mobile, node: split account backends
Diffstat (limited to 'mobile/types.go')
-rw-r--r--mobile/types.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/mobile/types.go b/mobile/types.go
index 9ea70ea9b..a9c8cf68c 100644
--- a/mobile/types.go
+++ b/mobile/types.go
@@ -132,6 +132,11 @@ type Transaction struct {
tx *types.Transaction
}
+// 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, data)}
+}
+
func (tx *Transaction) GetData() []byte { return tx.tx.Data() }
func (tx *Transaction) GetGas() int64 { return tx.tx.Gas().Int64() }
func (tx *Transaction) GetGasPrice() *BigInt { return &BigInt{tx.tx.GasPrice()} }