mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 03:22:18 +00:00
b30ccd2ddf
This reverts commit 49a98ad4b6
.
24 lines
643 B
Go
24 lines
643 B
Go
package prune
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ledgerwatch/erigon-lib/kv/memdb"
|
|
"github.com/ledgerwatch/erigon/common/math"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSetStorageModeIfNotExist(t *testing.T) {
|
|
_, tx := memdb.NewTestTx(t)
|
|
prune, err := Get(tx)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, Mode{true, math.MaxUint64, math.MaxUint64, math.MaxUint64, math.MaxUint64, Experiments{TEVM: false}}, prune)
|
|
|
|
err = SetIfNotExist(tx, Mode{true, 1, 2, 3, 4, Experiments{TEVM: false}})
|
|
assert.NoError(t, err)
|
|
|
|
prune, err = Get(tx)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, Mode{true, 1, 2, 3, 4, Experiments{TEVM: false}}, prune)
|
|
}
|