Skip to content

Commit

Permalink
chore: Use builtin aliases in witness json
Browse files Browse the repository at this point in the history
It turns out that the parser for ResolvedType that I wrote accepts
builtin aliases. This makes witness json files more readable.
  • Loading branch information
uncomputable committed Sep 9, 2024
1 parent 95634c2 commit 8d93f95
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/escrow_with_delay.timeout.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"transfer_or_timeout": {
"value": "Right(0xedb6865094260f8558728233aae017dd0969a2afe5f08c282e1ab659bf2462684c99a64a2a57246358a0d632671778d016e6df7381293dd5bb9f0999d38640d4)",
"type": "Either<[Option<[u8; 64]>; 3], [u8; 64]>"
"type": "Either<[Option<Signature>; 3], Signature>"
}
}
4 changes: 2 additions & 2 deletions examples/hodl_vault.wit
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
},
"oracle_sig": {
"value": "0x90231b8de96a1f940ddcf406fe8389417ca8fb0b03151608e2f94b31b443a7e0d26a12e437df69028f09027c37d5f6742a10c1e8864061d119b8bbce962d26d3",
"type": "[u8; 64]"
"type": "Signature"
},
"owner_sig": {
"value": "0xf2341f571f069216edfc72822f6094b8ec339c2f72dc64aea0eed1e3d60abf4572fdd04618e5b5bc672ccd71cfaf125b6c1b101aeca3a7b938fe83932ab38743",
"type": "[u8; 64]"
"type": "Signature"
}
}
2 changes: 1 addition & 1 deletion examples/htlc.complete.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"complete_or_cancel": {
"value": "Left((0x0000000000000000000000000000000000000000000000000000000000000000, 0xf74b3ca574647f8595624b129324afa2f38b598a9c1c7cfc5f08a9c036ec5acd3c0fbb9ed3dae5ca23a0a65a34b5d6cccdd6ba248985d6041f7b21262b17af6f))",
"type": "Either<(u256, [u8; 64]), [u8; 64]>"
"type": "Either<(u256, Signature), Signature>"
}
}
2 changes: 1 addition & 1 deletion examples/last_will.inherit.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"inherit_or_not": {
"value": "Left(0x755201bb62b0a8b8d18fd12fc02951ea3998ba42bfc6664daaf8a0d2298cad43cdc21358c7c82f37654275dc2fea8c858adbe97bac92828b498a5a237004db6f)",
"type": "Either<[u8; 64], Either<[u8; 64], [u8; 64]>>"
"type": "Either<Signature, Either<Signature, Signature>>"
}
}
2 changes: 1 addition & 1 deletion examples/p2ms.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"maybe_sigs": {
"value": "[Some(0xf74b3ca574647f8595624b129324afa2f38b598a9c1c7cfc5f08a9c036ec5acd3c0fbb9ed3dae5ca23a0a65a34b5d6cccdd6ba248985d6041f7b21262b17af6f), None, Some(0x29dbeab5628ae472bce3e08728ead1997ef789d4f04b5be39cc08b362dc229f553fd353f8a0acffdfbddd471d15a0dda3b306842416ff246bc07462e5667eb89)]",
"type": "[Option<[u8; 64]>; 3]"
"type": "[Option<Signature>; 3]"
}
}
2 changes: 1 addition & 1 deletion examples/p2pk.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sig": {
"value": "0xf74b3ca574647f8595624b129324afa2f38b598a9c1c7cfc5f08a9c036ec5acd3c0fbb9ed3dae5ca23a0a65a34b5d6cccdd6ba248985d6041f7b21262b17af6f",
"type": "[u8; 64]"
"type": "Signature"
}
}
4 changes: 2 additions & 2 deletions examples/p2pkh.wit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"pk": {
"value": "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"type": "u256"
"type": "Pubkey"
},
"sig": {
"value": "0xf74b3ca574647f8595624b129324afa2f38b598a9c1c7cfc5f08a9c036ec5acd3c0fbb9ed3dae5ca23a0a65a34b5d6cccdd6ba248985d6041f7b21262b17af6f",
"type": "[u8; 64]"
"type": "Signature"
}
}
2 changes: 1 addition & 1 deletion examples/presigned_vault.complete.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hot_or_cold": {
"value": "Left(0xedb6865094260f8558728233aae017dd0969a2afe5f08c282e1ab659bf2462684c99a64a2a57246358a0d632671778d016e6df7381293dd5bb9f0999d38640d4)",
"type": "Either<[u8; 64], [u8; 64]>"
"type": "Either<Signature, Signature>"
}
}
2 changes: 1 addition & 1 deletion examples/sighash_all_anyprevoutanyscript.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sig": {
"value": "0xc939e32344642e3c228b0162041824afe194297477188255d2637908a0d00d1fdf59214a304ddf180b1a07019a60d808d18170fb77fd3b00eca76667d7aa268e",
"type": "[u8; 64]"
"type": "Signature"
}
}
2 changes: 1 addition & 1 deletion examples/sighash_none.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sig": {
"value": "0x346152583d5b60b972bb4c03ab672e339431060e2b09c447ab983c65dabc70a459f3beca7788bfa5da221cf99227b65b4ad3821a2045c847ee56d48df26aee9c",
"type": "[u8; 64]"
"type": "Signature"
}
}
4 changes: 2 additions & 2 deletions examples/transfer_with_timeout.transfer.wit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"sender_sig": {
"value": "0xf74b3ca574647f8595624b129324afa2f38b598a9c1c7cfc5f08a9c036ec5acd3c0fbb9ed3dae5ca23a0a65a34b5d6cccdd6ba248985d6041f7b21262b17af6f",
"type": "[u8; 64]"
"type": "Signature"
},
"transfer_or_timeout": {
"value": "Some(0xf914c88a1ee88b4b7b8eb5603b835fa879386af79628aa9435226f64bdd54313794b18e30437231897dab3861d92437e0efe03a4bb17e60e4369d192b0c61ecf)",
"type": "Option<[u8; 64]>"
"type": "Option<Signature>"
}
}

0 comments on commit 8d93f95

Please sign in to comment.