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:
committed by
GitHub
parent
9a39c6bcb1
commit
2c097bb7a2
@ -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 }
|
||||
|
||||
|
Reference in New Issue
Block a user