mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Add Last db view in kvdb and statedb
Last db view is an opened pebble db which always contains a checkpoint from the last batch. Methods to access this last batch are thread safe so that views of the last checkpoint can be made anywhere and with a consistent view of the state.
This commit is contained in:
@@ -176,7 +176,7 @@ func TestZKInputsEmpty(t *testing.T) {
|
||||
assert.Equal(t, "0", ptOut.ZKInputs.Metadata.NewExitRootRaw.BigInt().String())
|
||||
|
||||
// check that there are no accounts
|
||||
accs, err := sdb.GetAccounts()
|
||||
accs, err := sdb.TestGetAccounts()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 0, len(accs))
|
||||
|
||||
@@ -208,7 +208,7 @@ func TestZKInputsEmpty(t *testing.T) {
|
||||
rootNonZero := sdb.MT.Root()
|
||||
|
||||
// check that there is 1 account
|
||||
accs, err = sdb.GetAccounts()
|
||||
accs, err = sdb.TestGetAccounts()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 1, len(accs))
|
||||
|
||||
@@ -234,7 +234,7 @@ func TestZKInputsEmpty(t *testing.T) {
|
||||
assert.Equal(t, "0", ptOut.ZKInputs.Metadata.NewExitRootRaw.BigInt().String())
|
||||
|
||||
// check that there is still 1 account
|
||||
accs, err = sdb.GetAccounts()
|
||||
accs, err = sdb.TestGetAccounts()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 1, len(accs))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user