Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

jsonrpc #391

Merged
merged 19 commits into from
Feb 10, 2016
Merged

jsonrpc #391

merged 19 commits into from
Feb 10, 2016

Conversation

debris
Copy link
Collaborator

@debris debris commented Feb 9, 2016

further improvements in jsonrpc

changes:

  • few new rpc methods implementation
  • new type LocalizedTransaction. It contains signed transaction and info about transaction location in canon blockchain.
  • new types BlockId, TransactionId that uniquely identifies position of block/transaction in canon blockchain

questions:

  • where BlockId and TransactionId should be defined? Right they are in views.rs, but I don't like this location.
  • where BlockId and TransactionId should be destructurized? Right now it's blockchain.rs, but I don't know if it's a good place.
  • @arkpar what do you think about replacing all block/block_at methods in client.rs with one that accepts BlockId?

@gavofyork gavofyork added the A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. label Feb 9, 2016
@gavofyork gavofyork changed the title jsonrpc [in progress] jsonrpc Feb 9, 2016
@debris debris added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Feb 10, 2016
@@ -19,6 +19,22 @@ use util::*;
use header::*;
use transaction::*;

/// Uniqly identifies block in canon blockchain.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uniquely. Also blocks from non-canon blockchain can still be identified and requested by hash

@arkpar
Copy link
Collaborator

arkpar commented Feb 10, 2016

Looks ok to me, although it does hide some important details behind the simplified interface. Changing client interface to use BlockId/TransactionId is also fine, as long as there is documentation explaining that querying by hash is always faster and should be preferred over index.
I'd move TransactionId and BlockId to blockchains.rs since they are in part of the blockchain interface and client can just reuse them.

Hash(H256),
/// Block id and transaction index within this block.
/// Querying by block position is always faster.
BlockPosition(BlockId, usize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid using two words when one will do - Position or Location would be fine here.

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 10, 2016
@gavofyork
Copy link
Contributor

looks fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants