Fix validator export failing when validator.db is in nested directory (#15351)

* files changed

* added changelog file

* added tests and formatting changes

* fixed bugs

* fixed formatting
This commit is contained in:
Rose Jethani
2025-05-30 20:23:19 +05:30
committed by GitHub
parent 711984d942
commit 3300866572
12 changed files with 162 additions and 115 deletions

View File

@@ -1110,7 +1110,7 @@ func TestServer_SetGasLimit(t *testing.T) {
m := &testutil.FakeValidator{}
err := m.SetProposerSettings(ctx, tt.proposerSettings)
require.NoError(t, err)
validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
validatorDB := dbtest.SetupDB(t, t.TempDir(), [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
vs, err := client.NewValidatorService(ctx, &client.Config{
Validator: m,
DB: validatorDB,
@@ -1299,7 +1299,7 @@ func TestServer_DeleteGasLimit(t *testing.T) {
m := &testutil.FakeValidator{}
err := m.SetProposerSettings(ctx, tt.proposerSettings)
require.NoError(t, err)
validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
validatorDB := dbtest.SetupDB(t, t.TempDir(), [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
vs, err := client.NewValidatorService(ctx, &client.Config{
Validator: m,
DB: validatorDB,
@@ -1777,7 +1777,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) {
m := &testutil.FakeValidator{}
err := m.SetProposerSettings(ctx, tt.proposerSettings)
require.NoError(t, err)
validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
validatorDB := dbtest.SetupDB(t, t.TempDir(), [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
// save a default here
vs, err := client.NewValidatorService(ctx, &client.Config{
@@ -1889,7 +1889,7 @@ func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) {
m := &testutil.FakeValidator{}
err := m.SetProposerSettings(ctx, tt.proposerSettings)
require.NoError(t, err)
validatorDB := dbtest.SetupDB(t, [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
validatorDB := dbtest.SetupDB(t, t.TempDir(), [][fieldparams.BLSPubkeyLength]byte{}, isSlashingProtectionMinimal)
vs, err := client.NewValidatorService(ctx, &client.Config{
Validator: m,
DB: validatorDB,