Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple DSL in dummy_tx.json #67

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Add a simple DSL in dummy_tx.json #67

merged 1 commit into from
Mar 16, 2023

Conversation

mohanson
Copy link
Collaborator

@mohanson mohanson commented Mar 16, 2023

Allowed write {{ data path/to/script }} and {{ hash path/to/script }} in tx.json.

Example: https://github.com/mohanson/ckb-standalone-debugger/blob/syscall_spawn/ckb-debugger/examples/spawn.json

{
  "mock_info": {
    "inputs": [
      {
        "input": {
          "since": "0x0",
          "previous_output": {
            "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000002",
            "index": "0x0"
          }
        },
        "output": {
          "capacity": "0x10000000",
          "lock": {
            "code_hash": "{{ hash spawn_caller_strcat }}",
            "hash_type": "data1",
            "args": "0x"
          },
          "type": null
        },
        "data": "0x",
        "header": null
      }
    ],
    "cell_deps": [
      {
        "cell_dep": {
          "out_point": {
            "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000001",
            "index": "0x0"
          },
          "dep_type": "code"
        },
        "output": {
          "capacity": "0x10000000",
          "lock": {
            "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "hash_type": "data1",
            "args": "0x"
          },
          "type": null
        },
        "data": "{{ data spawn_caller_strcat }}",
        "header": null
      },
      {
        "cell_dep": {
          "out_point": {
            "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000001",
            "index": "0x1"
          },
          "dep_type": "code"
        },
        "output": {
          "capacity": "0x10000000",
          "lock": {
            "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "hash_type": "data1",
            "args": "0x"
          },
          "type": null
        },
        "data": "{{ data spawn_callee_strcat }}",
        "header": null
      }
    ],
    "header_deps": []
  },
  "tx": {
    "version": "0x0",
    "cell_deps": [
      {
        "out_point": {
          "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000001",
          "index": "0x0"
        },
        "dep_type": "code"
      },
      {
        "out_point": {
          "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000001",
          "index": "0x1"
        },
        "dep_type": "code"
      }
    ],
    "header_deps": [],
    "inputs": [
      {
        "since": "0x0",
        "previous_output": {
          "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000002",
          "index": "0x0"
        }
      }
    ],
    "outputs": [
      {
        "capacity": "0x0",
        "lock": {
          "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "hash_type": "data1",
          "args": "0x"
        },
        "type": {
          "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "hash_type": "data1",
          "args": "0x"
        }
      }
    ],
    "outputs_data": [
      "0x"
    ],
    "witnesses": [
      "0x"
    ]
  }
}

@mohanson mohanson merged commit b088c69 into nervosnetwork:develop Mar 16, 2023
@mohanson mohanson deleted the simple_dsl branch March 16, 2023 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant