aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-09-19 18:48:41 +0800
committermissionliao <38416648+missionliao@users.noreply.github.com>2018-09-19 18:48:41 +0800
commit22e70f6da486ed6796a493f25e04679b9afa1439 (patch)
tree41998daa892812957daa58d7fe84d6fd06f4327c /core/types
parenta2a733e6f98018cb2ecc4b3982386be8892d7433 (diff)
downloaddexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.tar
dexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.tar.gz
dexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.tar.bz2
dexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.tar.lz
dexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.tar.xz
dexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.tar.zst
dexon-consensus-22e70f6da486ed6796a493f25e04679b9afa1439.zip
core: rename Notary (Acks) to Witness (#118)
Diffstat (limited to 'core/types')
-rw-r--r--core/types/block.go8
-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"`