diff options
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/block.go | 8 | ||||
-rw-r--r-- | core/types/witness.go (renamed from core/types/notary.go) | 32 |
2 files changed, 20 insertions, 20 deletions
diff --git a/core/types/block.go b/core/types/block.go index e00465c..61cb458 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -15,7 +15,7 @@ // along with the dexon-consensus-core library. If not, see // <http://www.gnu.org/licenses/>. -// TODO(jimmy-dexon): remove comments of NotaryAck before open source. +// TODO(jimmy-dexon): remove comments of WitnessAck before open source. package types @@ -65,7 +65,7 @@ type Block struct { CRSSignature crypto.Signature `json:"crs_signature"` - Notary Notary `json:"notary"` + Witness Witness `json:"witness"` } func (b *Block) String() string { @@ -84,8 +84,8 @@ func (b *Block) Clone() (bcopy *Block) { bcopy.Position.Height = b.Position.Height bcopy.Signature = b.Signature.Clone() bcopy.CRSSignature = b.CRSSignature.Clone() - bcopy.Notary.Timestamp = b.Notary.Timestamp - bcopy.Notary.Height = b.Notary.Height + bcopy.Witness.Timestamp = b.Witness.Timestamp + bcopy.Witness.Height = b.Witness.Height bcopy.Timestamp = b.Timestamp bcopy.Acks = make(common.SortedHashes, len(b.Acks)) copy(bcopy.Acks, b.Acks) diff --git a/core/types/notary.go b/core/types/witness.go index 216466c..1e432f6 100644 --- a/core/types/notary.go +++ b/core/types/witness.go @@ -15,7 +15,7 @@ // along with the dexon-consensus-core library. If not, see // <http://www.gnu.org/licenses/>. -// TODO(jimmy-dexon): remove comments of NotaryAck before open source. +// TODO(jimmy-dexon): remove comments of WitnessAck before open source. package types @@ -26,27 +26,27 @@ import ( "github.com/dexon-foundation/dexon-consensus-core/crypto" ) -// NotaryAck represents the acking to the compaction chain. -type NotaryAck struct { - ProposerID ValidatorID `json:"proposer_id"` - NotaryBlockHash common.Hash `json:"notary_block_hash"` - Hash common.Hash `json:"hash"` - // NotarySignature is the signature of the hash value of BlockNotary. +// WitnessAck represents the acking to the compaction chain. +type WitnessAck struct { + ProposerID ValidatorID `json:"proposer_id"` + WitnessBlockHash common.Hash `json:"witness_block_hash"` + Hash common.Hash `json:"hash"` + // WitnessSignature is the signature of the hash value of BlockWitness. Signature crypto.Signature `json:"signature"` } -// Clone returns a deep copy of a NotaryAck. -func (a *NotaryAck) Clone() *NotaryAck { - return &NotaryAck{ - ProposerID: a.ProposerID, - NotaryBlockHash: a.NotaryBlockHash, - Hash: a.Hash, - Signature: a.Signature, +// Clone returns a deep copy of a WitnessAck. +func (a *WitnessAck) Clone() *WitnessAck { + return &WitnessAck{ + ProposerID: a.ProposerID, + WitnessBlockHash: a.WitnessBlockHash, + Hash: a.Hash, + Signature: a.Signature, } } -// Notary represents the consensus information on the compaction chain. -type Notary struct { +// Witness represents the consensus information on the compaction chain. +type Witness struct { ParentHash common.Hash `json:"parent_hash"` Timestamp time.Time `json:"timestamp"` Height uint64 `json:"height"` |