mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2025-04-15 05:21:01 +02:00
minor(keystore): rename migration fn
This commit is contained in:
parent
24c81aaee2
commit
a25a4e1d93
2
go.mod
2
go.mod
@ -3,6 +3,7 @@ module github.com/grassrootseconomics/cic-custodial
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/arl/statsviz v0.5.1
|
||||
github.com/bsm/redislock v0.7.2
|
||||
github.com/ethereum/go-ethereum v1.10.25
|
||||
github.com/go-redis/redis/v8 v8.11.5
|
||||
@ -18,7 +19,6 @@ require (
|
||||
require (
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
|
||||
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
|
||||
github.com/arl/statsviz v0.5.1 // indirect
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/deckarep/golang-set v1.8.0 // indirect
|
||||
|
1
go.sum
1
go.sum
@ -322,7 +322,6 @@ github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8d
|
||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
func incrementalMigration(dbPool *pgxpool.Pool) error {
|
||||
func applyMigration(dbPool *pgxpool.Pool) error {
|
||||
_, err := dbPool.Exec(context.Background(), `
|
||||
CREATE TABLE IF NOT EXISTS keystore (
|
||||
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
eth_crypto "github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/grassrootseconomics/cic-custodial/internal/keystore"
|
||||
"github.com/grassrootseconomics/cic-custodial/internal/ethereum"
|
||||
"github.com/grassrootseconomics/cic-custodial/internal/keystore"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
@ -29,7 +29,7 @@ func NewPostgresKeytore(o Opts) (keystore.Keystore, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := incrementalMigration(dbPool); err != nil {
|
||||
if err := applyMigration(dbPool); err != nil {
|
||||
return nil, fmt.Errorf("keystore migration failed %v", err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user