OSDN Git Service

update AccountStorer
authorChengcheng Zhang <943420582@qq.com>
Tue, 2 Jul 2019 06:19:22 +0000 (14:19 +0800)
committerChengcheng Zhang <943420582@qq.com>
Tue, 2 Jul 2019 06:19:22 +0000 (14:19 +0800)
account/accounts.go
account/store.go
account/utxo_keeper.go
database/account_store.go

index 31a430c..203c9a4 100644 (file)
@@ -66,7 +66,7 @@ type CtrlProgram struct {
 
 // Manager stores accounts and their associated control programs.
 type Manager struct {
-       store      AccountStorer
+       store      AccountStore
        chain      *protocol.Chain
        utxoKeeper *utxoKeeper
 
@@ -82,7 +82,7 @@ type Manager struct {
 }
 
 // NewManager creates a new account manager
-func NewManager(store AccountStorer, chain *protocol.Chain) *Manager {
+func NewManager(store AccountStore, chain *protocol.Chain) *Manager {
        return &Manager{
                store:       store,
                chain:       chain,
index 93e7bec..9ce4565 100644 (file)
@@ -5,8 +5,8 @@ import (
        "github.com/vapor/protocol/bc"
 )
 
-// AccountStorer interface contains account storage functions.
-type AccountStorer interface {
+// AccountStore interface contains account storage functions.
+type AccountStore interface {
        InitBatch() error
        CommitBatch() error
        DeleteAccount(*Account) error
index db2abf1..e919eff 100644 (file)
@@ -52,7 +52,7 @@ type utxoKeeper struct {
        // `sync/atomic` expects the first word in an allocated struct to be 64-bit
        // aligned on both ARM and x86-32. See https://goo.gl/zW7dgq for more details.
        nextIndex     uint64
-       store         AccountStorer
+       store         AccountStore
        mtx           sync.RWMutex
        currentHeight func() uint64
 
@@ -61,7 +61,7 @@ type utxoKeeper struct {
        reservations map[uint64]*reservation
 }
 
-func newUtxoKeeper(f func() uint64, store AccountStorer) *utxoKeeper {
+func newUtxoKeeper(f func() uint64, store AccountStore) *utxoKeeper {
        uk := &utxoKeeper{
                store:         store,
                currentHeight: f,
index 91a00a9..b0e6295 100644 (file)
@@ -16,7 +16,7 @@ import (
        "github.com/vapor/protocol/bc"
 )
 
-// AccountStore satisfies AccountStorer interface.
+// AccountStore satisfies AccountStore interface.
 type AccountStore struct {
        accountDB dbm.DB
        batch     dbm.Batch