mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 09:42:22 +00:00
7d91a3a89e
This way we can use it in scripts and cli.
28 lines
741 B
Go
28 lines
741 B
Go
package transaction
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/internal/testserdes"
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
)
|
|
|
|
func TestCosignerEncodeDecode(t *testing.T) {
|
|
expected := &Signer{
|
|
Account: util.Uint160{1, 2, 3, 4, 5},
|
|
Scopes: CustomContracts,
|
|
AllowedContracts: []util.Uint160{{1, 2, 3, 4}, {6, 7, 8, 9}},
|
|
}
|
|
actual := &Signer{}
|
|
testserdes.EncodeDecodeBinary(t, expected, actual)
|
|
}
|
|
|
|
func TestCosignerMarshallUnmarshallJSON(t *testing.T) {
|
|
expected := &Signer{
|
|
Account: util.Uint160{1, 2, 3, 4, 5},
|
|
Scopes: CustomContracts,
|
|
AllowedContracts: []util.Uint160{{1, 2, 3, 4}, {6, 7, 8, 9}},
|
|
}
|
|
actual := &Signer{}
|
|
testserdes.MarshalUnmarshalJSON(t, expected, actual)
|
|
}
|