aboutsummaryrefslogtreecommitdiffstats
path: root/mobile/types.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-12-08 20:09:26 +0800
committerFelix Lange <fjl@twurst.com>2016-12-08 20:09:26 +0800
commit0fe35b907addf1c066cb4d7c717bb23f9f2e7be4 (patch)
treece23037c4256b7c1ec4561d7477c33b328aa81e8 /mobile/types.go
parent3fc7c978277051391f8ea7831559e9f4f83c3166 (diff)
downloaddexon-0fe35b907addf1c066cb4d7c717bb23f9f2e7be4.tar.gz
dexon-0fe35b907addf1c066cb4d7c717bb23f9f2e7be4.tar.zst
dexon-0fe35b907addf1c066cb4d7c717bb23f9f2e7be4.zip
mobile: iOS naming and API fixes for generators and Swift (#3408)
* build: modify the iOS namespace to iGeth (gomobile limitation) * mobile: assign names to return types for ObjC wrapper * mobile: use more expanded names for iOS/Swift API
Diffstat (limited to 'mobile/types.go')
-rw-r--r--mobile/types.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/mobile/types.go b/mobile/types.go
index bb5ccc625..9ea70ea9b 100644
--- a/mobile/types.go
+++ b/mobile/types.go
@@ -89,7 +89,7 @@ func (h *Headers) Size() int {
}
// Get returns the header at the given index from the slice.
-func (h *Headers) Get(index int) (*Header, error) {
+func (h *Headers) Get(index int) (header *Header, _ error) {
if index < 0 || index >= len(h.headers) {
return nil, errors.New("index out of bounds")
}
@@ -142,7 +142,7 @@ func (tx *Transaction) GetHash() *Hash { return &Hash{tx.tx.Hash()} }
func (tx *Transaction) GetSigHash() *Hash { return &Hash{tx.tx.SigHash(types.HomesteadSigner{})} }
func (tx *Transaction) GetCost() *BigInt { return &BigInt{tx.tx.Cost()} }
-func (tx *Transaction) GetFrom() (*Address, error) {
+func (tx *Transaction) GetFrom() (address *Address, _ error) {
from, err := types.Sender(types.HomesteadSigner{}, tx.tx)
return &Address{from}, err
}
@@ -154,25 +154,25 @@ func (tx *Transaction) GetTo() *Address {
return nil
}
-func (tx *Transaction) WithSignature(sig []byte) (*Transaction, error) {
- t, err := tx.tx.WithSignature(types.HomesteadSigner{}, sig)
- return &Transaction{t}, err
+func (tx *Transaction) WithSignature(sig []byte) (signedTx *Transaction, _ error) {
+ rawTx, err := tx.tx.WithSignature(types.HomesteadSigner{}, sig)
+ return &Transaction{rawTx}, err
}
// Transactions represents a slice of transactions.
type Transactions struct{ txs types.Transactions }
// Size returns the number of transactions in the slice.
-func (t *Transactions) Size() int {
- return len(t.txs)
+func (txs *Transactions) Size() int {
+ return len(txs.txs)
}
// Get returns the transaction at the given index from the slice.
-func (t *Transactions) Get(index int) (*Transaction, error) {
- if index < 0 || index >= len(t.txs) {
+func (txs *Transactions) Get(index int) (tx *Transaction, _ error) {
+ if index < 0 || index >= len(txs.txs) {
return nil, errors.New("index out of bounds")
}
- return &Transaction{t.txs[index]}, nil
+ return &Transaction{txs.txs[index]}, nil
}
// Receipt represents the results of a transaction.