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
+8 -8
View File
@@ -5,7 +5,7 @@ import (
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/pkg/meta"
"github.com/tendermint/tendermint/pkg/metadata"
"github.com/tendermint/tendermint/version"
)
@@ -32,14 +32,14 @@ func RandomHash() []byte {
return crypto.CRandBytes(tmhash.Size)
}
func MakeBlockID() meta.BlockID {
func MakeBlockID() metadata.BlockID {
return MakeBlockIDWithHash(RandomHash())
}
func MakeBlockIDWithHash(hash []byte) meta.BlockID {
return meta.BlockID{
func MakeBlockIDWithHash(hash []byte) metadata.BlockID {
return metadata.BlockID{
Hash: hash,
PartSetHeader: meta.PartSetHeader{
PartSetHeader: metadata.PartSetHeader{
Total: 100,
Hash: RandomHash(),
},
@@ -48,7 +48,7 @@ func MakeBlockIDWithHash(hash []byte) meta.BlockID {
// MakeHeader fills the rest of the contents of the header such that it passes
// validate basic
func MakeHeader(h *meta.Header) (*meta.Header, error) {
func MakeHeader(h *metadata.Header) (*metadata.Header, error) {
if h.Version.Block == 0 {
h.Version.Block = version.BlockProtocol
}
@@ -92,8 +92,8 @@ func MakeHeader(h *meta.Header) (*meta.Header, error) {
return h, h.ValidateBasic()
}
func MakeRandomHeader() *meta.Header {
h, err := MakeHeader(&meta.Header{})
func MakeRandomHeader() *metadata.Header {
h, err := MakeHeader(&metadata.Header{})
if err != nil {
panic(err)
}
+4 -4
View File
@@ -6,11 +6,11 @@ import (
"time"
"github.com/tendermint/tendermint/pkg/consensus"
"github.com/tendermint/tendermint/pkg/meta"
"github.com/tendermint/tendermint/pkg/metadata"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)
func MakeRandomCommit(time time.Time) *meta.Commit {
func MakeRandomCommit(time time.Time) *metadata.Commit {
lastID := MakeBlockID()
h := int64(3)
voteSet, _, vals := RandVoteSet(h-1, 1, tmproto.PrecommitType, 10, 1)
@@ -21,8 +21,8 @@ func MakeRandomCommit(time time.Time) *meta.Commit {
return commit
}
func MakeCommit(blockID meta.BlockID, height int64, round int32,
voteSet *consensus.VoteSet, validators []consensus.PrivValidator, now time.Time) (*meta.Commit, error) {
func MakeCommit(blockID metadata.BlockID, height int64, round int32,
voteSet *consensus.VoteSet, validators []consensus.PrivValidator, now time.Time) (*metadata.Commit, error) {
// all sign
for i := 0; i < len(validators); i++ {
+2 -2
View File
@@ -5,10 +5,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/tendermint/tendermint/pkg/meta"
"github.com/tendermint/tendermint/pkg/metadata"
)
func TestMakeHeader(t *testing.T) {
_, err := MakeHeader(&meta.Header{})
_, err := MakeHeader(&metadata.Header{})
assert.NoError(t, err)
}
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/pkg/consensus"
"github.com/tendermint/tendermint/pkg/meta"
"github.com/tendermint/tendermint/pkg/metadata"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)
@@ -20,7 +20,7 @@ func MakeVote(
height int64,
round int32,
step int,
blockID meta.BlockID,
blockID metadata.BlockID,
time time.Time,
) (*consensus.Vote, error) {
pubKey, err := val.GetPubKey(context.Background())