mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-21 23:43:46 +00:00
context: support Neo.Network.P2P.Payloads.Transaction type
C# now uses this one, so use it by default, but also accept old one.
This commit is contained in:
parent
ad35db66b5
commit
59b4377f90
3 changed files with 3 additions and 3 deletions
|
@ -23,7 +23,7 @@ func InitAndSave(net netmode.Magic, tx *transaction.Transaction, acc *wallet.Acc
|
||||||
priv := acc.PrivateKey()
|
priv := acc.PrivateKey()
|
||||||
pub := priv.PublicKey()
|
pub := priv.PublicKey()
|
||||||
sign := priv.SignHashable(uint32(net), tx)
|
sign := priv.SignHashable(uint32(net), tx)
|
||||||
scCtx := context.NewParameterContext("Neo.Core.ContractTransaction", net, tx)
|
scCtx := context.NewParameterContext("Neo.Network.P2P.Payloads.Transaction", net, tx)
|
||||||
h, err := address.StringToUint160(acc.Address)
|
h, err := address.StringToUint160(acc.Address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("invalid address: %s", acc.Address)
|
return fmt.Errorf("invalid address: %s", acc.Address)
|
||||||
|
|
|
@ -188,7 +188,7 @@ func (c *ParameterContext) UnmarshalJSON(data []byte) error {
|
||||||
|
|
||||||
var verif crypto.VerifiableDecodable
|
var verif crypto.VerifiableDecodable
|
||||||
switch pc.Type {
|
switch pc.Type {
|
||||||
case "Neo.Core.ContractTransaction":
|
case "Neo.Core.ContractTransaction", "Neo.Network.P2P.Payloads.Transaction":
|
||||||
tx := new(transaction.Transaction)
|
tx := new(transaction.Transaction)
|
||||||
verif = tx
|
verif = tx
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -77,7 +77,7 @@ func TestParameterContext_AddSignatureSimpleContract(t *testing.T) {
|
||||||
|
|
||||||
func TestParameterContext_AddSignatureMultisig(t *testing.T) {
|
func TestParameterContext_AddSignatureMultisig(t *testing.T) {
|
||||||
tx := getContractTx()
|
tx := getContractTx()
|
||||||
c := NewParameterContext("Neo.Core.ContractTransaction", netmode.UnitTestNet, tx)
|
c := NewParameterContext("Neo.Network.P2P.Payloads.Transaction", netmode.UnitTestNet, tx)
|
||||||
privs, pubs := getPrivateKeys(t, 4)
|
privs, pubs := getPrivateKeys(t, 4)
|
||||||
pubsCopy := keys.PublicKeys(pubs).Copy()
|
pubsCopy := keys.PublicKeys(pubs).Copy()
|
||||||
script, err := smartcontract.CreateMultiSigRedeemScript(3, pubsCopy)
|
script, err := smartcontract.CreateMultiSigRedeemScript(3, pubsCopy)
|
||||||
|
|
Loading…
Reference in a new issue