Web3Swift icon indicating copy to clipboard operation
Web3Swift copied to clipboard

Bad design - BlockChainState

Open abdulowork opened this issue 7 years ago • 2 comments

BlockChainState is a DTO

We should probably develop 3 decorators for remote procedures instead of having 3 implementations of BlockChainState.

abdulowork avatar Feb 21 '18 15:02 abdulowork

There are 13 JSON RPC methods with BlockChainState. I do not like an idea of having 13+26 more classes in the library.
In most of the use cases, we will have to work with latest tag and sometimes with pending.

rockfridrich avatar Feb 23 '18 20:02 rockfridrich

@rockfridrich I did not suggest to add a class for each case that addresses blockchain state. One of the possible design solutions I see is developing 3 decorators that would be applicable to any (or specific) types of RemoteProcedure. Another solution would be to decorate Network object passed to the RemoteProcedure.

abdulowork avatar Feb 24 '18 10:02 abdulowork