Skip to content

Transaction.Reverify Index can be outside the bounds of the array. #468

@Tommo-L

Description

@Tommo-L

Describe the bug
The index of Transaction.Reverify Witnesses array can be out of bounds.

To Reproduce

Steps to reproduce the behavior:

  1. Create a policy transaction with muli-signatures by using neon-js.
async function setProlicy(){
    const script = createScript({
        scriptHash: CONST.ASSET_ID.POLICY,
        operation: "setMaxBlockSize",
        args: [ ContractParam.integer(100000)]
      });
   
    const transaction = new Transaction({
        sender: reverseHex(multisigAcct.scriptHash),
        cosigners: [{
            account: reverseHex(accounts[0].scriptHash),
            scopes: tx.WitnessScope.CalledByEntry
        },{
            account: reverseHex(accounts[1].scriptHash),
            scopes: tx.WitnessScope.CalledByEntry
        },{
            account: reverseHex(accounts[2].scriptHash),
            scopes: tx.WitnessScope.CalledByEntry
        }],
        validUntilBlock: 100000,
        systemFee: 5,
        networkFee: 5,
        script,
    })

    console.log(transaction)
    
    transaction.sign(accounts[0]).sign(accounts[1]).sign(accounts[2])
    console.log(transaction.serialize(true))

    let txid = await client.sendRawTransaction(transaction.serialize(true));
    console.log(txid)
}

Expected behavior

It should be rejected by neo node, as the hashes.length != Witnesses.length

Screenshots

image

Platform:

  • OS: Centos 7.0
  • Version neo-cli 3.0.0 preview1

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