These are chat archives for Nethereum/Nethereum

25th
Sep 2017
Juan Blanco
@juanfranblanco
Sep 25 2017 08:50
@lbertenasco no you cannot use a managed account with Infura
you will need to sign the transaction and then send to infura
you can do this by either connecting to metamask like in the Flappy + web sample
or signing the trasaction yourself using the users private key
of course another option is to use Uport
kai
@kaista82_twitter
Sep 25 2017 08:56
offline signing is good for security
Juan Blanco
@juanfranblanco
Sep 25 2017 08:57
well a part from that, you cannot let infura have your wallet (which the don't) and pass it your password
to unlock it
kai
@kaista82_twitter
Sep 25 2017 08:58
yup giving away the keys to the kingdom!
RadSt
@RadSt
Sep 25 2017 08:58
Hello all. @juanfranblanco thank you for your library, its awesome ;) I hava a question. Its possible to watch all changes for certain event? And how I can do this?
Juan Blanco
@juanfranblanco
Sep 25 2017 08:59
you will need to poll the event changes
RadSt
@RadSt
Sep 25 2017 09:09
I already tried this. But, then I call GetAllChanges in my method I recieve only current events. Is it possible to get all events included happened before?
Juan Blanco
@juanfranblanco
Sep 25 2017 09:09
include the blocks
in the parametere
RadSt
@RadSt
Sep 25 2017 09:13
The block parameter must be the block of my transaction?
Juan Blanco
@juanfranblanco
Sep 25 2017 09:14
yes the range you are interested to filter by
RadSt
@RadSt
Sep 25 2017 09:14
Ok, thank you.
Juan Blanco
@juanfranblanco
Sep 25 2017 09:14
cool let me know how it goes :D
RadSt
@RadSt
Sep 25 2017 11:06

I created a contract fore deals.

pragma solidity ^0.4.15;

contract Deal{
    event DealCreated(uint256 indexed dealId, 
    address seller, 
    uint256 price,
    uint256 comission);     

    mapping(uint256 => DealEntity) deals;    

    struct DealEntity {
       address seller;
       uint256 price;
       uint256 comission;
       DealType dealType;
    } 
    enum DealType { Sell, Rent }   

    function createDeal(uint256 _dealId, 
    address _seller, 
    uint256 _price, 
    uint256 _comission,
    DealType _dealType) {
         var dealEntity = DealEntity({
           seller: _seller,
           price: _price,
           comission: _comission,
           dealType: _dealType
         });

         deals[_dealId] = dealEntity;
         DealCreated(_dealId, _seller, _price, _comission);
    }   
}

But then I try to log DealCreated event logs they are always empty. If I remove " deals[_dealId] = dealEntity;" event log works normal. In Remix all works fine in both situations.

Server side code:
```
    Contract contract = _smartContractService.GetContract();
        Function createDealFunction = contract.GetFunction("createDeal");
        string transactionHash = await createDealFunction.SendTransactionAsync(_etherOptions.AccountAddress,
            new HexBigInteger(83780), null, 1, sendEthEntity.EthWalletAddress, 1, 2, 0);
        Event dealCreatedEvent = contract.GetEvent("DealCreated");
        var allTransfersFilter = await dealCreatedEvent.CreateFilterAsync(new BlockParameter(0));
        var eventLogsAll = await dealCreatedEvent.GetAllChanges<DealCreated>(allTransfersFilter);
```
I don't understand why my logs are missed then I save struct in mapping.
Juan Blanco
@juanfranblanco
Sep 25 2017 11:13
you have not supplied enough gas
so I assume that you have not reached to raise the event
RadSt
@RadSt
Sep 25 2017 11:28
You are right, thanks! :) After rising gas, it works fine. Then I tested this code on "rinkaby" testnet all my transaction was done without "out of gas errors". But events were empty. It means that in some cases, I don't see errors in my transactions? For example https://rinkeby.etherscan.io/tx/0xbd045e7dab1011000aaf844690c81b04f0f3d007724fe320683b44e38cb5b1a9.
Juan Blanco
@juanfranblanco
Sep 25 2017 11:43
It might have been a clique output
you can see the error when you view the trace
It might have been a clique output
meaning etherscan not outputing errors for clique
RadSt
@RadSt
Sep 25 2017 11:50
Now It is clear, I see the error. Thanks!
Juan Blanco
@juanfranblanco
Sep 25 2017 11:54
cool
amjadDev
@amjadDev
Sep 25 2017 12:14
image.png
not able to load complete solution @juanfranblanco
kai
@kaista82_twitter
Sep 25 2017 15:04
what vs version are you on
may need prerelease we had issues before targetting .netstandard1.1
amjadDev
@amjadDev
Sep 25 2017 16:26
Yes m using vs 2015
kai
@kaista82_twitter
Sep 25 2017 16:32
yeah, you arn't compiling latest neth lib in that
doubtful
15.4 i think you need
2017
community will do