-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vesper: add commitment layout for TransitionBundle
- Loading branch information
1 parent
534ef91
commit 0716f0e
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ use bp::stl::bp_core_stl; | |
use commit_verify::stl::commit_verify_stl; | ||
use commit_verify::CommitmentLayout; | ||
use rgb::stl::bp_tx_stl; | ||
use rgb::{SubSchema, Transition}; | ||
use rgb::{SubSchema, Transition, TransitionBundle}; | ||
use strict_types::stl::{std_stl, strict_types_stl}; | ||
use strict_types::typelib::parse_args; | ||
use strict_types::SystemBuilder; | ||
|
@@ -119,8 +119,26 @@ Seals vesper lexicon=types+commitments | |
let tt = sys.type_tree("RGB.Transition").unwrap(); | ||
writeln!(file, "{tt}").unwrap(); | ||
|
||
let mut file = fs::File::create(format!("{dir}/AnchoredBundle.vesper")).unwrap(); | ||
writeln!( | ||
file, | ||
"{{- | ||
Description: RGB Anchored Bundle | ||
Author: Dr Maxim Orlovsky <[email protected]> | ||
Copyright (C) 2024 LNP/BP Standards Association. All rights reserved. | ||
License: Apache-2.0 | ||
-}} | ||
Seals vesper lexicon=types+commitments | ||
" | ||
) | ||
.unwrap(); | ||
let layout = TransitionBundle::commitment_layout(); | ||
writeln!(file, "{layout}").unwrap(); | ||
let tt = sys.type_tree("RGB.InputMap").unwrap(); | ||
writeln!(file, "{tt}").unwrap(); | ||
let tt = sys.type_tree("RGB.AnchoredBundle").unwrap(); | ||
fs::write(format!("{dir}/AnchoredBundle.vesper",), format!("{tt}")).unwrap(); | ||
writeln!(file, "{tt}").unwrap(); | ||
|
||
let tt = sys.type_tree("CommitVerify.MerkleNode").unwrap(); | ||
fs::write(format!("{dir}/MerkleNode.vesper",), format!("{tt}")).unwrap(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
{- | ||
Description: RGB Anchored Bundle | ||
Author: Dr Maxim Orlovsky <[email protected]> | ||
Copyright (C) 2024 LNP/BP Standards Association. All rights reserved. | ||
License: Apache-2.0 | ||
-} | ||
|
||
Seals vesper lexicon=types+commitments | ||
|
||
BundleId commitment hasher=SHA256 tagged=urn:lnp-bp:rgb:bundle#2024-02-03 | ||
InputMap serialized | ||
|
||
_ map len=1..MAX16 aka=InputMap | ||
key is U32 aka=Vout | ||
value bytes len=32 aka=OpId | ||
|
||
AnchoredBundle rec | ||
anchor union -- XChainAnchorSet | ||
bitcoin union wrapped tag=0 -- AnchorSet | ||
|
@@ -319,3 +335,4 @@ AnchoredBundle rec | |
salt is U64 | ||
valencies set len=0..MAX8 aka=Valencies | ||
element is U16 aka=ValencyType | ||
|