Skip to content

Commit

Permalink
Remove legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-lashin committed Nov 13, 2020
1 parent f952791 commit 2c92949
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 1,642 deletions.
2 changes: 1 addition & 1 deletion cli/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
pb "github.com/MinterTeam/minter-go-node/cli/cli_pb"
"github.com/MinterTeam/minter-go-node/config"
"github.com/MinterTeam/minter-go-node/core/minter"
"github.com/MinterTeam/minter-go-node/core/state/candidates"
"github.com/MinterTeam/minter-go-node/core/types"
"github.com/MinterTeam/minter-go-node/legacy/candidates"
"github.com/MinterTeam/minter-go-node/version"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/empty"
Expand Down
2 changes: 1 addition & 1 deletion cmd/minter/cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func export(cmd *cobra.Command, args []string) error {
log.Panicf("Cannot new state at given height: %s", err)
}

exportTimeStart, newState := time.Now(), currentState.Export11To12(height)
exportTimeStart, newState := time.Now(), currentState.Export(height)
fmt.Printf("State has been exported. Took %s", time.Since(exportTimeStart))

if startHeight > 0 {
Expand Down
56 changes: 0 additions & 56 deletions core/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ import (
"github.com/MinterTeam/minter-go-node/core/state/waitlist"
"github.com/MinterTeam/minter-go-node/core/types"
"github.com/MinterTeam/minter-go-node/helpers"
legacyAccounts "github.com/MinterTeam/minter-go-node/legacy/accounts"
legacyApp "github.com/MinterTeam/minter-go-node/legacy/app"
legacyCandidates "github.com/MinterTeam/minter-go-node/legacy/candidates"
legacyCoins "github.com/MinterTeam/minter-go-node/legacy/coins"
legacyFrozenfunds "github.com/MinterTeam/minter-go-node/legacy/frozenfunds"
"github.com/MinterTeam/minter-go-node/tree"
db "github.com/tendermint/tm-db"
"gopkg.in/errgo.v2/fmt/errors"
Expand Down Expand Up @@ -95,57 +90,6 @@ func (cs *CheckState) Tree() tree.ReadOnlyTree {
return cs.state.Tree()
}

func (cs *CheckState) Export11To12(height uint64) types.AppState {
iavlTree := cs.state.tree

candidatesState, err := legacyCandidates.NewCandidates(nil, iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

validatorsState, err := validators.NewValidators(nil, iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

appState, err := legacyApp.NewApp(nil, iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

frozenFundsState, err := legacyFrozenfunds.NewFrozenFunds(nil, iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

accountsState, err := legacyAccounts.NewAccounts(nil, iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

coinsState, err := legacyCoins.NewCoins(nil, iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

checksState, err := checks.NewChecks(iavlTree)
if err != nil {
log.Panicf("Create new state at height %d failed: %s", height, err)
}

state := new(types.AppState)
appState.Export(state, height)
coinsMap := coinsState.Export(state)
validatorsState.Export(state)
candidatesMap := candidatesState.Export(state, coinsMap)
frozenFundsState.Export(state, height, coinsMap, candidatesMap)
accountsState.Export(state, coinsMap)
checksState.Export(state)
coinsState.Export(state)

return *state
}

type State struct {
App *app.App
Validators *validators.Validators
Expand Down
210 changes: 0 additions & 210 deletions legacy/accounts/accounts.go

This file was deleted.

Loading

0 comments on commit 2c92949

Please sign in to comment.