Skip to content

Commit

Permalink
Add test vectors for cobuild (#46)
Browse files Browse the repository at this point in the history
* Add test vectors for cobuild
* Remove deps secp256k1_data on testcase
  • Loading branch information
joii2020 authored Mar 6, 2024
1 parent 79b8e4b commit 91efc8a
Show file tree
Hide file tree
Showing 8 changed files with 810 additions and 142 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

175 changes: 74 additions & 101 deletions test-vectors/tx_cobuild_btc_compressed.json
Original file line number Diff line number Diff line change
@@ -1,174 +1,147 @@
{
"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": "0x146b17fff1c01825cd3197f4bcf862c171510e1d9505f51e902301a0337619e7"
}
},
"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"
},
"output": {
"capacity": "0xbebc20000",
"lock": {
"code_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"hash_type": "data",
"args": "0x"
},
"type": null
"index": "0x0",
"tx_hash": "0x088d6fea298bc2f464f141a6f129dd91e61496b318ad364080ceed140be5dddf"
}
},
"data": "0x{{ data ../build/always_success }}",
"header": null
},
{
"cell_dep": {
"out_point": {
"tx_hash": "0x75873c7509465e77c3a306d0ceb263a7c39279edf2861928f875001c3e1584ef",
"index": "0x0"
},
"dep_type": "code"
},
"header": null,
"output": {
"capacity": "0x5f5e10000000",
"capacity": "0x1093d9c800",
"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": "0xaa6f2a459a8c962baab66ebf67cc35d8fdecee22b5be130d5fb62ada8b3fdf54"
},
"since": "0x0"
},
"output": {
"capacity": "0x2a",
"lock": {
"args": "0x0470781b76897c0edd4aa5057bea9a73ea185a3b2000",
"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"
},
{
"out_point": {
"tx_hash": "0xe1780a4705c72e853f2330486714b705a9845ed63306c82505c1d84864152159",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0x146b17fff1c01825cd3197f4bcf862c171510e1d9505f51e902301a0337619e7"
}
},
{
"dep_type": "code",
"out_point": {
"tx_hash": "0x75873c7509465e77c3a306d0ceb263a7c39279edf2861928f875001c3e1584ef",
"index": "0x0"
},
"dep_type": "code"
"index": "0x0",
"tx_hash": "0x088d6fea298bc2f464f141a6f129dd91e61496b318ad364080ceed140be5dddf"
}
},
{
"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": "0xaa6f2a459a8c962baab66ebf67cc35d8fdecee22b5be130d5fb62ada8b3fdf54"
},
"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"
"0x010000ff720000000c000000180000000c00000008000000040000005600000000550000001000000055000000550000004100000020da699152a6b45d3aac5cd80e23ae808563e91f34edeb8daba6ab2cca6e872ff646401ce75f83f14a427ee23136fdab775a181d485c87ef41677558778a0dd449"
]
}
}
Loading

0 comments on commit 91efc8a

Please sign in to comment.