m.store.InitBatch()
- m.store.DeleteAccountByAccountAlias(oldAlias)
+ m.store.DeleteAccountByAlias(oldAlias)
if err := m.store.SetAccount(account); err != nil {
return err
}
m.cacheMu.Unlock()
m.store.InitBatch()
- m.store.DeleteAccountByAccountAlias(account.Alias)
- m.store.DeleteAccountByAccountID(account.ID)
+ m.store.DeleteAccountByAlias(account.Alias)
+ m.store.DeleteAccountByID(account.ID)
m.store.CommitBatch()
return nil
return cachedAccount.(*Account), nil
}
- account, err := m.store.GetAccountByAccountID(id)
+ account, err := m.store.GetAccountByID(id)
if err != nil {
return nil, err
}
// GetAccountByProgram return Account by given CtrlProgram
func (m *Manager) GetAccountByProgram(program *CtrlProgram) (*Account, error) {
- account, err := m.store.GetAccountByAccountID(program.AccountID)
+ account, err := m.store.GetAccountByID(program.AccountID)
if err != nil {
return nil, err
}
// GetAliasByID return the account alias by given ID
func (m *Manager) GetAliasByID(id string) string {
- account, err := m.store.GetAccountByAccountID(id)
+ account, err := m.store.GetAccountByID(id)
if err != nil {
log.Warn("GetAliasByID fail to find account")
return ""
m.store.InitBatch()
for _, slice := range image.Slice {
- existed, err := m.store.GetAccountByAccountID(slice.Account.ID)
+ existed, err := m.store.GetAccountByID(slice.Account.ID)
if err != nil || existed != nil {
log.WithFields(log.Fields{
"module": logModule,
SetAccount(*Account) error
SetAccountIndex(*Account) error
GetAccountIDByAlias(string) string
- GetAccountByAccountID(string) (*Account, error)
+ GetAccountByID(string) (*Account, error)
GetAccountIndex([]chainkd.XPub) uint64
- DeleteAccountByAccountAlias(string)
- DeleteAccountByAccountID(string)
+ DeleteAccountByAlias(string)
+ DeleteAccountByID(string)
DeleteControlProgram(common.Hash)
DeleteBip44ContractIndex(string)
DeleteContractIndex(string)
return string(accountID)
}
-// GetAccountByAccountID get account by accountID
-func (store *AccountStore) GetAccountByAccountID(accountID string) (*acc.Account, error) {
+// GetAccountByID get account by accountID
+func (store *AccountStore) GetAccountByID(accountID string) (*acc.Account, error) {
account := new(acc.Account)
rawAccount := store.accountDB.Get(AccountIDKey(accountID))
if rawAccount == nil {
return currentIndex
}
-// DeleteAccountByAccountAlias delete account by account alias
-func (store *AccountStore) DeleteAccountByAccountAlias(accountAlias string) {
+// DeleteAccountByAlias delete account by account alias
+func (store *AccountStore) DeleteAccountByAlias(accountAlias string) {
if store.batch == nil {
store.accountDB.Delete(accountAliasKey(accountAlias))
} else {
}
}
-// DeleteAccountByAccountID delete account by accountID
-func (store *AccountStore) DeleteAccountByAccountID(accountID string) {
+// DeleteAccountByID delete account by accountID
+func (store *AccountStore) DeleteAccountByID(accountID string) {
if store.batch == nil {
store.accountDB.Delete(AccountIDKey(accountID))
} else {
return accountCP, nil
}
-// GetAccountByAccountID get account value by account ID
-func (store *WalletStore) GetAccountByAccountID(accountID string) (*acc.Account, error) {
+// GetAccountByID get account value by account ID
+func (store *WalletStore) GetAccountByID(accountID string) (*acc.Account, error) {
rawAccount := store.walletDB.Get(AccountIDKey(accountID))
if rawAccount == nil {
return nil, fmt.Errorf("failed get account, accountID: %s ", accountID)
return nil, fmt.Errorf("failed get account control program:%x ", hash)
}
- account, err := store.GetAccountByAccountID(accountCP.AccountID)
+ account, err := store.GetAccountByID(accountCP.AccountID)
if err != nil {
return nil, err
}
GetAssetDefinition(*bc.AssetID) (*asset.Asset, error)
SetAssetDefinition(*bc.AssetID, []byte)
GetControlProgram(common.Hash) (*acc.CtrlProgram, error)
- GetAccountByAccountID(string) (*acc.Account, error)
+ GetAccountByID(string) (*acc.Account, error)
DeleteTransactions(uint64)
SetTransaction(uint64, *query.AnnotatedTx) error
DeleteUnconfirmedTransaction(string)