mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-06 11:02:18 +00:00
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)
|
|
}
|