From 7dc9f0bde28b7ff0694c179a580991867367714c Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 30 Mar 2021 14:51:45 +0300 Subject: [PATCH] mpt: swap Leaf and Node types --- pkg/core/mpt/node.go | 4 ++-- pkg/core/mpt/node_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/core/mpt/node.go b/pkg/core/mpt/node.go index 04b085948..befc216fd 100644 --- a/pkg/core/mpt/node.go +++ b/pkg/core/mpt/node.go @@ -16,8 +16,8 @@ type NodeType byte const ( BranchT NodeType = 0x00 ExtensionT NodeType = 0x01 - HashT NodeType = 0x02 - LeafT NodeType = 0x03 + LeafT NodeType = 0x02 + HashT NodeType = 0x03 ) // NodeObject represents Node together with it's type. diff --git a/pkg/core/mpt/node_test.go b/pkg/core/mpt/node_test.go index 393585493..f97644573 100644 --- a/pkg/core/mpt/node_test.go +++ b/pkg/core/mpt/node_test.go @@ -151,6 +151,6 @@ func TestRootHash(t *testing.T) { b.Children[9] = l2 r1 := NewExtensionNode([]byte{0x0A, 0x0C, 0x00, 0x01}, v1) - require.Equal(t, "dea3ab46e9461e885ed7091c1e533e0a8030b248d39cbc638962394eaca0fbb3", r1.Hash().StringLE()) - require.Equal(t, "93e8e1ffe2f83dd92fca67330e273bcc811bf64b8f8d9d1b25d5e7366b47d60d", r.Hash().StringLE()) + require.Equal(t, "30769d6b3ceba98430fc91c03d2a210a3bfe9521248179586ad9f613a4b6fba9", r1.Hash().StringLE()) + require.Equal(t, "593e356475fd0130eb20cc1f6585bb02ea7b7bd0935748192152a935da9b8d83", r.Hash().StringLE()) }