Skip to content

Commit 984db82

Browse files
committed
Adds MA and Afloat pallets, removes trait Store (deprecaded) and replaces Weight::from_ref_time with (deprecaded) with Weight::from_parts
1 parent 1fdc53d commit 984db82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+17641
-8128
lines changed

Cargo.lock

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

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ members = [
55
'pallets/rbac',
66
'pallets/fruniques',
77
'pallets/gated-marketplace',
8+
'pallets/mapped-assets',
9+
'pallets/afloat',
810
]
911
[profile.release]
1012
panic = 'unwind'

pallets/afloat/Cargo.toml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[package]
2+
name = "pallet-afloat"
3+
version = "4.0.0-dev"
4+
description = ""
5+
authors = ["Hashed <https://github.com/hashed-io"]
6+
homepage = "https://hashed.io"
7+
edition = "2021"
8+
license = "MIT"
9+
publish = false
10+
repository = "https://github.com/hashed-io/hashed-substrate"
11+
12+
[package.metadata.docs.rs]
13+
targets = ["x86_64-unknown-linux-gnu"]
14+
15+
[dependencies]
16+
log = "0.4"
17+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
18+
"derive",
19+
] }
20+
serde = { version = "1.0.140", default-features = false, features = ["derive"] }
21+
scale-info = { version = "2.1.1", default-features = false, features = [
22+
"derive"
23+
] }
24+
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
25+
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
26+
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true }
27+
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
28+
pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
29+
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
30+
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
31+
pallet-fruniques = { path = "../fruniques", default-features = false, version = "0.1.0-dev" }
32+
pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" }
33+
pallet-gated-marketplace = { path = "../gated-marketplace/", default-features = false, version = "4.0.0-dev" }
34+
pallet-mapped-assets = { path = "../mapped-assets/", default-features = false, version = "4.0.0-dev" }
35+
36+
[dev-dependencies]
37+
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
38+
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
39+
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
40+
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
41+
42+
[features]
43+
default = ["std"]
44+
std = [
45+
"codec/std",
46+
"scale-info/std",
47+
"frame-support/std",
48+
"frame-system/std",
49+
"frame-benchmarking/std",
50+
"sp-std/std",
51+
"pallet-balances/std",
52+
"pallet-uniques/std",
53+
"pallet-fruniques/std",
54+
"pallet-timestamp/std",
55+
"pallet-rbac/std",
56+
"pallet-gated-marketplace/std",
57+
]
58+
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
59+
try-runtime = ["frame-support/try-runtime"]

pallets/afloat/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
License: Unlicense
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile><diagram id="2qktoTp6xuHNVyL5OBEX" name="Page-1"><mxGraphModel dx="1171" dy="760" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="3" value="User creates&lt;br&gt;a tax cretid with&lt;br&gt;n editions" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="160" y="140" width="120" height="60" as="geometry"/></mxCell><mxCell id="4" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="5" target="13"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="5" value="user places an&lt;br&gt;sell order for&lt;br&gt;this TC" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="160" y="230" width="120" height="80" as="geometry"/></mxCell><mxCell id="6" style="edgeStyle=none;html=1;exitX=0.5;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="7" target="11"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="7" value="Buyer" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1"><mxGeometry x="80" y="350" width="30" height="60" as="geometry"/></mxCell><mxCell id="8" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="9" target="3"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="9" value="Seller" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1"><mxGeometry x="100" y="140" width="30" height="60" as="geometry"/></mxCell><mxCell id="10" style="edgeStyle=none;html=1;" edge="1" parent="1" source="11" target="13"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="11" value="places a buy offer&lt;br&gt;for a m amount of&lt;br&gt;TC" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="160" y="340" width="120" height="80" as="geometry"/></mxCell><mxCell id="12" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="13" target="15"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="13" value="offer matched" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="310" y="280" width="120" height="60" as="geometry"/></mxCell><mxCell id="14" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.418;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="15" target="17"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="15" value="TC &lt;br&gt;n = 100%&lt;br&gt;n - m&amp;nbsp; = c%" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="480" y="270" width="120" height="80" as="geometry"/></mxCell><mxCell id="16" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.889;entryY=0.155;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="17" target="5"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="610" y="240"/></Array></mxGeometry></mxCell><mxCell id="17" value="if offer passes&lt;br&gt;a new TC spawns with the c% of the father" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="490" y="410" width="120" height="60" as="geometry"/></mxCell><mxCell id="18" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="19" target="20"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="19" value="User creates&lt;br&gt;a tax cretid with&lt;br&gt;n editions" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="150" y="510" width="120" height="60" as="geometry"/></mxCell><mxCell id="20" value="user places an&lt;br&gt;sell order for&lt;br&gt;this TC" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="150" y="600" width="120" height="80" as="geometry"/></mxCell><mxCell id="21" style="edgeStyle=none;html=1;exitX=0.5;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.549;entryY=1.009;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="22" target="20"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="750" as="targetPoint"/></mxGeometry></mxCell><mxCell id="22" value="Buyer" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1"><mxGeometry x="70" y="720" width="30" height="60" as="geometry"/></mxCell><mxCell id="23" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="24" target="19"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="24" value="Seller" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1"><mxGeometry x="90" y="510" width="30" height="60" as="geometry"/></mxCell><mxCell id="25" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="20" target="27"><mxGeometry relative="1" as="geometry"><mxPoint x="420" y="680" as="sourcePoint"/></mxGeometry></mxCell><mxCell id="26" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.418;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="27" target="28"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="27" value="TC &lt;br&gt;n = 100%" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="330" y="600" width="120" height="80" as="geometry"/></mxCell><mxCell id="28" value="if offer passes&lt;br&gt;a new TC is trasfered to the buyer" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"><mxGeometry x="340" y="740" width="120" height="60" as="geometry"/></mxCell><mxCell id="29" value="Takes the sell order" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"><mxGeometry x="160" y="710" width="60" height="30" as="geometry"/></mxCell><mxCell id="30" value="Updates TC to n = n - m" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1"><mxGeometry x="360" y="210" width="150" height="30" as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile>

pallets/afloat/src/benchmarking.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//! Benchmarking setup for pallet-template
2+
3+
use super::*;
4+
5+
#[allow(unused)]
6+
use crate::Pallet as Template;
7+
use frame_benchmarking::{benchmarks, whitelisted_caller};
8+
use frame_system::RawOrigin;
9+
10+
benchmarks! {
11+
do_something {
12+
let s in 0 .. 100;
13+
let caller: T::AccountId = whitelisted_caller();
14+
}: _(RawOrigin::Signed(caller), s)
15+
verify {
16+
assert_eq!(Something::<T>::get(), Some(s));
17+
}
18+
19+
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
20+
}

0 commit comments

Comments
 (0)