Skip to content

Commit 8789d95

Browse files
committed
chore: refactor into workspace. Update Cargo.toml
1 parent 2554c1b commit 8789d95

File tree

11 files changed

+320
-995
lines changed

11 files changed

+320
-995
lines changed

Cargo.lock

+187-984
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+41-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,53 @@
1-
[package]
2-
name = "rgb-std"
3-
version = "0.10.0"
4-
license = "MIT"
1+
[workspace]
2+
members = [
3+
"std",
4+
"."
5+
]
6+
default-members = [
7+
"std",
8+
"."
9+
]
10+
11+
[workspace.package]
512
authors = ["Dr Maxim Orlovsky <[email protected]>"]
6-
description = "RGB: private & scalable client-validated smart contracts on Bitcoin & Lightning"
7-
repository = "https://github.com/RGB-WG/rgb-std"
8-
homepage = "https://rgb.tech"
13+
homepage = "https://github.com/RGB-WG"
14+
repository = "https://github.com/RGB-WG/rgb-wallet"
15+
rust-version = "1.66" # Due to strict encoding library (caused by GAD)
16+
edition = "2021"
17+
license = "Apache-2.0"
18+
19+
[workspace.dependencies]
20+
rgb-core = "0.10.0-beta.1"
21+
22+
[package]
23+
name = "rgb-wallet"
24+
version = "0.10.0-alpha.1"
25+
description = "RGB wallet library for smart contracts on Bitcoin & Lightning network"
926
keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"]
1027
categories = ["cryptography::cryptocurrencies"]
28+
authors = { workspace = true }
29+
repository = { workspace = true }
30+
homepage = { workspace = true }
31+
edition = { workspace = true }
32+
license = { workspace = true }
33+
rust-version = { workspace = true }
1134
readme = "README.md"
12-
edition = "2021"
13-
rust-version = "1.59.0"
14-
exclude = [".github"]
35+
exclude = [".github", "std"]
1536

1637
[lib]
1738
name = "rgb"
1839

1940
[dependencies]
41+
rgb-core = { workspace = true }
42+
rgb-std = { version = "0.10.0-alpha.1", path = "std" }
2043

2144
[features]
2245
default = []
46+
all = ["in-mem"]
47+
in-mem = ["rgb-std/in-mem"]
48+
49+
[package.metadata.docs.rs]
50+
features = [ "all" ]
51+
52+
[patch.crates-io]
53+
rgb-core = { git = "https://github.com/RGB-WG/rgb-core" }

src/lib.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
1+
#![deny(
2+
non_upper_case_globals,
3+
non_camel_case_types,
4+
non_snake_case,
5+
unused_mut,
6+
unused_imports,
7+
dead_code,
8+
missing_docs
9+
)]
10+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

src/psbt.rs

Whitespace-only changes.

std/Cargo.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "rgb-std"
3+
version = "0.10.0-alpha.1"
4+
description = "RGB standard library for working with smart contracts"
5+
keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"]
6+
categories = ["cryptography::cryptocurrencies"]
7+
authors = { workspace = true }
8+
repository = { workspace = true }
9+
homepage = { workspace = true }
10+
edition = { workspace = true }
11+
license = { workspace = true }
12+
rust-version = { workspace = true }
13+
readme = "../README.md"
14+
15+
[lib]
16+
name = "rgb"
17+
18+
[dependencies]
19+
rgb-core = { workspace = true }
20+
21+
[features]
22+
default = []
23+
all = ["in-mem"]
24+
in-mem = []
25+
26+
[package.metadata.docs.rs]
27+
features = [ "all" ]

std/src/containers/consignment.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use rgb::validation::{ContainerApi, HistoryApi};
2+
3+
pub trait ConsignmentApi {}
4+
5+
pub struct Consignment<C: ConsignmentApi>(pub C);
6+
7+
impl<C: ConsignmentApi> ContainerApi for Consignment<C> {}
8+
impl<C: ConsignmentApi> HistoryApi for Consignment<C> {}

std/src/containers/disclosure.rs

Whitespace-only changes.

std/src/containers/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mod consignment;
2+
mod disclosure;
3+
mod stash;

std/src/containers/stash.rs

Whitespace-only changes.

std/src/lib.rs

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#![deny(
2+
non_upper_case_globals,
3+
non_camel_case_types,
4+
non_snake_case,
5+
unused_mut,
6+
unused_imports,
7+
dead_code,
8+
missing_docs
9+
)]
10+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
11+
12+
// CORE LIB:
13+
// issue :: Schema, Metadata, {GlobalState}, {Assignments} -> Genesis
14+
//
15+
// STD LIB:
16+
// import :: Stash, (Schema | Interface) -> Stash
17+
// state :: Inventory, ContractId -> ContractState
18+
// interpret :: ContractState, Interface -> InterpretedState
19+
//
20+
// issue :: Schema, State, Interface -> Consignment -- calls `core::issue` internally
21+
// extract :: Inventory, ContractId, Interface -> Consignment -- used for contract transfer
22+
//
23+
// compose :: Inventory, ContractId, Interface, [Outpoint] -> Consignment -- base for state transfer describing existing state
24+
// transfer :: Consignment, (...) -> StateTransition -- prepares state transition
25+
// preserve :: Stash, [Outpoint], StateTransition -> [StateTransition] -- creates blank state transitions
26+
// consign :: Stash, StateTransition -> Consignment -- extracts history data
27+
//
28+
// reveal :: Consignment, RevealInfo -> Consignment -- removes blinding from known UTXOs
29+
// validate :: Consignment -> (Validity, ContractUpdate)
30+
// enclose :: Inventory, Disclosure -> Inventory !!
31+
// consume :: Inventory, Consignment -> Inventory !! -- for both transfers and contracts
32+
//
33+
// endpoints :: Consignment -> [Outpoint] -- used to construct initial PSBT
34+
35+
// WALLET LIB:
36+
// embed :: Psbt, ContractId -> Psbt -- adds contract information to PSBT
37+
// commit :: Psbt, ContractId, Transition -> Psbt -- adds transition information to the PSBT
38+
// bundle :: Psbt -> Psbt -- takes individual transitions and bundles them together
39+
// finalize :: Psbt -> Psbt -- should be performed by BP; converts individual commitments into tapret
40+
41+
mod containers;
42+
mod state;

std/src/state.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Owned type -> { (NodeId, U16) -> (Outpoint, StateAtom) } -- for each 4 state
2+
// types Global type -> { (Txid, Height) -> [StateAtom] } -- global state

0 commit comments

Comments
 (0)