forked from cerc-io/laconicd-deprecated
Query and bug fixes (#110)
* Fix queries and bugs * Fix issues from rebasing * Fix rpc query address
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user