mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
libs/common: refactor libs/common 01 (#4230)
* libs/common: Refactor libs/common 01 Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * regenerate proto files, move intslice to where its used * update kv.KVPair(s) to kv.Pair(s) * add changelog entry * make intInSlice private
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/kv"
|
||||
tmpubsub "github.com/tendermint/tendermint/libs/pubsub"
|
||||
tmquery "github.com/tendermint/tendermint/libs/pubsub/query"
|
||||
)
|
||||
@@ -25,7 +26,7 @@ func TestEventBusPublishEventTx(t *testing.T) {
|
||||
result := abci.ResponseDeliverTx{
|
||||
Data: []byte("bar"),
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -69,12 +70,12 @@ func TestEventBusPublishEventNewBlock(t *testing.T) {
|
||||
block := MakeBlock(0, []Tx{}, nil, []Evidence{})
|
||||
resultBeginBlock := abci.ResponseBeginBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
},
|
||||
}
|
||||
resultEndBlock := abci.ResponseEndBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) {
|
||||
Events: []abci.Event{
|
||||
{
|
||||
Type: "transfer",
|
||||
Attributes: []cmn.KVPair{
|
||||
Attributes: []kv.Pair{
|
||||
{Key: []byte("sender"), Value: []byte("foo")},
|
||||
{Key: []byte("recipient"), Value: []byte("bar")},
|
||||
{Key: []byte("amount"), Value: []byte("5")},
|
||||
@@ -127,7 +128,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Type: "transfer",
|
||||
Attributes: []cmn.KVPair{
|
||||
Attributes: []kv.Pair{
|
||||
{Key: []byte("sender"), Value: []byte("baz")},
|
||||
{Key: []byte("recipient"), Value: []byte("cat")},
|
||||
{Key: []byte("amount"), Value: []byte("13")},
|
||||
@@ -135,7 +136,7 @@ func TestEventBusPublishEventTxDuplicateKeys(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Type: "withdraw.rewards",
|
||||
Attributes: []cmn.KVPair{
|
||||
Attributes: []kv.Pair{
|
||||
{Key: []byte("address"), Value: []byte("bar")},
|
||||
{Key: []byte("source"), Value: []byte("iceman")},
|
||||
{Key: []byte("amount"), Value: []byte("33")},
|
||||
@@ -216,12 +217,12 @@ func TestEventBusPublishEventNewBlockHeader(t *testing.T) {
|
||||
block := MakeBlock(0, []Tx{}, nil, []Evidence{})
|
||||
resultBeginBlock := abci.ResponseBeginBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("baz"), Value: []byte("1")}}},
|
||||
},
|
||||
}
|
||||
resultEndBlock := abci.ResponseEndBlock{
|
||||
Events: []abci.Event{
|
||||
{Type: "testType", Attributes: []cmn.KVPair{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
{Type: "testType", Attributes: []kv.Pair{{Key: []byte("foz"), Value: []byte("2")}}},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user