These are chat archives for Nethereum/Nethereum

18th
Feb 2019
Jason Du
@jsdu
Feb 18 03:03
hey can anyone help me out, really struggling setting up the example app for flappy bird, importing the dlls give a biginteger error, anyone have the full source code they can send for flappy bird?
Jason Du
@jsdu
Feb 18 05:24
Ok got it to run now with the block number showing, the only issue is that when I die, I don't see metamask popping up with a transaction, anyone else run into this issue?
Jason Du
@jsdu
Feb 18 06:06
If anyone can take a look at the sample project, that would help a lot, my main issue is that metamask is not popping up and giving a transaction
Psilon
@Pzixel
Feb 18 08:23

@juanfranblanco

Although yes the 50th check plus time delay of check seems fine. Also note they mentioned the issue with nonces

Yep, but it wasn't confirmed yet

I have some RPC headaches lately, so I debug what's wrong
if it's something with nethereum I'l ping you
it LGTM because I checked nonceservice code and it looks fine
but who knows ;)
Kevin Small
@KevinSmall
Feb 18 12:14
@jsdu I have seen similar yes, I've taken a look at the project you posted
There are a couple of things to try
First, in GameControl.UniDied see this line: if (score > TopScoreRecorded && TopScoreRecorded >-1). Change last bit to read TopScoreRecorded >=-1), otherwise I don't think it will try to post a score. The TopScoreRecorded defaults to -1
Kevin Small
@KevinSmall
Feb 18 12:21
Second thing to change is in TopScoreService. The issue I think is the ExternalProvider flag which is always false so metamask won't get called. I think what is happening is the value in the scene is over-ruling the value in the code. Try adding an Awake method like this (to ensure we overwrite the value from the scene):
private void Awake()
{
#if !UNITY_EDITOR
    ExternalProvider = true;
#else
    ExternalProvider = false;
#endif
}
Then check that ExternalProvider is indeed true when you're running in the browser, if it is true you should see metamask popup ok
I tried those changes and metamask pops up ok for me
Jason Du
@jsdu
Feb 18 13:27
thanks @KevinSmall got it to work!
Kevin Small
@KevinSmall
Feb 18 14:23
@jsdu great!
Psilon
@Pzixel
Feb 18 14:26
@juanfranblanco hey
why does SendTransactionAndWaitForReceiptAsync accept CancellationTokenSource instead of CancellationToken?
Psilon
@Pzixel
Feb 18 14:36
Looks like a bug. I'l send a PR
Dave Whiffin
@Dave-Whiffin
Feb 18 15:30
@Pzixel Thanks for the PR - @juanfranblanco is taking a few days off - so he may not be able to review this until next week.
Psilon
@Pzixel
Feb 18 15:30
That's fine, I'm using nuget package anyway, so I don't expect this update soon
I just faced an API inconvinience today and wanted to fix it
Dave Whiffin
@Dave-Whiffin
Feb 18 15:42

@Pzixel Thanks, we appreciate it.

I had a quick peek at the PR. There seems to be a change in existing method signatures - rather than providing new overloaded methods. Juan is the only one in a position to review properly but obviously we need to be really careful to avoid breaking changes which will cause user pain elsewhere. Juan tends not to do things by accident, so I am not sure it's safe to change existing signatures but we'll wait for his input.

Schalk Dormehl
@sjalq
Feb 18 15:44
@juanfranblanco , how do I get the return values from a method which modifies state?
Krunal Solanki
@krunalsolanki
Feb 18 16:15
I am facing one issue with my contract.
I deployed my contract, but all call returns null value, I checked my contract on Ganache its deployed properly.
After deployed contract I run await web3.Eth.GetCode.SendRequestAsync(receipt.ContractAddress).ConfigureAwait(false); and that returns proper value also
Psilon
@Pzixel
Feb 18 16:31
@Dave-Whiffin I guess most of users don't provide default parameters so it should be easy to fix for them.
I appreciate your attention as well
Kevin Small
@KevinSmall
Feb 18 16:38
@krunalsolanki does it work ok against a local geth test chain? (like https://github.com/Nethereum/Testchains)
if so could you post up some code and I can try to replicate
Krunal Solanki
@krunalsolanki
Feb 18 17:15
Sure
its works great in Remix, I am planning to create some POC so started working on Ganache
Here is my sample

pragma solidity ^0.5.0;

pragma experimental ABIEncoderV2;

contract Vote

{

struct OptionPos{

    uint pos;

    bool exists;

}



uint[] public votes;

string[] public options;

mapping(address=>bool) hasVoted;

mapping(string => OptionPos) posOfOptions;



constructor (string[] memory _options ) public {

    options=_options;

    votes.length = options.length;



    for(uint i=0;i<options.length;i++){

        OptionPos memory optionPos = OptionPos(i,true);

        string memory optionName = options[i];

        posOfOptions[optionName] = optionPos;

    }

}


function getOptions() public view  returns(string[] memory strOptions){

    return options;

}

function getVotes() public view returns (uint[] memory intVal) {

    return votes;

}
}
So I am not able to get getOptions or getVotes
value
On counter part, if I can deploy contract through solidity i.e. truffle migrate --reset --network development --verbose-rp
in that case all looks good.
Krunal Solanki
@krunalsolanki
Feb 18 17:20
i found two observation in Ganache, when contract is deployed from Solidity GAS consumption is more 1174475 and when I deployed from Nethereum it only consume 962361
Herry Vu
@herryvu1702
Feb 18 22:04
Pls help
when i use i will get balance
var web3 = new Web3("https://mainnet.infura.io");
var balanceTask = web3.Eth.GetBalance.SendRequestAsync(account.Address);
But when use below balance alway zero
var web3 = new Web3();
var balanceTask = web3.Eth.GetBalance.SendRequestAsync(account.Address);