-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
793f50c
commit 17f1d3c
Showing
8 changed files
with
1,355 additions
and
582 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -20,23 +20,68 @@ | |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use std::fs; | ||
|
||
use aluvm::stl::aluvm_stl; | ||
use bp::stl::bp_core_stl; | ||
use commit_verify::stl::commit_verify_stl; | ||
use rgb::stl::bp_tx_stl; | ||
use strict_types::stl::{std_stl, strict_types_stl}; | ||
use strict_types::typelib::parse_args; | ||
use strict_types::SystemBuilder; | ||
|
||
fn main() { | ||
let (format, dir) = parse_args(); | ||
|
||
rgb::stl::rgb_core_stl() | ||
.serialize( | ||
format, | ||
dir, | ||
"0.1.0", | ||
Some( | ||
" | ||
let rgb = rgb::stl::rgb_core_stl(); | ||
|
||
rgb.serialize( | ||
format, | ||
dir.as_ref(), | ||
"0.1.0", | ||
Some( | ||
" | ||
Description: Consensus layer for RGB smart contracts | ||
Author: Dr Maxim Orlovsky <[email protected]> | ||
Copyright (C) 2023 LNP/BP Standards Association. All rights reserved. | ||
License: Apache-2.0", | ||
), | ||
) | ||
.expect("unable to write to the file"); | ||
), | ||
) | ||
.expect("unable to write to the file"); | ||
|
||
let std = std_stl(); | ||
let tx = bp_tx_stl(); | ||
let bp = bp_core_stl(); | ||
let cv = commit_verify_stl(); | ||
let st = strict_types_stl(); | ||
let vm = aluvm_stl(); | ||
|
||
let sys = SystemBuilder::new() | ||
.import(rgb) | ||
.unwrap() | ||
.import(vm) | ||
.unwrap() | ||
.import(bp) | ||
.unwrap() | ||
.import(tx) | ||
.unwrap() | ||
.import(cv) | ||
.unwrap() | ||
.import(st) | ||
.unwrap() | ||
.import(std) | ||
.unwrap() | ||
.finalize() | ||
.expect("not all libraries present"); | ||
|
||
let dir = dir.unwrap_or_else(|| ".".to_owned()); | ||
|
||
let tt = sys.type_tree("RGB.Transition").unwrap(); | ||
fs::write(format!("{dir}/Transition.vesper",), format!("{tt}")).unwrap(); | ||
|
||
let tt = sys.type_tree("RGB.Schema").unwrap(); | ||
fs::write(format!("{dir}/Schema.vesper",), format!("{tt}")).unwrap(); | ||
|
||
let tt = sys.type_tree("RGB.AnchoredBundle").unwrap(); | ||
fs::write(format!("{dir}/AnchoredBundle.vesper",), format!("{tt}")).unwrap(); | ||
} |
Oops, something went wrong.