mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 03:06:16 +00:00
core: simplify dao creation with newDao()
This commit is contained in:
parent
32ac01130d
commit
c5ed3b788b
4 changed files with 35 additions and 31 deletions
|
@ -19,6 +19,10 @@ type dao struct {
|
|||
store *storage.MemCachedStore
|
||||
}
|
||||
|
||||
func newDao(backend storage.Store) *dao {
|
||||
return &dao{store: storage.NewMemCachedStore(backend)}
|
||||
}
|
||||
|
||||
// GetAndDecode performs get operation and decoding with serializable structures.
|
||||
func (dao *dao) GetAndDecode(entity io.Serializable, key []byte) error {
|
||||
entityBytes, err := dao.store.Get(key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue