mobile: fix mobile interface (#19180)

* mobile: fix mobile interface

* mobile, accounts: generate correct java binding

* accounts: fix java type binding

* mobile: support integer slice

* accounts/abi/bind, cmd/abigen: implement java binding tests
This commit is contained in:
gary rong
2019-06-27 16:48:13 +08:00
committed by Péter Szilágyi
parent fd072c2fd1
commit 6069b1a5f5
9 changed files with 908 additions and 238 deletions

View File

@ -25,6 +25,7 @@ import (
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)
// Hash represents the 32 byte Keccak256 hash of arbitrary data.
@ -228,3 +229,13 @@ func (a *Addresses) Set(index int, address *Address) error {
func (a *Addresses) Append(address *Address) {
a.addresses = append(a.addresses, address.address)
}
// EncodeToHex encodes b as a hex string with 0x prefix.
func EncodeToHex(b []byte) string {
return hexutil.Encode(b)
}
// DecodeFromHex decodes a hex string with 0x prefix.
func DecodeFromHex(s string) ([]byte, error) {
return hexutil.Decode(s)
}