Update FetchContractData to allow optional args

This commit is contained in:
Matt Krump 2018-03-12 14:09:54 -05:00 committed by Matt K
parent 5a2bb04670
commit 76dad443ec

View File

@ -19,7 +19,12 @@ func (blockchain *Blockchain) FetchContractData(abiJSON string, address string,
if err != nil {
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 {
return err
}