These are chat archives for Nethereum/Nethereum

9th
Dec 2018
Juan Blanco
@juanfranblanco
Dec 09 2018 05:28
The main reason is that for Nethereum everything depends on the behaviour of the clients, ie integration testing
the Services as just plain abstractions and wrappers for simple syntax sugar of the rpc commands
i could introduce interfaces everywhere but the decision was made to avoid class explosion and to simplify user interaction
the truth is that for Nethereum or any interaction you DO want to spin up Geth / Parity / xx because you do depend on the behaviour of the clients, just mocking some call will give you false sense of security that the clients are going to behave the way you want
Juan Blanco
@juanfranblanco
Dec 09 2018 05:33
now if you want to just do the superficial mocking test where you have an expectation of calling something in that service
ie ShouldCallThis with this Values
maybe.. but you are putting too much trust in the clients to behave currectly
this one of the main reasons, just creating abstractions to "see unit test pass"
in this space, is not the best thing
hence the decision to avoid that (i have seen other clients, fail mainly due to that reason)
"client" as in like Nethereum
Juan Blanco
@juanfranblanco
Dec 09 2018 05:39
so overall unit testing "here" in Ethereum when interacting with the chain, is not the best approach IMHO. False sense of security.
Juan Blanco
@juanfranblanco
Dec 09 2018 05:44
same for contracts :), this is why the whole setup in Nethereum to launch Geth and Parity.
you can convince me otherwise
Juan Blanco
@juanfranblanco
Dec 09 2018 06:02
saying so, in the future with Serenity etc yes sure, I will put that in place
turtlewen
@turtlewen
Dec 09 2018 07:27
@juanfranblanco so if i my second nodes mining, and own computer didnt mining, my asp.net is connected to my second nodes and i want my asp.net to get the mining nodes account is that possible?? cause no need every time change the sender address in asp.net
Juan Blanco
@juanfranblanco
Dec 09 2018 08:02
so the question is, if you query your node 2 from a asp.net (or whatever) to check if is mining , or its own accounts, yeah that will return those values for that specific node
Juan Blanco
@juanfranblanco
Dec 09 2018 10:15
@Shammah well i changed my mind after a long time, i think is time let the training wheels go. Latest check in has all the apis with interfaces
Roy
@Shammah
Dec 09 2018 13:28
Oh thanks! I wasn't even able to come up with counter-arguments, what changed your mind? ;)
Another question; that same commit contains the following line: Removed subscriptions from Web3, it is going to be in another specific library
Are these subscriptions in the sense of continuously watching the blockchain, or is it more of a continuous and open connection to the RPC client? I'm asking because I'm currently working on reactive extension methods myself, that allows creation and manipulation of IObservables. A Nethereum.Reactive if you will.
Juan Blanco
@juanfranblanco
Dec 09 2018 13:30
Mainly it has been asked before, and I think after these years things won't change as much. Although yes I still recommend integration over unit testing all the time
literally that is what I am doing
Roy
@Shammah
Dec 09 2018 13:30
Oh...
Darnit
Juan Blanco
@juanfranblanco
Dec 09 2018 13:32
well for websockets, the subscriptions of the pull, which is a great pull, they benefit more from observables
Roy
@Shammah
Dec 09 2018 13:32
I'm not sure if I should continue my work in that case
Juan Blanco
@juanfranblanco
Dec 09 2018 13:33
Roy
@Shammah
Dec 09 2018 13:33
Ah, interesting. Looks like a better approach than my current polling method using simply eth_getFilterChanges
Juan Blanco
@juanfranblanco
Dec 09 2018 13:35
ah you meant to having observable extensions for polling, yeah those will be great too :)
but sure you will get faster notifications the other way
nevertheless everything is good
ill push something at the end of the day
(last words )
Roy
@Shammah
Dec 09 2018 13:37
Yeah I'm in a bit of a pickle now. pub/sub is obviously superior, I'd even drop development of state polling for it.
Juan Blanco
@juanfranblanco
Dec 09 2018 13:39
well everything is good, different scenarios
Roy
@Shammah
Dec 09 2018 13:43
Whether you're polling or using websockets, the data gathering method doesn't really matter from a user perspective, who consumes the reactive observable streams such as IObservable<Block> OnNewBlocks(). I'll see what you've come up with so far and then we may see what overlaps and what differs.
I'll dive in a bit more into web3, not sure how I've missed subscriptions in the first place...
Juan Blanco
@juanfranblanco
Dec 09 2018 13:44
well it was not something available before and deem as experimental
but yeah the overall response for the user will be the same in an observable perspective
although the handler will be different as duplex communication needs to be managed by the user, ie connecting / disconnecting
and the subscription mechanism, one thing is correct they will be interested on the same type of information, so the observables might end up being the same
Roy
@Shammah
Dec 09 2018 13:50
In that case I'll continue, but in a less robust way and see where we'll meet in the future
magik-chorne
@magik-chorne
Dec 09 2018 19:43
Anyone know of some examples of using FunctionMessage where the data input is more complex (arrays - custom classes?) I'm having trouble figuring out the required syntax
magik-chorne
@magik-chorne
Dec 09 2018 19:59
scratch that - I finally found https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Accounts.IntegrationTests/ABIStructsTests.cs -- looks like the syntax is something like:
[Parameter("tuple[]", "optimizedMarketOrders", 1)]
public List<Order> OptimizedMarketOrders { get; set; }