[#172] Use protobuf v2 API for go

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-19 21:51:59 +03:00 committed by Alex Vanin
parent b681b28e33
commit 8351c78f58
28 changed files with 10089 additions and 32649 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/nspcc-dev/neofs-api-go/util/proto/test"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
goproto "google.golang.org/protobuf/proto"
)
type SomeEnum int32
@ -437,7 +438,7 @@ func testMarshal(t *testing.T, c stablePrimitives, tr test.Primitives, wrongFiel
wire, err = c.stableMarshal(nil, wrongField)
require.NoError(t, err)
wireGen, err := tr.Marshal()
wireGen, err := goproto.Marshal(&tr)
require.NoError(t, err)
if !wrongField {
@ -448,7 +449,7 @@ func testMarshal(t *testing.T, c stablePrimitives, tr test.Primitives, wrongFiel
}
result := new(test.Primitives)
err = result.Unmarshal(wire)
err = goproto.Unmarshal(wire, result)
require.NoError(t, err)
return result
@ -588,7 +589,7 @@ func testRepMarshal(t *testing.T, c stableRepPrimitives, tr test.RepPrimitives,
wire, err = c.stableMarshal(nil, wrongField)
require.NoError(t, err)
wireGen, err := tr.Marshal()
wireGen, err := goproto.Marshal(&tr)
require.NoError(t, err)
if !wrongField {
@ -599,7 +600,7 @@ func testRepMarshal(t *testing.T, c stableRepPrimitives, tr test.RepPrimitives,
}
result := new(test.RepPrimitives)
err = result.Unmarshal(wire)
err = goproto.Unmarshal(wire, result)
require.NoError(t, err)
return result

File diff suppressed because it is too large Load diff