rename to metadata

This commit is contained in:
Callum Waters
2021-08-20 16:41:02 +02:00
parent 508b7f9758
commit beafe7d4f1
37 changed files with 342 additions and 342 deletions
+6 -6
View File
@@ -17,7 +17,7 @@ import (
tmrand "github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/pkg/consensus"
"github.com/tendermint/tendermint/pkg/light"
"github.com/tendermint/tendermint/pkg/meta"
"github.com/tendermint/tendermint/pkg/metadata"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)
@@ -364,7 +364,7 @@ func (l *LightClientAttackEvidence) GetByzantineValidators(commonVals *consensus
// to determine whether the conflicting header was the product of a valid state transition
// or not. If it is then all the deterministic fields of the header should be the same.
// If not, it is an invalid header and constitutes a lunatic attack.
func (l *LightClientAttackEvidence) ConflictingHeaderIsInvalid(trustedHeader *meta.Header) bool {
func (l *LightClientAttackEvidence) ConflictingHeaderIsInvalid(trustedHeader *metadata.Header) bool {
return !bytes.Equal(trustedHeader.ValidatorsHash, l.ConflictingBlock.ValidatorsHash) ||
!bytes.Equal(trustedHeader.NextValidatorsHash, l.ConflictingBlock.NextValidatorsHash) ||
!bytes.Equal(trustedHeader.ConsensusHash, l.ConflictingBlock.ConsensusHash) ||
@@ -691,7 +691,7 @@ func NewMockDuplicateVoteEvidenceWithValidator(height int64, time time.Time,
}
func makeMockVote(height int64, round, index int32, addr consensus.Address,
blockID meta.BlockID, time time.Time) *consensus.Vote {
blockID metadata.BlockID, time time.Time) *consensus.Vote {
return &consensus.Vote{
Type: tmproto.SignedMsgType(2),
Height: height,
@@ -703,10 +703,10 @@ func makeMockVote(height int64, round, index int32, addr consensus.Address,
}
}
func randBlockID() meta.BlockID {
return meta.BlockID{
func randBlockID() metadata.BlockID {
return metadata.BlockID{
Hash: tmrand.Bytes(tmhash.Size),
PartSetHeader: meta.PartSetHeader{
PartSetHeader: metadata.PartSetHeader{
Total: 1,
Hash: tmrand.Bytes(tmhash.Size),
},
+6 -6
View File
@@ -19,7 +19,7 @@ import (
"github.com/tendermint/tendermint/pkg/consensus"
"github.com/tendermint/tendermint/pkg/evidence"
"github.com/tendermint/tendermint/pkg/light"
"github.com/tendermint/tendermint/pkg/meta"
"github.com/tendermint/tendermint/pkg/metadata"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/tendermint/tendermint/version"
)
@@ -237,7 +237,7 @@ func TestMockEvidenceValidateBasic(t *testing.T) {
}
func makeVote(
t *testing.T, val consensus.PrivValidator, chainID string, valIndex int32, height int64, round int32, step int, blockID meta.BlockID,
t *testing.T, val consensus.PrivValidator, chainID string, valIndex int32, height int64, round int32, step int, blockID metadata.BlockID,
time time.Time) *consensus.Vote {
pubKey, err := val.GetPubKey(context.Background())
require.NoError(t, err)
@@ -260,8 +260,8 @@ func makeVote(
return v
}
func makeHeaderRandom() *meta.Header {
return &meta.Header{
func makeHeaderRandom() *metadata.Header {
return &metadata.Header{
Version: version.Consensus{Block: version.BlockProtocol, App: 1},
ChainID: tmrand.Str(12),
Height: int64(mrand.Uint32() + 1),
@@ -335,12 +335,12 @@ func TestEvidenceVectors(t *testing.T) {
commonHeight := height - 1
nValidators := 10
voteSet, valSet, privVals := test.DeterministicVoteSet(height, 1, tmproto.PrecommitType, 1)
header := &meta.Header{
header := &metadata.Header{
Version: version.Consensus{Block: 1, App: 1},
ChainID: chainID,
Height: height,
Time: time.Date(math.MaxInt64, 0, 0, 0, 0, 0, math.MaxInt64, time.UTC),
LastBlockID: meta.BlockID{},
LastBlockID: metadata.BlockID{},
LastCommitHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
DataHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
ValidatorsHash: valSet.Hash(),