diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-08-10 17:32:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-10 17:32:47 +0800 |
commit | f4690458abc24a0a3877f4facb0947c31d29e8cb (patch) | |
tree | 34ab0f3e13d4360b911832bd2fc943a7a2d2736c /core/types | |
parent | 09a0ab086cdafcb27b74e6346efdc8e96ca8145d (diff) | |
download | dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.tar dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.tar.gz dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.tar.bz2 dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.tar.lz dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.tar.xz dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.tar.zst dexon-consensus-f4690458abc24a0a3877f4facb0947c31d29e8cb.zip |
core: Modify Consensus interface (#45)
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/block.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/types/block.go b/core/types/block.go index 363de3a..9fd483e 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -78,16 +78,22 @@ func (b *Block) Block() *Block { return b } -// GetPayloads impelmemnts BlockConverter interface. -func (b *Block) GetPayloads() [][]byte { +// Payloads impelmemnts BlockConverter interface. +func (b *Block) Payloads() [][]byte { return [][]byte{} } +// SetBlock implments BlockConverter interface. +func (b *Block) SetBlock(block *Block) { + *b = *block +} + // BlockConverter interface define the interface for extracting block // information from an existing object. type BlockConverter interface { Block() *Block - GetPayloads() [][]byte + Payloads() [][]byte + SetBlock(block *Block) } func (b *Block) String() string { |