DAVFoundation / xplore

⛓ A block explorer for local Ethereum testnets
MIT License
62 stars 65 forks source link

The latest block in the blockchain displayed in TopBlocks component #81

Closed bicep closed 5 years ago

bicep commented 6 years ago

Once the promise in the getLatestBlock action is fulfilled, the getLatestBlockFulfilled action is run and the action is handled (see reducer/topBlocks.js) and passed onto the new state. This updates props that is passed into the TopBlocks component.

Related Issue

78

How Has This Been Tested?

The app displays the latest block if you run dav-cli -s.

bicep commented 6 years ago
newState.blockList.map((block) => {
  if (block.tag === 'lastBlock') block.value = payload.toString();
});

This code is painful. I think that the initialState object should not contain an array. Each entry in the header should just have its own property in the object.

griffobeid commented 6 years ago

The problem with switching initialState from an array is that the TopBlocks component relies on it being an array. What do you propose we do instead?

bicep commented 6 years ago

I was thinking an object, but I think it'll be painful for other reasons too 😅

Any updates on this PR? @TalAter this PR is very similar to the one I just submitted for latest Transaction. Let me know what you think.

debragail commented 5 years ago

@TalAter

TalAter commented 5 years ago

@bicep I tried merging this one, but it seems to have diverged too much from master. I resolved the conflicts but it still didn't work. Would you like to fix this and resubmit, or should I close it?

bicep commented 5 years ago

Hi I'd like to try to resolve this.

Should I submit a new PR since you closed this one? @TalAter

TalAter commented 5 years ago

I think that might be easiest for you considering the time that has passed.