These are chat archives for Nethereum/Nethereum

18th
May 2017
Lucas Cullen
@bitcoinbrisbane
May 18 2017 06:19
@juanfranblanco got any TODOs that need attention?
Juan Blanco
@juanfranblanco
May 18 2017 06:20
@bitcoinbrisbane Documentation
:)
Upgrade the docs for v2
This is what I am working at the moment

Juan Blanco
@juanfranblanco
May 18 2017 06:25
another interesting one will be the setup appveyor + travis for automated integration testing (and unit testing)
including parity and geth
andrew-tud
@andrew-tud
May 18 2017 07:43

Hi, Juan, I followed your advice and went to https://remix.ethereum.org/#version=soljson-v0.4.11+commit.68ef5810.js to test the contract: contract test {
int _multiplier;

function test(int multiplier) {
    _multiplier = multiplier;
}

function multiply(int val) returns(int d) {
    return val * _multiplier;
}

}

but Im having the error Type int256 not supported for state variable int _multiplier
Im trying to have an estimate for gas for contracts I will be using but https://remix.ethereum.org/#version=soljson-v0.4.12-nightly.2017.5.17+commit.b4c6877a.js is not giving the gas estimate needed for the contract maybe due to the above error.
I am still on the issue on trying to supply enough gas for a more complicated smart contract in nethereum as Im having code 0x when invoking var code = await web3.Eth.GetCode.SendRequestAsync(contractAddress);. Could anyone help me out on this? Thank you very much
andrew-tud
@andrew-tud
May 18 2017 07:57
Does this have something to do with "difficulty": "0x200", in genesis_dev.json? Im not sure if Im going in the right path to solve the issue. Any help would be much appreciated. Thank you
Juan Blanco
@juanfranblanco
May 18 2017 08:02
image.png
@andrew-tud an example ^^
you can see the cost there of deployment that you can use as guidance
geth estimate is not yet perfect
andrew-tud
@andrew-tud
May 18 2017 09:59
Thank you. Setting web3.Eth.DeployContract.SendRequestAsync(abi, byteCode, senderAddress, new HexBigInteger(900000), "") worked. I would have spent more hours trying to figure out the solution to my problem. Many thanks!
Juan Blanco
@juanfranblanco
May 18 2017 10:40
:+1:
Veikko Eeva
@veikkoeeva
May 18 2017 17:12

Hi! Newbie question from a new one here, but I wonder how you guys test Ethereum contracts?

Currently in the test I start a Ethereum node (geth) with Process using command line "--datadir "C:\temp\" --identity "Test" --rpc "http://localhost:12345" --mine --minerthreads 1 --nodiscover --maxpeers 0. For instance, I wonder, if it would be useful to add --cache=1024 --jitvm too? Currently I just delete the data directory, but maybe in the future I should make some known initial state to repository and use that. Is there a reason this wouldn't work?

Definitely n00b question, maybe even too so, but any pointers are appreciated. :)
Juan Blanco
@juanfranblanco
May 18 2017 17:12
Depends as usual
you should try truffle to do testing of solidity
Veikko Eeva
@veikkoeeva
May 18 2017 17:13
@juanfranblanco I'm looking at it and thinking on how to use it with VS 2017 and in .NET project. Would you say likey any JS/TS project?
It appears https://marketplace.visualstudio.com/items?itemName=ConsenSys.Solidity isn't coming to VS 2017 anytime soon.
Juan Blanco
@juanfranblanco
May 18 2017 17:14
for integration testing I use the Nethereum.TestRpc
and yes combining it it with the testchain in the Nethereum folder
Veikko Eeva
@veikkoeeva
May 18 2017 17:15
@juanfranblanco Me too. :P Though I just started this. Just fiddling here and trying to ask around and not to do obvious mistakes.
It looks like this could be the right path.
Juan Blanco
@juanfranblanco
May 18 2017 17:16
Yes :)
Don't worry, there are no silly questions. Also any question is great, as it is great feedback
Veikko Eeva
@veikkoeeva
May 18 2017 17:19
@juanfranblanco The problem, as usual, is where to start when things are unknown unknowns. :) But this was a good bit of information, it's encouraging to know being about the right path. Hey, do you happen to have a good blog post to read, like off-the-cuff? Curated ones are OK, but I think I can manage to search around Internet too.
Working on updating the docs, and creating some blog posts :)
Also have a look at ...
sample unit test using test rpc
or..
same
or tutorials source code
the above one describes features on 2.0.0 for accounts
Veikko Eeva
@veikkoeeva
May 18 2017 17:28

I have to take a look tonight. I'm trying the get the kids to sleep. :P

Currently I have like this

/// <summary>
        /// A sanity check.
        /// </summary>        
        [Fact]
        public async Task EthereumClientVersionCheckSucceeds()
        {                                                                 
            var res = await EthereumClient.SendRequestAsync("web3_clientVersion");

            Assert.False(res.HasError, "Ethereum client version check returned error.");            
        }

And starting the the geth process is done in the fixture (like above the command line)

public EthereumTests(GeneralEthereumFixture generalEthereumFixture)
        {
            Fixture = generalEthereumFixture ?? throw new ArgumentNullException(nameof(generalEthereumFixture));
            EthereumClient = new RpcClient(Fixture.ClientUrl);            
        }

I think there's a delay when the Ethereum process has started, but doesn't yet listen to the port.

I'm actually thinking if there's a better way remediating it than adding a delay. It looks like that some random failures of the process not listening can be mitigated by adding a second of delay before doing that sanity test. I don't have contracts to test yet, but I'm hoping to write unit tests like that to do that too.
Juan Blanco
@juanfranblanco
May 18 2017 17:46
You are using the RPC directly which it is no problem, but using Web3 and Contracts will simplified the whole process
check the documentation
for deployment, it will help you get started
Veikko Eeva
@veikkoeeva
May 18 2017 17:51
@juanfranblanco These links are just the thing I was looking for. Cheers. I think I'll lurk here and see what I can learn. :)
Juan Blanco
@juanfranblanco
May 18 2017 17:52
Feel free to ask anything :)
Veikko Eeva
@veikkoeeva
May 18 2017 17:53
I will, once I get into the actual meat of this. Cheers!