Class MemBlockStorage
Define the memory storage for blocks
Implemented using only memory without file IO.
Constructors
Name | Description |
---|---|
this
(blocks)
|
Ctor |
Methods
Name | Description |
---|---|
load
(genesis)
|
No-op: MemBlockStorage does no I/O |
readBlock
(hash)
|
Implements IBlockStorage
|
readBlock
(height)
|
Implements IBlockStorage
|
readLastBlock
()
|
Implement IBlockStorage
|
saveBlock
(block)
|
Save block to array. |
updateBlockSig
(height, hash, sig, validators)
|
Implements IBlockStorage
|
Example
test memory storage
MemBlockStorage memory_storage = new MemBlockStorage();
testStorage(memory_storage);