Update FetchContractData to allow optional args
This commit is contained in:
parent
5a2bb04670
commit
76dad443ec
@ -19,7 +19,12 @@ func (blockchain *Blockchain) FetchContractData(abiJSON string, address string,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
input, err := parsed.Pack(method, methodArg)
|
var input []byte
|
||||||
|
if methodArg != nil {
|
||||||
|
input, err = parsed.Pack(method, methodArg)
|
||||||
|
} else {
|
||||||
|
input, err = parsed.Pack(method)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user