Comments (6)
With your version when we will receive an incomplete block or undefined we will also delete the data about last correct block... Regarding why we receive bad data...it's an Infura issue i guess, maybe they only know that a new block was mined but they don't have full header of that block and when we ask for that block we get undefined or incomplete data..
from ethereum-lite-explorer.
Ah, I get it. Thanks for the explanation. Hmm... then the other code style would be to remove all the nesting so that there is only one assignment... I could go either way really... this is just semantics at this point and I don't mean to be a pain.
setLastBlockFull(state, block) {
if (!state.lastBlockFull ||
(block && block.number && state.lastBlockFull.number < block.number)) {
state.lastBlockFull = block;
}
},
from ethereum-lite-explorer.
I will test your final version and if it works (i think it will work) i will use it because it's not so nested :)
Thank you!
from ethereum-lite-explorer.
Added in #21 :)
from ethereum-lite-explorer.
Could the logic for this method be simplified?
setLastBlockFull(state, block) {
if (state.lastBlockFull) {
if (block && block.number) {
if (state.lastBlockFull.number < block.number) {
state.lastBlockFull = block;
}
}
} else {
state.lastBlockFull = block;
}
},
to this...
setLastBlockFull(state, block) {
if (block && block.number) {
if (!state.lastBlockFull || state.lastBlockFull.number < block.number) {
state.lastBlockFull = block;
}
} else {
state.lastBlockFull = undefined;
}
},
The part that I'm not sure is if/why block would be undefined/null. I'd rather see it explicitly set to undefined instead because that creates self documenting code.
from ethereum-lite-explorer.
Oh, I wish there were automated tests. ;-) #4
from ethereum-lite-explorer.
Related Issues (20)
- Seems DEAD
- Not connecting to node when using HTTP Basic Authentication HOT 3
- Getting Exited with code 3 HOT 3
- Can I add plugin in the Docker container? HOT 3
- Latest DockerHub image not updated? HOT 3
- How to update translations? HOT 5
- can not find plugin version HOT 1
- Cannot access from outside localhost HOT 10
- Integrate data from IBFT config with data from memento HOT 9
- Cors origin & Error: Latest block should be set by now
- [feature] Option to view Input Data to UTF-8 like in etherscan
- npm run build
- The 'Example Setups' section is listed in pantheon, not besu. HOT 7
- Is it possible to add API functions
- index.js is missing while npm start
- Help running with Besu HOT 1
- POA extradata breaks eth-ibft2
- Help running with Geth HOT 1
- DOES NOT WORK!!! The alethic website is down. Cannot connect to their service.
- 404 error while running the ethereum lite explorer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereum-lite-explorer.