Skip to content

Commit ddbb7a2

Browse files
committed
Merge branch 'release/0.2.2'
2 parents ca276c1 + fa9986f commit ddbb7a2

File tree

19 files changed

+265
-16
lines changed

19 files changed

+265
-16
lines changed

.vscode/launch.json

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "lldb",
9+
"request": "launch",
10+
"name": "Debug executable 'mathchain'",
11+
"cargo": {
12+
"args": [
13+
"build",
14+
"--bin=mathchain",
15+
"--package=mathchain"
16+
],
17+
"filter": {
18+
"name": "mathchain",
19+
"kind": "bin"
20+
}
21+
},
22+
"args": ["--dev", "--ws-external", "--rpc-external"],
23+
"cwd": "${workspaceFolder}"
24+
},
25+
{
26+
"type": "lldb",
27+
"request": "launch",
28+
"name": "Debug unit tests in executable 'mathchain'",
29+
"cargo": {
30+
"args": [
31+
"test",
32+
"--no-run",
33+
"--bin=mathchain",
34+
"--package=mathchain"
35+
],
36+
"filter": {
37+
"name": "mathchain",
38+
"kind": "bin"
39+
}
40+
},
41+
"args": [],
42+
"cwd": "${workspaceFolder}"
43+
},
44+
{
45+
"type": "lldb",
46+
"request": "launch",
47+
"name": "Debug unit tests in library 'mathchain-runtime-galois'",
48+
"cargo": {
49+
"args": [
50+
"test",
51+
"--no-run",
52+
"--lib",
53+
"--package=mathchain-runtime-galois"
54+
],
55+
"filter": {
56+
"name": "mathchain-runtime-galois",
57+
"kind": "lib"
58+
}
59+
},
60+
"args": [],
61+
"cwd": "${workspaceFolder}"
62+
},
63+
{
64+
"type": "lldb",
65+
"request": "launch",
66+
"name": "Debug unit tests in library 'mathchain-consensus'",
67+
"cargo": {
68+
"args": [
69+
"test",
70+
"--no-run",
71+
"--lib",
72+
"--package=mathchain-consensus"
73+
],
74+
"filter": {
75+
"name": "mathchain-consensus",
76+
"kind": "lib"
77+
}
78+
},
79+
"args": [],
80+
"cwd": "${workspaceFolder}"
81+
},
82+
{
83+
"type": "lldb",
84+
"request": "launch",
85+
"name": "Debug unit tests in library 'mathchain-consensus-primitives'",
86+
"cargo": {
87+
"args": [
88+
"test",
89+
"--no-run",
90+
"--lib",
91+
"--package=mathchain-consensus-primitives"
92+
],
93+
"filter": {
94+
"name": "mathchain-consensus-primitives",
95+
"kind": "lib"
96+
}
97+
},
98+
"args": [],
99+
"cwd": "${workspaceFolder}"
100+
},
101+
{
102+
"type": "lldb",
103+
"request": "launch",
104+
"name": "Debug unit tests in library 'mathchain-runtime'",
105+
"cargo": {
106+
"args": [
107+
"test",
108+
"--no-run",
109+
"--lib",
110+
"--package=mathchain-runtime"
111+
],
112+
"filter": {
113+
"name": "mathchain-runtime",
114+
"kind": "lib"
115+
}
116+
},
117+
"args": [],
118+
"cwd": "${workspaceFolder}"
119+
},
120+
{
121+
"type": "lldb",
122+
"request": "launch",
123+
"name": "Debug unit tests in library 'mathchain-runtime-mathchain'",
124+
"cargo": {
125+
"args": [
126+
"test",
127+
"--no-run",
128+
"--lib",
129+
"--package=mathchain-runtime-mathchain"
130+
],
131+
"filter": {
132+
"name": "mathchain-runtime-mathchain",
133+
"kind": "lib"
134+
}
135+
},
136+
"args": [],
137+
"cwd": "${workspaceFolder}"
138+
}
139+
]
140+
}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ cargo build --release --target x86_64-apple-darwin #&> /dev/null
3434
echo -e "\e[1;32m🧬 Building mathchain-$1-x86_64-linux-gnu-glibc-2.17-llvm-3.8 \e[0m"
3535
cross build --release --target x86_64-unknown-linux-gnu --sub-targets wasm32-unknown-unknown #&> /dev/null
3636

37-
echo -e "\e[1;32m🧬 Building mathchain-$1-aarch64-linux-gnu-glibc-2.23-llvm-3.8 \e[0m"
38-
RUSTFLAGS='-C link-args=-latomic' SKIP_WASM_BUILD=1 cross build --locked --release --target aarch64-unknown-linux-gnu #&> /dev/null
37+
# echo -e "\e[1;32m🧬 Building mathchain-$1-aarch64-linux-gnu-glibc-2.23-llvm-3.8 \e[0m"
38+
# RUSTFLAGS='-C link-args=-latomic' SKIP_WASM_BUILD=1 cross build --locked --release --target aarch64-unknown-linux-gnu #&> /dev/null
3939

4040
echo -e '\e[1;32m📦 Packing WASM(s)\e[0m'
4141
rm -rf wasm
@@ -54,9 +54,9 @@ rm mathchain
5454
cp ../target/x86_64-unknown-linux-gnu/release/mathchain .
5555
tar cjSf mathchain-$1-x86_64-linux-gnu-glibc-2.17-llvm-3.8.tar.bz2 mathchain
5656
rm mathchain
57-
cp ../target/x86_64-unknown-linux-gnu/release/mathchain .
58-
tar cjSf mathchain-$1-aarch64-linux-gnu-glibc-2.23-llvm-3.8.tar.bz2 mathchain
59-
rm mathchain
57+
# cp ../target/x86_64-unknown-linux-gnu/release/mathchain .
58+
# tar cjSf mathchain-$1-aarch64-linux-gnu-glibc-2.23-llvm-3.8.tar.bz2 mathchain
59+
# rm mathchain
6060

6161
echo -e '\e[1;32m🔑 Generating File(s) Hash\e[0m'
6262
for f in *

consensus/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use sc_client_api::{BlockOf, backend::AuxStore};
2828
use sp_blockchain::{HeaderBackend, ProvideCache, well_known_cache_keys::Id as CacheKeyId};
2929
use sp_block_builder::BlockBuilder as BlockBuilderApi;
3030
use sp_runtime::generic::OpaqueDigestItemId;
31-
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
31+
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, SaturatedConversion};
3232
use sp_api::ProvideRuntimeApi;
3333
use sp_consensus::{
3434
BlockImportParams, Error as ConsensusError, BlockImport,
@@ -60,7 +60,7 @@ impl std::convert::From<Error> for ConsensusError {
6060
pub struct MathchainBlockImport<B: BlockT, I, C> {
6161
inner: I,
6262
client: Arc<C>,
63-
enabled: bool,
63+
is_galois: bool,
6464
_marker: PhantomData<B>,
6565
}
6666

@@ -69,7 +69,7 @@ impl<Block: BlockT, I: Clone + BlockImport<Block>, C> Clone for MathchainBlockIm
6969
MathchainBlockImport {
7070
inner: self.inner.clone(),
7171
client: self.client.clone(),
72-
enabled: self.enabled,
72+
is_galois: self.is_galois,
7373
_marker: PhantomData,
7474
}
7575
}
@@ -85,12 +85,12 @@ impl<B, I, C> MathchainBlockImport<B, I, C> where
8585
pub fn new(
8686
inner: I,
8787
client: Arc<C>,
88-
enabled: bool,
88+
is_galois: bool,
8989
) -> Self {
9090
Self {
9191
inner,
9292
client,
93-
enabled,
93+
is_galois,
9494
_marker: PhantomData,
9595
}
9696
}
@@ -128,7 +128,8 @@ impl<B, I, C> BlockImport<B> for MathchainBlockImport<B, I, C> where
128128

129129
let client = self.client.clone();
130130

131-
if self.enabled {
131+
// support testnet aura block import
132+
if !!!(self.is_galois && block.header.number().clone().saturated_into::<u64>() < 1_252_434) {
132133
let log = find_mathchain_log::<B>(&block.header)?;
133134
let hash = block.post_hash();
134135

docs/.nojekyll

Whitespace-only changes.

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Welcome
2+
欢迎

docs/_sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [English](en/README.md)
2+
- [中文](zh-CN/README.md)

docs/en/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EN

docs/en/_sidebar.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Getting started
2+
3+
- [Quick start](en/a.md)

docs/en/a.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
3+
4+
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
5+
6+
Jekyll also offers powerful support for code snippets:
7+
8+
{% highlight ruby %}
9+
def print_hi(name)
10+
puts "Hi, #{name}"
11+
end
12+
print_hi('Tom')
13+
#=> prints 'Hi, Tom' to STDOUT.
14+
{% endhighlight %}
15+
16+
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
17+
18+
[jekyll-docs]: https://jekyllrb.com/docs/home
19+
[jekyll-gh]: https://github.com/jekyll/jekyll
20+
[jekyll-talk]: https://talk.jekyllrb.com/

0 commit comments

Comments
 (0)