mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 21:34:33 +00:00
fix render missing field in premix report page
This commit is contained in:
parent
c98e337090
commit
691dc5566f
@ -98,6 +98,26 @@ function opCodeRenderer(txId, nimbus, geth) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function fillEmptyList(a, b) {
|
||||
if(a.length > b.length) {
|
||||
for(var i in a) {
|
||||
if(b[i] === undefined) {
|
||||
b[i] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fillEmptyMap(a, b) {
|
||||
if(Object.keys(a).length > Object.keys(b).length) {
|
||||
for(var i in a) {
|
||||
if(b[i] === undefined) {
|
||||
b[i] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function analyze(nimbus, geth) {
|
||||
for(var x of premix.fields) {
|
||||
if(nimbus[x] === undefined) nimbus[x] = '';
|
||||
@ -105,6 +125,15 @@ function opCodeRenderer(txId, nimbus, geth) {
|
||||
if(nimbus[x].toString().toLowerCase() != geth[x].toString().toLowerCase()) return false;
|
||||
}
|
||||
|
||||
fillEmptyList(nimbus.memory, geth.memory);
|
||||
fillEmptyList(geth.memory, nimbus.memory);
|
||||
|
||||
fillEmptyList(nimbus.stack, geth.stack);
|
||||
fillEmptyList(geth.stack, nimbus.stack);
|
||||
|
||||
fillEmptyMap(nimbus.storage, geth.storage);
|
||||
fillEmptyMap(geth.storage, nimbus.storage);
|
||||
|
||||
let result = analyzeList(nimbus.memory, geth.memory);
|
||||
result = result && analyzeList(nimbus.stack, geth.stack);
|
||||
result = result && analyzeList(nimbus.storage, geth.storage);
|
||||
@ -133,6 +162,9 @@ function opCodeRenderer(txId, nimbus, geth) {
|
||||
fillEmptyOp(ncs, gcs);
|
||||
fillEmptyOp(gcs, ncs);
|
||||
|
||||
console.log(ncs[0]);
|
||||
console.log(gcs[0]);
|
||||
|
||||
for(var i in ncs) {
|
||||
var pc = ncs[i];
|
||||
if(!analyze(ncs[i], gcs[i])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user