Moved fetcher to generic directory (methods have to remain public since it is in seperate package now), added FetchHash method, created ERC20 and generic getters which call the fetcher with specific contract methods (GetTotalSupply, GetBalance, GetAllowance for ERC20 getter, and GetOwner, GetStoppedStatus, GetStringName, GetHashName, GetStringSymbol, GetHashSymbol, and GetDecimals for generic getter). Getter tests cover all but GetBalance and GetAllowance, and also cover all of the Fetcher methods- but with only nil methodArgs. GetAllowance and GetBalance tests are not working against infura and these are the only contract method calls with arguments passed in so I suspect this might be where the issue lies. Have tested GetBalance using previous version of FetchContractData without the variadic input to the Pack method and it fails with the same error so I don’t think it is due to those changes.

This commit is contained in:
Ian Norden
2018-11-03 13:49:23 -05:00
parent 99e549b3df
commit 9b41000b88
15 changed files with 837 additions and 243 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ type MockBlockChain struct {
fetchContractDataPassedAbi string
fetchContractDataPassedAddress string
fetchContractDataPassedMethod string
fetchContractDataPassedMethodArgs []interface{}
fetchContractDataPassedMethodArgs []interface{}
fetchContractDataPassedResult interface{}
fetchContractDataPassedBlockNumber int64
getBlockByNumberErr error