Skip to content

Commit

Permalink
stl: finalize Vesper support
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Feb 3, 2024
1 parent 793f50c commit 17f1d3c
Show file tree
Hide file tree
Showing 8 changed files with 1,355 additions and 582 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 55 additions & 10 deletions src/bin/rgbcore-stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
"

Check warning on line 43 in src/bin/rgbcore-stl.rs

View check run for this annotation

Codecov / codecov/patch

src/bin/rgbcore-stl.rs#L36-L43

Added lines #L36 - L43 were not covered by tests
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();

Check warning on line 86 in src/bin/rgbcore-stl.rs

View check run for this annotation

Codecov / codecov/patch

src/bin/rgbcore-stl.rs#L48-L86

Added lines #L48 - L86 were not covered by tests
}
Loading

0 comments on commit 17f1d3c

Please sign in to comment.