-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
UnstoppableWallet/UnstoppableWallet/Models/Deprecated/EnabledWallet_v_0_34.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import GRDB | ||
import MarketKit | ||
|
||
class EnabledWallet_v_0_34: Record { | ||
let tokenQueryId: String | ||
let coinSettingsId: String | ||
let accountId: String | ||
|
||
let coinName: String? | ||
let coinCode: String? | ||
let tokenDecimals: Int? | ||
|
||
init(tokenQueryId: String, coinSettingsId: String, accountId: String, coinName: String? = nil, coinCode: String? = nil, tokenDecimals: Int? = nil) { | ||
self.tokenQueryId = tokenQueryId | ||
self.coinSettingsId = coinSettingsId | ||
self.accountId = accountId | ||
self.coinName = coinName | ||
self.coinCode = coinCode | ||
self.tokenDecimals = tokenDecimals | ||
super.init() | ||
} | ||
override class var databaseTableName: String { | ||
"enabled_wallets" | ||
} | ||
|
||
enum Columns: String, ColumnExpression { | ||
case tokenQueryId, coinSettingsId, accountId, coinName, coinCode, tokenDecimals | ||
} | ||
|
||
required init(row: Row) { | ||
tokenQueryId = row[Columns.tokenQueryId] | ||
coinSettingsId = row[Columns.coinSettingsId] | ||
accountId = row[Columns.accountId] | ||
coinName = row[Columns.coinName] | ||
coinCode = row[Columns.coinCode] | ||
tokenDecimals = row[Columns.tokenDecimals] | ||
super.init(row: row) | ||
} | ||
|
||
override func encode(to container: inout PersistenceContainer) { | ||
container[Columns.tokenQueryId] = tokenQueryId | ||
container[Columns.coinSettingsId] = coinSettingsId | ||
container[Columns.accountId] = accountId | ||
container[Columns.coinName] = coinName | ||
container[Columns.coinCode] = coinCode | ||
container[Columns.tokenDecimals] = tokenDecimals | ||
} | ||
} |