Nethereum: Exception: invalid argument 2: json: cannot unmarshal string into Go value of type uint64 when deploying a contract
Exception:
invalid argument 2: json: cannot unmarshal string into Go value of type uint64
when deploying a contract.
Geth version: 1.5.9
Seems to be working with an older Geth version
var transactionHash = await web3.Eth.DeployContract.SendRequestAsync(_abi, _byteCode, nodePublicKey, gas, balance, new object[] { });
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (11 by maintainers)
Commits related to this issue
- #103 Tested issue on 1.9 — committed to Nethereum/Nethereum by juanfranblanco 7 years ago
- #103 Example using payeable constructor — committed to Nethereum/Nethereum by juanfranblanco 7 years ago
For anybody with this issue: If using latest Geth to unlock an account it requires an integer, earlier versions requires a Hex parameter. There are 2 overloads for backwards compatibility.
Shouldn’t that be mentioned on this article under “Unlocking the account”? https://nethereum.readthedocs.io/en/latest/contracts/deploying/#deployment
Geth 1.5.9; I actually just changed the code from HexBigInteger(120) to just 120, and it worked.
Code that seems to be working and returning true:
var unlockAccountResult = await web3.Personal.UnlockAccount.SendRequestAsync(senderAddress, password, 120);
I am also getting this error.
CODE:
var senderAddress = “0x12890d2cce102216644c59dae5baed380d84830c”; var password = “password”; var web3Geth = new Web3Geth(); var unlockAccountResult = await web3Geth.Personal.UnlockAccount.SendRequestAsync(senderAddress, password, new HexBigInteger(120));
EXCEPTION:
I am getting the runtime error: Nethereum.JsonRpc.Client.RpcResponseException: ‘invalid argument 2: json: cannot unmarshal string into Go value of type uint64’