Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

WitnessRules scope transactions can not be parsed #772

@vincentgeneste

Description

@vincentgeneste

Describe the bug
When a block has a transaction with a scope of WitnessRules, trying to parse it breaks with a null ref.

To Reproduce
this tx https://dora.coz.io/transaction/neo3/mainnet/0x91573ee0f131b98b16fd7f9e1b99756ca0c7c544f5ed687e86432168ea212437 in this block https://dora.coz.io/block/neo3/mainnet/2368604 is using WitnessRules as an example.

    var client = new RpcClient(new Uri("http://seed1.neo.org:10332"), null, null, ProtocolSettings.Load("config.json"));
    var block = await client.GetBlockAsync("2368604");
    
    foreach (var tx in block.Block.Transactions)
    {
        Console.WriteLine(tx.Hash.ToString());
    }

exception thrown:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
 at Neo.IO.Helper.Write[T](BinaryWriter writer, IReadOnlyCollection`1 value)
 at Neo.Network.P2P.Payloads.Signer.Serialize(BinaryWriter writer)
 at Neo.IO.Helper.Write[T](BinaryWriter writer, IReadOnlyCollection`1 value)
 at Neo.Network.P2P.Payloads.Transaction.Neo.Network.P2P.Payloads.IVerifiable.SerializeUnsigned(BinaryWriter writer)
 at Neo.Network.P2P.Helper.CalculateHash(IVerifiable verifiable)
 at Neo.Network.P2P.Payloads.Transaction.get_Hash()

Expected behavior
hash returned .. even for witnessrules scope.

Platform:
Neo 3.4.0
Neo.Network.RPC.RpcClient 3.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions