Skip to content

Commit 1924c7a

Browse files
committed
backend/config: move migrateActiveTokens to accounts.go
The unit test for it is already in accounts_test.go.
1 parent 6019fe4 commit 1924c7a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

backend/config/accounts.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,19 @@ func (cfg AccountsConfig) Lookup(code accountsTypes.Code) *Account {
8484
}
8585
return nil
8686
}
87+
88+
// migrateActiveTokens removes tokens from AccountsConfig.
89+
func migrateActiveTokens(accountsConf *AccountsConfig) error {
90+
for _, account := range accountsConf.Accounts {
91+
if account.CoinCode != coin.CodeETH {
92+
continue
93+
}
94+
95+
err := account.SetTokenActive("eth-erc20-sai0x89d", false)
96+
if err != nil {
97+
return err
98+
}
99+
100+
}
101+
return nil
102+
}

backend/config/config.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,3 @@ func migrateUserLanguage(appconf *AppConfig) {
435435
delete(frontconf, "userLanguage")
436436
}
437437
}
438-
439-
// migrateActiveTokens removes tokens from AccountsConfig.
440-
func migrateActiveTokens(accountsConf *AccountsConfig) error {
441-
for _, account := range accountsConf.Accounts {
442-
if account.CoinCode != coin.CodeETH {
443-
continue
444-
}
445-
446-
err := account.SetTokenActive("eth-erc20-sai0x89d", false)
447-
if err != nil {
448-
return err
449-
}
450-
451-
}
452-
return nil
453-
}

0 commit comments

Comments
 (0)