accounts/abi/bind: fix destructive packing of *big.Int

This commit is contained in:
Marius van der Wijden 2019-11-29 19:25:08 +01:00 committed by GitHub
parent fc7e0fe6c7
commit 88b9f2e859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ func packNum(value reflect.Value) []byte {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return U256(big.NewInt(value.Int()))
case reflect.Ptr:
return U256(value.Interface().(*big.Int))
return U256(new(big.Int).Set(value.Interface().(*big.Int)))
default:
panic("abi: fatal error")
}