Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read property 'decodeMethod' of undefined when starting on private chain #60

Open
ice09 opened this issue Dec 14, 2017 · 9 comments
Open

Comments

@ice09
Copy link

ice09 commented Dec 14, 2017

When using watch against private chain, it works, but creates errors on startup:

Start process
Number of transactions are 0
Current block number is 1
Number of transactions are 1
txHash: 0xf67056b7d396757a46a9cc6363620ac252f5c8caa95465290d0fa6228a2b6c93 Cannot read property 'decodeMethod' of undefined
Cannot read property 'decodeMethod' of undefined
TypeError: Cannot read property 'decodeMethod' of undefined
    at JsonRpc.<anonymous> (/Users/alex/dev/granache/smart-contract-watch/dist/index.js:64:63)
@Moejoe90
Copy link
Member

Can you pull the latest Master and test again I'm interested in knowing if the problem is from web3 not getting the blocks for some reason

@ice09
Copy link
Author

ice09 commented Dec 15, 2017

Just cloned master again and the error persists.
Note that I am on a private chain (the contract is read correctly and interactions are logged correctly as well).

@Moejoe90
Copy link
Member

Moejoe90 commented Jan 9, 2018

@ice09
Can you give steps to reproduce this, are you using JSON-RPC, Ganache or a full node Parity, Geth?

@ice09
Copy link
Author

ice09 commented Jan 9, 2018

I used ganache, version 1.0

@ice09
Copy link
Author

ice09 commented Feb 6, 2018

I used ganache, version 1.1.0-beta now, same error:

txHash: 0x4056b1afbc560a483ac2176ba9a2a276930f79c13be2c152e2b3c911ba4cd1ff Cannot read property 'decodeMethod' of undefined
Cannot read property 'decodeMethod' of undefined
TypeError: Cannot read property 'decodeMethod' of undefined

@Moejoe90
Copy link
Member

Moejoe90 commented Feb 6, 2018

I assume since you use ganache that you are deploying your contracts correct? if that's the case are you sure you have your contract ABI's set in the ABI folder?

@ice09
Copy link
Author

ice09 commented Feb 6, 2018

I deployed with remix and copied the ABI (as copied from remix) to address.json in contracts folder, address as shown in remix.

@Moejoe90
Copy link
Member

Moejoe90 commented Feb 6, 2018

I think I know whats going on, can you copy your ABI file exactly like it is on address.json and post it here? You might be copying the whole generated JSON file and only part of it is the actual required ABI.

@ice09
Copy link
Author

ice09 commented Feb 6, 2018

sure:

[
	{
		"constant": true,
		"inputs": [],
		"name": "winningProposal",
		"outputs": [
			{
				"name": "_winningProposal",
				"type": "uint8"
			}
		],
		"payable": false,
		"stateMutability": "view",
		"type": "function"
	},
	{
		"anonymous": false,
		"inputs": [
			{
				"indexed": false,
				"name": "value",
				"type": "uint256"
			}
		],
		"name": "Done",
		"type": "event"
	},
	{
		"constant": false,
		"inputs": [
			{
				"name": "to",
				"type": "address"
			}
		],
		"name": "delegate",
		"outputs": [],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"name": "toVoter",
				"type": "address"
			}
		],
		"name": "giveRightToVote",
		"outputs": [],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"constant": false,
		"inputs": [
			{
				"name": "toProposal",
				"type": "uint8"
			}
		],
		"name": "vote",
		"outputs": [],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"inputs": [
			{
				"name": "_numProposals",
				"type": "uint8"
			}
		],
		"payable": false,
		"stateMutability": "nonpayable",
		"type": "constructor"
	}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants