2020-04-30 13:00:33 +00:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2020-11-23 11:09:00 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/internal/testserdes"
|
2020-04-30 13:00:33 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCosignerEncodeDecode(t *testing.T) {
|
2020-07-29 16:57:38 +00:00
|
|
|
expected := &Signer{
|
2020-04-30 13:00:33 +00:00
|
|
|
Account: util.Uint160{1, 2, 3, 4, 5},
|
|
|
|
Scopes: CustomContracts,
|
|
|
|
AllowedContracts: []util.Uint160{{1, 2, 3, 4}, {6, 7, 8, 9}},
|
|
|
|
}
|
2020-07-29 16:57:38 +00:00
|
|
|
actual := &Signer{}
|
2020-04-30 13:00:33 +00:00
|
|
|
testserdes.EncodeDecodeBinary(t, expected, actual)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestCosignerMarshallUnmarshallJSON(t *testing.T) {
|
2020-07-29 16:57:38 +00:00
|
|
|
expected := &Signer{
|
2020-04-30 13:00:33 +00:00
|
|
|
Account: util.Uint160{1, 2, 3, 4, 5},
|
|
|
|
Scopes: CustomContracts,
|
|
|
|
AllowedContracts: []util.Uint160{{1, 2, 3, 4}, {6, 7, 8, 9}},
|
|
|
|
}
|
2020-07-29 16:57:38 +00:00
|
|
|
actual := &Signer{}
|
2020-04-30 13:00:33 +00:00
|
|
|
testserdes.MarshalUnmarshalJSON(t, expected, actual)
|
|
|
|
}
|