Skip to content

Embed Payment Tests

bitcoincoretech edited this page Nov 16, 2020 · 5 revisions

https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/fixtures/embed.json

Test 1 (provide output script)

image

    {
      "description": "output from output",
      "arguments": {
        "output": "OP_RETURN a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4"
      },
      "options": {},
      "expected": {
        "data": [
          "a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4"
        ],
        "output": "OP_RETURN a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4",
        "input": null,
        "witness": null
      }
    }

Test 2 (provide one data entry)

image

    {
      "description": "output from data",
      "arguments": {
        "data": [
          "a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4"
        ]
      },
      "expected": {
        "data": [
          "a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4"
        ],
        "output": "OP_RETURN a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4",
        "input": null,
        "witness": null
      }
    }

Test 3 (output script and data entry do not match)

image

    {
      "description": "Return value and data do not match",
      "exception": "Data mismatch",
      "options": {},
      "arguments": {
        "output": "OP_RETURN a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4",
        "data": [
          "a3b147dbe4a85579fc4b5a1855555555555555555555555555555555555555555555555555555555"
        ]
      }
    }

Clone this wiki locally