//-----------------------------------------------------------------------------
const (
- utxoPrefix byte = iota //UTXOPrefix is StandardUTXOKey prefix
- sutxoPrefix //SUTXOPrefix is ContractUTXOKey prefix
+ utxoPrefix byte = iota //UTXOPrefix is StandardUTXOKey prefix
contractPrefix
contractIndexPrefix
accountPrefix // AccountPrefix is account ID prefix
- accountAliasPrefix
accountIndexPrefix
+)
+
+const (
+ sutxoPrefix byte = iota //SUTXOPrefix is ContractUTXOKey prefix
+ accountAliasPrefix
txPrefix //TxPrefix is wallet database transactions prefix
txIndexPrefix //TxIndexPrefix is wallet database tx index prefix
unconfirmedTxPrefix //UnconfirmedTxPrefix is txpool unconfirmed transactions prefix
// leveldb key prefix
var (
colon byte = 0x3a
- store = []byte("store:")
accountStore = []byte("AS:")
- walletStore = []byte("WS:")
UTXOPrefix = append(accountStore, utxoPrefix, colon)
- SUTXOPrefix = append(walletStore, sutxoPrefix, colon)
ContractPrefix = append(accountStore, contractPrefix, colon)
ContractIndexPrefix = append(accountStore, contractIndexPrefix, colon)
AccountPrefix = append(accountStore, accountPrefix, colon) // AccountPrefix is account ID prefix
- AccountAliasPrefix = append(walletStore, accountAliasPrefix, colon)
AccountIndexPrefix = append(accountStore, accountIndexPrefix, colon)
- TxPrefix = append(walletStore, txPrefix, colon) //TxPrefix is wallet database transactions prefix
- TxIndexPrefix = append(walletStore, txIndexPrefix, colon) //TxIndexPrefix is wallet database tx index prefix
- UnconfirmedTxPrefix = append(walletStore, unconfirmedTxPrefix, colon) //UnconfirmedTxPrefix is txpool unconfirmed transactions prefix
- GlobalTxIndexPrefix = append(walletStore, globalTxIndexPrefix, colon) //GlobalTxIndexPrefix is wallet database global tx index prefix
- WalletKey = append(walletStore, walletKey)
- MiningAddressKey = append(walletStore, miningAddressKey)
- CoinbaseAbKey = append(walletStore, coinbaseAbKey)
- RecoveryKey = append(walletStore, recoveryKey)
+)
+
+var (
+ walletStore = []byte("WS:")
+ SUTXOPrefix = append(walletStore, sutxoPrefix, colon)
+ AccountAliasPrefix = append(walletStore, accountAliasPrefix, colon)
+ TxPrefix = append(walletStore, txPrefix, colon) //TxPrefix is wallet database transactions prefix
+ TxIndexPrefix = append(walletStore, txIndexPrefix, colon) //TxIndexPrefix is wallet database tx index prefix
+ UnconfirmedTxPrefix = append(walletStore, unconfirmedTxPrefix, colon) //UnconfirmedTxPrefix is txpool unconfirmed transactions prefix
+ GlobalTxIndexPrefix = append(walletStore, globalTxIndexPrefix, colon) //GlobalTxIndexPrefix is wallet database global tx index prefix
+ WalletKey = append(walletStore, walletKey)
+ MiningAddressKey = append(walletStore, miningAddressKey)
+ CoinbaseAbKey = append(walletStore, coinbaseAbKey)
+ RecoveryKey = append(walletStore, recoveryKey)
)
const (
},
{
dbPrograms: map[string]*account.CtrlProgram{
- "41533a023a2a37a64a4e15a772ab43bf3f5956d0d1f353946496788e7f40d0ff1796286a6f": &account.CtrlProgram{
+ "41533a013a2a37a64a4e15a772ab43bf3f5956d0d1f353946496788e7f40d0ff1796286a6f": &account.CtrlProgram{
AccountID: "testAccount",
Address: "testAddress",
KeyIndex: 53,
},
{
dbPrograms: map[string]*account.CtrlProgram{
- "41533a023a2a37a64a4e15a772ab43bf3f5956d0d1f353946496788e7f40d0ff1796286a6f": &account.CtrlProgram{
+ "41533a013a2a37a64a4e15a772ab43bf3f5956d0d1f353946496788e7f40d0ff1796286a6f": &account.CtrlProgram{
AccountID: "testAccount",
Address: "testAddress",
KeyIndex: 53,
Change: true,
},
- "41533a023adb4d86262c12ba70d50b3ca3ae102d5682436243bd1e8c79569603f75675036a": &account.CtrlProgram{
+ "41533a013adb4d86262c12ba70d50b3ca3ae102d5682436243bd1e8c79569603f75675036a": &account.CtrlProgram{
AccountID: "testAccount2",
Address: "testAddress2",
KeyIndex: 72,