mobile: better api for java users (#21580)

* (mobile): Adds string representations for types

* mobile: better interfaces add stringer to types

Co-authored-by: sarath <sarath@melvault.com>
This commit is contained in:
Marius van der Wijden
2020-09-21 16:33:35 +02:00
committed by GitHub
parent 9a39c6bcb1
commit 2c097bb7a2
5 changed files with 93 additions and 0 deletions

View File

@ -87,6 +87,11 @@ func (h *Hash) GetHex() string {
return h.hash.Hex()
}
// String implements Stringer interface for printable representation of the hash.
func (h *Hash) String() string {
return h.GetHex()
}
// Hashes represents a slice of hashes.
type Hashes struct{ hashes []common.Hash }
@ -188,6 +193,11 @@ func (a *Address) GetHex() string {
return a.address.Hex()
}
// String returns a printable representation of the address.
func (a *Address) String() string {
return a.GetHex()
}
// Addresses represents a slice of addresses.
type Addresses struct{ addresses []common.Address }