-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ergoplatform/i10-ergotree-for-p2pk
Draft ErgoTree and needed IR nodes for P2PK script
- Loading branch information
Showing
36 changed files
with
848 additions
and
78 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 |
---|---|---|
|
@@ -3,4 +3,6 @@ members = [ | |
"sigma-chain", | ||
"sigma-chain-c", | ||
"sigma-ser", | ||
"sigma-tree", | ||
"sigma-testutil", | ||
] |
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
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
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
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
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
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
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
This file was deleted.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//! Helper function for testing purposes | ||
/// serialization roundtrip | ||
pub fn sigma_serialize_roundtrip<T: crate::serializer::SigmaSerializable>(v: &T) -> T { | ||
let mut data = Vec::new(); | ||
v.sigma_serialize(&mut data).expect("serialization failed"); | ||
T::sigma_parse(&data[..]).expect("parse failed") | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "sigma-testutil" | ||
version = "0.1.0" | ||
authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"] | ||
edition = "2018" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[dependencies] | ||
sigma-tree = { path = "../sigma-tree" } | ||
|
||
[dependencies.proptest] | ||
# wasm support, via https://altsysrq.github.io/proptest-book/proptest/wasm.html | ||
version = "0.9" | ||
# The default feature set includes things like process forking which are not | ||
# supported in Web Assembly. | ||
default-features = false | ||
# Enable using the `std` crate. | ||
features = ["std"] | ||
|
||
[dev-dependencies] | ||
wasm-bindgen-test = "0.3.10" | ||
proptest-derive = "0.1.2" | ||
|
||
[profile.release] | ||
# Tell `rustc` to optimize for small code size. | ||
opt-level = "s" |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use proptest::{arbitrary::Arbitrary, prelude::*}; | ||
use sigma_tree::ErgoTree; | ||
|
||
#[derive(Debug)] | ||
pub struct ErgoTreeArb(pub ErgoTree); | ||
|
||
impl Arbitrary for ErgoTreeArb { | ||
type Parameters = (); | ||
|
||
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { | ||
(any::<u32>(),) | ||
.prop_map(|_| Self { 0: ErgoTree {} }) | ||
.boxed() | ||
} | ||
type Strategy = BoxedStrategy<Self>; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! test utilities | ||
|
||
// Coding conventions | ||
#![forbid(unsafe_code)] | ||
#![deny(non_upper_case_globals)] | ||
#![deny(non_camel_case_types)] | ||
#![deny(non_snake_case)] | ||
#![deny(unused_mut)] | ||
#![deny(dead_code)] | ||
#![deny(unused_imports)] | ||
#![deny(missing_docs)] | ||
|
||
#[doc(hidden)] | ||
pub mod generator; |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "sigma-tree" | ||
version = "0.1.0" | ||
authors = ["Denys Zadorozhnyi <denys@zadorozhnyi.com>"] | ||
edition = "2018" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[dependencies] | ||
sigma-ser = { path = "../sigma-ser" } | ||
|
||
[dev-dependencies] | ||
wasm-bindgen-test = "0.3.10" | ||
proptest-derive = "0.1.2" | ||
sigma-testutil = { path = "../sigma-testutil"} | ||
|
||
[dev-dependencies.proptest] | ||
# wasm support, via https://altsysrq.github.io/proptest-book/proptest/wasm.html | ||
version = "0.9" | ||
# The default feature set includes things like process forking which are not | ||
# supported in Web Assembly. | ||
default-features = false | ||
# Enable using the `std` crate. | ||
features = ["std"] | ||
|
||
[profile.release] | ||
# Tell `rustc` to optimize for small code size. | ||
opt-level = "s" |
Oops, something went wrong.