graphprotocol / support

Community support for the Hosted Service of The Graph
https://thegraph.com/
10 stars 3 forks source link

Error when calling a function of a SmartContract bound to an External Owned Account #30

Open lmcorbalan opened 5 years ago

lmcorbalan commented 5 years ago

It would be great to have a functionality to check if an address is a contract (similar to web3.eth.getCode('0x...') ) or to be able to handle the error thrown when calling a function of a SmartContract bound to and External Owned Account.

It throws an error like the one below and stops the syncing :

Subgraph instance failed to run: Failed to process trigger: Failed to handle Ethereum event with 
handler "handleEtch": Failed to call function "whom" of contract "DSSpell": ABI error: please ensure 
the contract and method you're calling exist! failed to decode empty bytes. if you're using jsonrpc 
this is likely due to jsonrpc returning `0x` in case contract or method don't exist, code: 
SubgraphSyncingFailure, id: QmSGQfva7mENrW4ZWP57ffsnMbuRXVpiPtjSkxjBNbfswz
leoyvens commented 4 years ago

Would it be possible to provide a minimal subgraph that reproduces this?

lmcorbalan commented 4 years ago

@leoyvens You could use this subgraph https://github.com/protofire/maker-governance-subgraph The error occurs in this line https://github.com/protofire/maker-governance-subgraph/blob/master/src/mappings/DSChief.ts#L399 when you remove the if clause from this other line https://github.com/protofire/maker-governance-subgraph/blob/master/src/mappings/DSChief.ts#L387

Please let me know if it works for you.