Skip to content

Commit

Permalink
keeper removes unused migration code
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricfung committed Aug 13, 2024
1 parent ec43f05 commit f38c8a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 36 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/MixinNetwork/bot-api-go-client/v3 v3.7.5
github.com/MixinNetwork/mixin v0.18.12
github.com/MixinNetwork/multi-party-sig v0.4.1
github.com/MixinNetwork/trusted-group v0.9.2-0.20240813084343-bc17cb81d5d9
github.com/MixinNetwork/trusted-group v0.9.2
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ github.com/MixinNetwork/mixin v0.18.12 h1:hMHaZUe9k65C7goDrKAlOHlMJHDvB1wTf9QxQE
github.com/MixinNetwork/mixin v0.18.12/go.mod h1:46byqFCaEelxJKspfEcJ5gEYTdE4FabPMV57DfiYDU8=
github.com/MixinNetwork/multi-party-sig v0.4.1 h1:rQdIVSDQQOUMub8ERDV1gbFHxGSD5/+Ve7gj5hGHiPs=
github.com/MixinNetwork/multi-party-sig v0.4.1/go.mod h1:mnZyPutnRV2+E6z3v5TpTb7q4HnS7IplS0yy4dPjVGA=
github.com/MixinNetwork/trusted-group v0.9.2-0.20240813084343-bc17cb81d5d9 h1:tN9OuajlT0UJ7hnz/gt2EWwTccCUY/9INQ9GqLuDzTc=
github.com/MixinNetwork/trusted-group v0.9.2-0.20240813084343-bc17cb81d5d9/go.mod h1:IS9wRax7PWhhx7b4pPjydyheiPLkX/sVceNny1Eqa1I=
github.com/MixinNetwork/trusted-group v0.9.2 h1:OfMoEfhjP5xzmMLUz7QZDU1u+YcXQOScyAhCLffEdeo=
github.com/MixinNetwork/trusted-group v0.9.2/go.mod h1:IS9wRax7PWhhx7b4pPjydyheiPLkX/sVceNny1Eqa1I=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
Expand Down
33 changes: 0 additions & 33 deletions keeper/store/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,39 +136,6 @@ func (s *SQLite3Store) MigrateDepositCreated(ctx context.Context) error {
return tx.Commit()
}

// FIXME remove this
func (s *SQLite3Store) FixRequest(ctx context.Context) error {
s.mutex.Lock()
defer s.mutex.Unlock()

tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
return err
}
defer tx.Rollback()

key, val := "FIX:VERSION:bd9f968e2bfae8a376a6eab9d18df047e82bdb85:2", ""
row := tx.QueryRowContext(ctx, "SELECT value FROM properties WHERE key=?", key)
err = row.Scan(&val)
if err == nil || err != sql.ErrNoRows {
return err
}

query := "DELETE FROM requests WHERE request_id='1ccf5405-2dd4-3f37-974a-faf0e1fd8356' AND state=4"
_, err = tx.ExecContext(ctx, query)
if err != nil {
return err
}

now := time.Now().UTC()
_, err = tx.ExecContext(ctx, "INSERT INTO properties (key, value, created_at) VALUES (?, ?, ?)", key, query, now)
if err != nil {
return err
}

return tx.Commit()
}

// FIXME remove this
func (s *SQLite3Store) Migrate(ctx context.Context, ss, es []*MigrateAsset) error {
s.mutex.Lock()
Expand Down

0 comments on commit f38c8a2

Please sign in to comment.