neoneo-go/pkg/core/memory_store.go

25 lines
503 B
Go
Raw Normal View History

package core
// MemoryStore is an in memory implementation of a BlockChainStorer
// that should only be used for testing.
type MemoryStore struct {
}
// NewMemoryStore returns a pointer to a MemoryStore object.
func NewMemoryStore() *MemoryStore {
return &MemoryStore{}
}
func (m *MemoryStore) write(key, value []byte) error {
return nil
}
func (m *MemoryStore) writeBatch(batch Batch) error {
for k, v := range batch {
if err := m.write(*k, v); err != nil {
return err
}
}
return nil
}