Skip to content

Commit

Permalink
Add test vectors for cobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
joii2020 committed Mar 6, 2024
1 parent 79b8e4b commit 49d645a
Show file tree
Hide file tree
Showing 6 changed files with 954 additions and 90 deletions.
5 changes: 4 additions & 1 deletion test-vectors/run-all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

for file in *.json; do
echo $file
ckb-debugger --bin ../build/omni_lock -f $file -i 0 -s lock
if (($? != 0)); then
exit 1
fi
done

178 changes: 89 additions & 89 deletions test-vectors/tx_cobuild_btc_compressed.json
Original file line number Diff line number Diff line change
@@ -1,174 +1,174 @@
{
"mock_info": {
"inputs": [
{
"input": {
"since": "0x0",
"previous_output": {
"tx_hash": "0xd1e44a0ecd92ce90ec215f5d236ceb255247be49c5e7a22658c73eba05fef514",
"index": "0x0"
}
},
"output": {
"capacity": "0x2a",
"lock": {
"code_hash": "0x519b7adaa5a4b585d15aa14fe605d55b2e71235b8c4868784a3553d4d034a929",
"hash_type": "data",
"args": "0x04bc6e317199b3207c5589ffae4aed3570208cb62b00"
},
"type": null
},
"data": "0x",
"header": null
}
],
"cell_deps": [
{
"cell_dep": {
"dep_type": "code",
"out_point": {
"tx_hash": "0xcd606c347e9435c42fca6c31dd8cc1aa25cdc28a7a25ba79bca894099bf7b70e",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0x829ebae400094c097774818338877991bf01f0a2061fb398e926cc86ec82cf2d"
}
},
"data": "0x{{ data ../../build/omni_lock }}",
"header": null,
"output": {
"capacity": "0xb627b19f800",
"capacity": "0xb6d48c1c800",
"lock": {
"args": "0x",
"code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"hash_type": "data",
"args": "0x"
"hash_type": "data"
},
"type": null
},
"data": "0x",
"header": null
}
},
{
"cell_dep": {
"dep_type": "code",
"out_point": {
"tx_hash": "0xe1780a4705c72e853f2330486714b705a9845ed63306c82505c1d84864152159",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0xa0853d07a9fdce7f8904284229cab8faf23f544316b99d6d576acac853fb1409"
}
},
"data": "0x{{ data ../../build/always_success }}",
"header": null,
"output": {
"capacity": "0xbebc20000",
"capacity": "0x1093d9c800",
"lock": {
"args": "0x",
"code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"hash_type": "data",
"args": "0x"
"hash_type": "data"
},
"type": null
},
"data": "0x{{ data ../build/always_success }}",
"header": null
}
},
{
"cell_dep": {
"dep_type": "code",
"out_point": {
"tx_hash": "0x75873c7509465e77c3a306d0ceb263a7c39279edf2861928f875001c3e1584ef",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0x5aefa60b9cc38b78cc80e7478da8347bc0f7b9ad7a4433fd9b4ce8fd25244475"
}
},
"data": "0x{{ data ../../build/secp256k1_data }}",
"header": null,
"output": {
"capacity": "0x5f5e10000000",
"capacity": "0x2faf080000",
"lock": {
"args": "0x",
"code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"hash_type": "data",
"args": "0x"
"hash_type": "data"
},
"type": null
},
"data": "0x{{ data ../build/secp256k1_data }}",
"header": null
}
},
{
"cell_dep": {
"dep_type": "code",
"out_point": {
"tx_hash": "0xa638f65f650bdac13bf91134ed7eec8feded1dac5e6add9e26cf658b2a693066",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0xa638f65f650bdac13bf91134ed7eec8feded1dac5e6add9e26cf658b2a693066"
}
},
"data": "0x{{ data ../../build/validate_signature_rsa }}",
"header": null,
"output": {
"capacity": "0x11510",
"lock": {
"code_hash": "0xd483925160e4232b2cb29f012e8380b7b612d71cf4e79991476b6bcf610735f6",
"hash_type": "data",
"args": "0x"
"args": "0x",
"code_hash": "0x60fc4b3cfd4ca5977d0749238f1301e99929b5665bb8eb9160227e7b41b48ccb",
"hash_type": "data1"
},
"type": {
"args": "0x0000000000000000000000000000000000000000000000000000000000000000",
"code_hash": "0xa638f65f650bdac13bf91134ed7eec8feded1dac5e6add9e26cf658b2a693066",
"hash_type": "type",
"args": "0x0000000000000000000000000000000000000000000000000000000000000000"
"hash_type": "type"
}
},
"data": "0x{{ data ../build/validate_signature_rsa }}",
"header": null
}
}
],
"extensions": [],
"header_deps": [],
"extensions": []
"inputs": [
{
"data": "0x",
"header": null,
"input": {
"previous_output": {
"index": "0x0",
"tx_hash": "0x62e24294d4a77c3b558ef06ce67847518cd893e26eeb0820b13be779536ba231"
},
"since": "0x0"
},
"output": {
"capacity": "0x2a",
"lock": {
"args": "0x04d63602213c0d493c15fcf7d897b59d7c3348ee7d00",
"code_hash": "0xce6b8f2ba48b3ed6d84a851daad2c0bd28a084c6c31a6943a3f39cbb4d48df10",
"hash_type": "data1"
},
"type": null
}
}
]
},
"tx": {
"version": "0x0",
"cell_deps": [
{
"dep_type": "code",
"out_point": {
"tx_hash": "0xcd606c347e9435c42fca6c31dd8cc1aa25cdc28a7a25ba79bca894099bf7b70e",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0x829ebae400094c097774818338877991bf01f0a2061fb398e926cc86ec82cf2d"
}
},
{
"dep_type": "code",
"out_point": {
"tx_hash": "0xe1780a4705c72e853f2330486714b705a9845ed63306c82505c1d84864152159",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0xa0853d07a9fdce7f8904284229cab8faf23f544316b99d6d576acac853fb1409"
}
},
{
"dep_type": "code",
"out_point": {
"tx_hash": "0x75873c7509465e77c3a306d0ceb263a7c39279edf2861928f875001c3e1584ef",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0x5aefa60b9cc38b78cc80e7478da8347bc0f7b9ad7a4433fd9b4ce8fd25244475"
}
},
{
"dep_type": "code",
"out_point": {
"tx_hash": "0xa638f65f650bdac13bf91134ed7eec8feded1dac5e6add9e26cf658b2a693066",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0xa638f65f650bdac13bf91134ed7eec8feded1dac5e6add9e26cf658b2a693066"
}
}
],
"header_deps": [],
"inputs": [
{
"since": "0x0",
"previous_output": {
"tx_hash": "0xd1e44a0ecd92ce90ec215f5d236ceb255247be49c5e7a22658c73eba05fef514",
"index": "0x0"
}
"index": "0x0",
"tx_hash": "0x62e24294d4a77c3b558ef06ce67847518cd893e26eeb0820b13be779536ba231"
},
"since": "0x0"
}
],
"outputs": [
{
"capacity": "0x2a",
"lock": {
"args": "0x",
"code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"hash_type": "data",
"args": "0x"
"hash_type": "data"
},
"type": null
}
],
"outputs_data": [
"0x"
],
"version": "0x0",
"witnesses": [
"0x010000ff710000000c000000180000000c00000008000000040000005500000055000000100000005500000055000000410000001fdf92875c7130e347da5d09f56332893c0bffc1655b4b57c59610d0a4ea36c05838b90918afc54c88e9b1624f3465deb2aff93c24790e7d51f8cdb2712bfc6024"
"0x010000ff720000000c000000180000000c00000008000000040000005600000000550000001000000055000000550000004100000020421ad53d86f969f1b1262827540d2c062dedd8b8ddc113833ee1a4c48504a4a45a5063cb4ebdd958cec03e266c58cb9da200731d1d8bfe1aaea0e4da0e47bc39"
]
}
}
Loading

0 comments on commit 49d645a

Please sign in to comment.