mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-10 10:06:20 +00:00
rename to metadata
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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++ {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user