mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-21 06:36:19 +00:00
proto: add proto files for ibc unblock (#4853)
## Description these proto files are meant to help unblock ibc in their quest of migrating the ibc module to proto. Closes: #XXX
This commit is contained in:
@@ -265,3 +265,26 @@ func TestJSONMarshalUnmarshal(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestBitArrayProtoBuf(t *testing.T) {
|
||||
testCases := []struct {
|
||||
msg string
|
||||
bA1 *BitArray
|
||||
expPass bool
|
||||
}{
|
||||
{"success empty", &BitArray{}, true},
|
||||
{"success", NewBitArray(1), true},
|
||||
{"success", NewBitArray(2), true},
|
||||
{"negative", NewBitArray(-1), false},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
protoBA := tc.bA1.ToProto()
|
||||
ba := new(BitArray)
|
||||
ba.FromProto(protoBA)
|
||||
if tc.expPass {
|
||||
require.Equal(t, tc.bA1, ba, tc.msg)
|
||||
} else {
|
||||
require.NotEqual(t, tc.bA1, ba, tc.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user