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

Use trace API for decentralized transaction list #2784

Merged
merged 6 commits into from
Oct 22, 2016
Merged

Conversation

ngotchac
Copy link
Contributor

Closes #2148

This pulls the transaction list of an account from the Trace API if available instead of Etherscan.
The availability of the Trace API is determined as follows :

  • Send a trace_block request to get the traces of the latest block
  • If empty => not in trace mode
  • Else => trace mode available

This should be ok since there aren't that many blocks with no transactions. But it would be worth finding a better solution...

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M5-ui labels Oct 21, 2016
@jacogr jacogr added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 21, 2016
@@ -54,6 +54,16 @@ export default class Status {
.catch(() => dispatch(false));
}

_pollTraceMode = () => {
return this._api.trace.block()
.then(blockTraces => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently miners mine 0 tx's in a block on purpose, not sure this is correct...

});
return (transactions || [])
.sort((tA, tB) => {
return tB.blockNumber - tA.blockNumber;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work? All are BigNumbers. BigNumber however has a sort compare.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1b5945b on ng-decentralized-txs into * on master*.

@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Oct 21, 2016
@jacogr jacogr merged commit 76cded7 into master Oct 22, 2016
@ngotchac ngotchac deleted the ng-decentralized-txs branch October 22, 2016 09:02
@tjayrush
Copy link

A couple of questions:

  1. Is this basically equivalent to the etherscan API requesting transactions lists?
  2. Will the transactions include a flag identifying in-error transactions?
  3. Will the list of transactions include ‘internal transactions’? That is, value transfers initiated on an account by contracts.

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.

4 participants