forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on HeaderWithSig
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b8f86f1a60
commit
9cdd14841a
4 changed files with 66 additions and 5 deletions
|
@ -54,3 +54,15 @@ func TestHeaderJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
||||
|
||||
func TestHeaderWithSignatureJSON(t *testing.T) {
|
||||
h := generateHeaderWithSignature()
|
||||
|
||||
data, err := h.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
h2 := new(object.HeaderWithSignature)
|
||||
require.NoError(t, h2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue