@@ -1001,7 +1001,9 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
1001
1001
block2 = blocks [1 ]
1002
1002
block3 = blocks [2 ]
1003
1003
params := statediff.Params {
1004
- WatchedAddresses : []common.Address {test_helpers .Account1Addr , test_helpers .ContractAddr },
1004
+ IntermediateStateNodes : true ,
1005
+ IntermediateStorageNodes : true ,
1006
+ WatchedAddresses : []common.Address {test_helpers .Account1Addr , test_helpers .ContractAddr },
1005
1007
}
1006
1008
params .ComputeWatchedAddressesLeafPaths ()
1007
1009
builder = statediff .NewBuilder (chain .StateCache ())
@@ -1053,6 +1055,12 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
1053
1055
BlockNumber : block1 .Number (),
1054
1056
BlockHash : block1 .Hash (),
1055
1057
Nodes : []types2.StateNode {
1058
+ {
1059
+ Path : []byte {},
1060
+ NodeType : types2 .Branch ,
1061
+ NodeValue : block1BranchRootNode ,
1062
+ StorageNodes : emptyStorage ,
1063
+ },
1056
1064
{
1057
1065
Path : []byte {'\x0e' },
1058
1066
NodeType : types2 .Leaf ,
@@ -1077,12 +1085,23 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
1077
1085
BlockNumber : block2 .Number (),
1078
1086
BlockHash : block2 .Hash (),
1079
1087
Nodes : []types2.StateNode {
1088
+ {
1089
+ Path : []byte {},
1090
+ NodeType : types2 .Branch ,
1091
+ NodeValue : block2BranchRootNode ,
1092
+ StorageNodes : emptyStorage ,
1093
+ },
1080
1094
{
1081
1095
Path : []byte {'\x06' },
1082
1096
NodeType : types2 .Leaf ,
1083
1097
LeafKey : contractLeafKey ,
1084
1098
NodeValue : contractAccountAtBlock2LeafNode ,
1085
1099
StorageNodes : []types2.StorageNode {
1100
+ {
1101
+ Path : []byte {},
1102
+ NodeType : types2 .Branch ,
1103
+ NodeValue : block2StorageBranchRootNode ,
1104
+ },
1086
1105
{
1087
1106
Path : []byte {'\x02' },
1088
1107
NodeType : types2 .Leaf ,
@@ -1127,12 +1146,23 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
1127
1146
BlockNumber : block3 .Number (),
1128
1147
BlockHash : block3 .Hash (),
1129
1148
Nodes : []types2.StateNode {
1149
+ {
1150
+ Path : []byte {},
1151
+ NodeType : types2 .Branch ,
1152
+ NodeValue : block3BranchRootNode ,
1153
+ StorageNodes : emptyStorage ,
1154
+ },
1130
1155
{
1131
1156
Path : []byte {'\x06' },
1132
1157
NodeType : types2 .Leaf ,
1133
1158
LeafKey : contractLeafKey ,
1134
1159
NodeValue : contractAccountAtBlock3LeafNode ,
1135
1160
StorageNodes : []types2.StorageNode {
1161
+ {
1162
+ Path : []byte {},
1163
+ NodeType : types2 .Branch ,
1164
+ NodeValue : block3StorageBranchRootNode ,
1165
+ },
1136
1166
{
1137
1167
Path : []byte {'\x0c' },
1138
1168
NodeType : types2 .Leaf ,
@@ -1606,7 +1636,9 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
1606
1636
block5 = blocks [4 ]
1607
1637
block6 = blocks [5 ]
1608
1638
params := statediff.Params {
1609
- WatchedAddresses : []common.Address {test_helpers .Account1Addr , test_helpers .Account2Addr },
1639
+ IntermediateStateNodes : true ,
1640
+ IntermediateStorageNodes : true ,
1641
+ WatchedAddresses : []common.Address {test_helpers .Account1Addr , test_helpers .Account2Addr },
1610
1642
}
1611
1643
params .ComputeWatchedAddressesLeafPaths ()
1612
1644
builder = statediff .NewBuilder (chain .StateCache ())
@@ -1628,6 +1660,12 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
1628
1660
BlockNumber : block4 .Number (),
1629
1661
BlockHash : block4 .Hash (),
1630
1662
Nodes : []types2.StateNode {
1663
+ {
1664
+ Path : []byte {},
1665
+ NodeType : types2 .Branch ,
1666
+ NodeValue : block4BranchRootNode ,
1667
+ StorageNodes : emptyStorage ,
1668
+ },
1631
1669
{
1632
1670
Path : []byte {'\x0c' },
1633
1671
NodeType : types2 .Leaf ,
@@ -1650,6 +1688,12 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
1650
1688
BlockNumber : block5 .Number (),
1651
1689
BlockHash : block5 .Hash (),
1652
1690
Nodes : []types2.StateNode {
1691
+ {
1692
+ Path : []byte {},
1693
+ NodeType : types2 .Branch ,
1694
+ NodeValue : block5BranchRootNode ,
1695
+ StorageNodes : emptyStorage ,
1696
+ },
1653
1697
{
1654
1698
Path : []byte {'\x0e' },
1655
1699
NodeType : types2 .Leaf ,
@@ -1672,6 +1716,12 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
1672
1716
BlockNumber : block6 .Number (),
1673
1717
BlockHash : block6 .Hash (),
1674
1718
Nodes : []types2.StateNode {
1719
+ {
1720
+ Path : []byte {},
1721
+ NodeType : types2 .Branch ,
1722
+ NodeValue : block6BranchRootNode ,
1723
+ StorageNodes : emptyStorage ,
1724
+ },
1675
1725
{
1676
1726
Path : []byte {'\x0c' },
1677
1727
NodeType : types2 .Leaf ,
@@ -1724,7 +1774,9 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
1724
1774
block5 = blocks [4 ]
1725
1775
block6 = blocks [5 ]
1726
1776
params := statediff.Params {
1727
- WatchedAddresses : []common.Address {test_helpers .Account1Addr , test_helpers .ContractAddr },
1777
+ IntermediateStateNodes : true ,
1778
+ IntermediateStorageNodes : true ,
1779
+ WatchedAddresses : []common.Address {test_helpers .Account1Addr , test_helpers .ContractAddr },
1728
1780
}
1729
1781
params .ComputeWatchedAddressesLeafPaths ()
1730
1782
builder = statediff .NewBuilder (chain .StateCache ())
@@ -1746,12 +1798,23 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
1746
1798
BlockNumber : block4 .Number (),
1747
1799
BlockHash : block4 .Hash (),
1748
1800
Nodes : []types2.StateNode {
1801
+ {
1802
+ Path : []byte {},
1803
+ NodeType : types2 .Branch ,
1804
+ NodeValue : block4BranchRootNode ,
1805
+ StorageNodes : emptyStorage ,
1806
+ },
1749
1807
{
1750
1808
Path : []byte {'\x06' },
1751
1809
NodeType : types2 .Leaf ,
1752
1810
LeafKey : contractLeafKey ,
1753
1811
NodeValue : contractAccountAtBlock4LeafNode ,
1754
1812
StorageNodes : []types2.StorageNode {
1813
+ {
1814
+ Path : []byte {},
1815
+ NodeType : types2 .Branch ,
1816
+ NodeValue : block4StorageBranchRootNode ,
1817
+ },
1755
1818
{
1756
1819
Path : []byte {'\x04' },
1757
1820
NodeType : types2 .Leaf ,
@@ -1787,12 +1850,23 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
1787
1850
BlockNumber : block5 .Number (),
1788
1851
BlockHash : block5 .Hash (),
1789
1852
Nodes : []types2.StateNode {
1853
+ {
1854
+ Path : []byte {},
1855
+ NodeType : types2 .Branch ,
1856
+ NodeValue : block5BranchRootNode ,
1857
+ StorageNodes : emptyStorage ,
1858
+ },
1790
1859
{
1791
1860
Path : []byte {'\x06' },
1792
1861
NodeType : types2 .Leaf ,
1793
1862
LeafKey : contractLeafKey ,
1794
1863
NodeValue : contractAccountAtBlock5LeafNode ,
1795
1864
StorageNodes : []types2.StorageNode {
1865
+ {
1866
+ Path : []byte {},
1867
+ NodeType : types2 .Branch ,
1868
+ NodeValue : block5StorageBranchRootNode ,
1869
+ },
1796
1870
{
1797
1871
Path : []byte {'\x0c' },
1798
1872
NodeType : types2 .Leaf ,
@@ -1829,12 +1903,23 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
1829
1903
BlockNumber : block6 .Number (),
1830
1904
BlockHash : block6 .Hash (),
1831
1905
Nodes : []types2.StateNode {
1906
+ {
1907
+ Path : []byte {},
1908
+ NodeType : types2 .Branch ,
1909
+ NodeValue : block6BranchRootNode ,
1910
+ StorageNodes : emptyStorage ,
1911
+ },
1832
1912
{
1833
1913
Path : []byte {'\x06' },
1834
1914
NodeType : types2 .Removed ,
1835
1915
LeafKey : contractLeafKey ,
1836
1916
NodeValue : []byte {},
1837
1917
StorageNodes : []types2.StorageNode {
1918
+ {
1919
+ Path : []byte {},
1920
+ NodeType : types2 .Removed ,
1921
+ NodeValue : []byte {},
1922
+ },
1838
1923
{
1839
1924
Path : []byte {'\x02' },
1840
1925
NodeType : types2 .Removed ,
0 commit comments