fix weight

This commit is contained in:
Potuz
2026-02-14 14:50:25 +01:00
parent dfe11caa30
commit 595da55dfb
2 changed files with 3 additions and 2 deletions

View File

@@ -319,7 +319,7 @@ func (f *ForkChoice) updateNewFullNodeWeight(fn *PayloadNode) {
fn.balance += f.balances[index]
}
}
fn.balance = fn.weight
fn.weight = fn.balance
}
func (s *Store) resolveVoteNode(r [32]byte, slot primitives.Slot, payloadStatus bool) (*PayloadNode, bool) {

View File

@@ -141,7 +141,8 @@ func (bb *Builder) Check(t testing.TB, c *Check) {
if c.Head != nil {
r, err := bb.service.HeadRoot(ctx)
require.NoError(t, err)
require.Equal(t, true, bytes.Equal(common.FromHex(c.Head.Root), r))
wantedRoot := common.FromHex(c.Head.Root)
require.Equal(t, true, bytes.Equal(wantedRoot, r), fmt.Sprintf("Roots differ. wanted %#x, got %#x", wantedRoot, r))
require.Equal(t, primitives.Slot(c.Head.Slot), bb.service.HeadSlot())
}
if c.JustifiedCheckPoint != nil {