Query and bug fixes (#110)

* Fix queries and bugs

* Fix issues from rebasing

* Fix rpc query address
This commit is contained in:
Austin Abell
2019-09-26 11:36:23 -04:00
committed by GitHub
parent 192ce2cc1c
commit 7f1eb4b0cf
9 changed files with 143 additions and 78 deletions
+19
View File
@@ -0,0 +1,19 @@
package utils
import "math/big"
// MarshalBigInt marshalls big int into text string for consistent encoding
func MarshalBigInt(i *big.Int) string {
bz, err := i.MarshalText()
if err != nil {
panic(err)
}
return string(bz)
}
// UnmarshalBigInt unmarshalls string from *big.Int
func UnmarshalBigInt(s string) (*big.Int, error) {
ret := new(big.Int)
err := ret.UnmarshalText([]byte(s))
return ret, err
}