diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-23 15:17:52 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:16 +0800 |
commit | 9f723203a14fbe3f4ac087d2b7309381d7d1b419 (patch) | |
tree | 560f4f7b31186bc0fa3ff7ee18b4aa079c5f6c7a /vendor/github.com/dexon-foundation/dexon-consensus-core/core/types/block-randomness.go | |
parent | 18b940c6840e1030be76945207fb5bdf6323d696 (diff) | |
download | go-tangerine-9f723203a14fbe3f4ac087d2b7309381d7d1b419.tar.gz go-tangerine-9f723203a14fbe3f4ac087d2b7309381d7d1b419.tar.zst go-tangerine-9f723203a14fbe3f4ac087d2b7309381d7d1b419.zip |
vendor: use govendor to import dexon-consensus-core
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus-core/core/types/block-randomness.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus-core/core/types/block-randomness.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus-core/core/types/block-randomness.go b/vendor/github.com/dexon-foundation/dexon-consensus-core/core/types/block-randomness.go new file mode 100644 index 000000000..ebffd2b22 --- /dev/null +++ b/vendor/github.com/dexon-foundation/dexon-consensus-core/core/types/block-randomness.go @@ -0,0 +1,43 @@ +// Copyright 2018 The dexon-consensus-core Authors +// This file is part of the dexon-consensus-core library. +// +// The dexon-consensus-core library is free software: you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// The dexon-consensus-core library is distributed in the hope that it will be +// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +// General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the dexon-consensus-core library. If not, see +// <http://www.gnu.org/licenses/>. + +package types + +import ( + "fmt" + + "github.com/dexon-foundation/dexon-consensus-core/common" +) + +// AgreementResult describes an agremeent result. +type AgreementResult struct { + BlockHash common.Hash `json:"block_hash"` + Position Position `json:"position"` + Votes []Vote `json:"votes"` +} + +func (r *AgreementResult) String() string { + return fmt.Sprintf( + "agreementResult[%s:%s]", r.BlockHash, &r.Position) +} + +// BlockRandomnessResult describes a block randomness result +type BlockRandomnessResult struct { + BlockHash common.Hash `json:"block_hash"` + Position Position `json:"position"` + Randomness []byte `json:"randomness"` +} |