Skip to content

Commit f929591

Browse files
committed
Rename.
1 parent 0f07604 commit f929591

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

keystore/pgstore/pgstore.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ import (
77
"github.com/smartcontractkit/chainlink-common/pkg/sqlutil"
88
)
99

10-
var _ keystore.Storage = &PgStorage{}
10+
var _ keystore.Storage = &Storage{}
1111

12-
// PgStorage implements Storage using a Postgres database
13-
type PgStorage struct {
12+
// Storage implements Storage using a Postgres database
13+
type Storage struct {
1414
ds sqlutil.DataSource
1515
name string
1616
}
1717

18-
func NewPgStorage(ds sqlutil.DataSource, name string) *PgStorage {
19-
return &PgStorage{
18+
func NewStorage(ds sqlutil.DataSource, name string) *Storage {
19+
return &Storage{
2020
ds: ds,
2121
name: name,
2222
}
2323
}
2424

25-
func (p *PgStorage) GetEncryptedKeystore(ctx context.Context) (res []byte, err error) {
25+
func (p *Storage) GetEncryptedKeystore(ctx context.Context) (res []byte, err error) {
2626
err = p.ds.GetContext(ctx, &res, `SELECT encrypted_data FROM encrypted_keystore WHERE name = $1`, p.name)
2727
return
2828
}
2929

30-
func (p *PgStorage) PutEncryptedKeystore(ctx context.Context, encryptedKeystore []byte) (err error) {
30+
func (p *Storage) PutEncryptedKeystore(ctx context.Context, encryptedKeystore []byte) (err error) {
3131
_, err = p.ds.ExecContext(ctx,
3232
`INSERT INTO encrypted_keystore (name, encrypted_data, updated_at) VALUES ($1, $2, NOW())
3333
ON CONFLICT(name)

keystore/pgstore/pgstore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestPgStorage(t *testing.T) {
1616
db := sqltest.NewDB(t, sqltest.TestURL(t))
1717
t.Cleanup(func() { require.NoError(t, db.Close()) })
1818

19-
storage := pgstore.NewPgStorage(db, "test")
19+
storage := pgstore.NewStorage(db, "test")
2020
_, err := storage.GetEncryptedKeystore(t.Context())
2121
require.ErrorIs(t, err, sql.ErrNoRows)
2222
require.NoError(t, storage.PutEncryptedKeystore(t.Context(), []byte("test")))

0 commit comments

Comments
 (0)