These are chat archives for Nethereum/Nethereum

22nd
Jun 2017
ahmad molaie
@molaie
Jun 22 2017 19:44
@juanfranblanco in tutorials, there are samples for Event and DTO's, but nothing for enums, is there any help, or a sample to be able to use enums in contract?
Jacob Brown
@jacobthebrown
Jun 22 2017 22:07
"The method eth_compileSolidity does not exist/is not available"? Did they remove this from GETH and you just decided to
keep the methods or is there another way to compile?
ahmad molaie
@molaie
Jun 22 2017 22:28
image.png
the above is a picture of part of contract, i have an enum, and have 2 functions : setState(State _state) and getState() returns (State)
Calling getState() returns 0
calling setState() has no change on contract
Jacob Brown
@jacobthebrown
Jun 22 2017 22:32
What are you passing in the parameter for setState
ahmad molaie
@molaie
Jun 22 2017 22:32
This is what I pass (picture below):
image.png
MineAndGetReceiptAsync is your function in tutorial solution
i have just commented out Miner.Start() and Miner.Stop(), because miner is already started
Jacob Brown
@jacobthebrown
Jun 22 2017 22:34
It could be a problem with your bytecode, do you have a link to your contract address?
ahmad molaie
@molaie
Jun 22 2017 22:35
yes, actualy there are another functions in contract, i can call them, and state is changed
I run testchain-> startgeth.bat and have a mini customized genesis file
Jacob Brown
@jacobthebrown
Jun 22 2017 22:36
ahh nvm
hmm
ahmad molaie
@molaie
Jun 22 2017 22:37
my genesis File
Jacob Brown
@jacobthebrown
Jun 22 2017 22:37
find the contract address on the block chain and see if the byte code is properly being published to the address
You should do something like
        // Get function of contract
        var multiplyFunction = contract.GetFunction("multiply");

        // Call multiply function from contract.
        var result = await multiplyFunction.CallAsync<int>(7);
I dont know how to do functions with enums but its probably similar
ahmad molaie
@molaie
Jun 22 2017 22:40
I have 6 accounts, one of them is called GateWay, with a simple logic, if any node(account) have a route to GW, we change the state, i deploy contract to Account 2, and Then call That Address with account 4
can this be my problem? calling Account 2 Contract From Account 4?
                        var contract = web3.Eth.GetContract(abi, item.Substring(2));

                    var getState = contract.GetFunction("getState");

                    var result = await getState.CallAsync<int>();
Jacob Brown
@jacobthebrown
Jun 22 2017 22:42
For setState
ahmad molaie
@molaie
Jun 22 2017 22:42
yes, for setState, i call with Account 4, The deployed Contract for Account2