Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
e17e5b31
Unverified
Commit
e17e5b31
authored
Aug 17, 2018
by
Arkadiy Paronyan
Browse files
Paranoid mode
parent
e6fe8379
Changes
4
Hide whitespace changes
Inline
Side-by-side
Cargo.lock
View file @
e17e5b31
...
...
@@ -1705,6 +1705,7 @@ name = "polkadot-api"
version = "0.1.0"
dependencies = [
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"polkadot-executor 0.1.0",
"polkadot-primitives 0.1.0",
"polkadot-runtime 0.1.0",
...
...
api/Cargo.toml
View file @
e17e5b31
...
...
@@ -5,6 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
error-chain
=
"0.12"
log
=
"0.3"
polkadot-executor
=
{
path
=
"../executor"
}
polkadot-runtime
=
{
path
=
"../runtime"
}
polkadot-primitives
=
{
path
=
"../primitives"
}
...
...
api/src/full.rs
View file @
e17e5b31
...
...
@@ -22,7 +22,7 @@ use client::{self, Client, LocalCallExecutor, CallExecutor};
use
codec
::{
Encode
,
Decode
};
use
polkadot_executor
::
Executor
as
LocalDispatch
;
use
substrate_executor
::
NativeExecutor
;
use
state_machine
;
use
state_machine
::
ExecutionManager
;
use
runtime
::
Address
;
use
primitives
::{
...
...
@@ -50,19 +50,26 @@ where
};
client
.state_at
(
&
parent
)
.map_err
(
Error
::
from
)
.and_then
(|
state
|
{
let
mut
overlay
=
Default
::
default
();
let
execution_manager
=
||
ExecutionManager
::
Both
(|
wasm_result
,
native_result
|
{
warn!
(
"Consensus error between wasm and native runtime execution at block {:?}"
,
at
);
warn!
(
" Method {:?}"
,
method
);
warn!
(
" Native result {:?}"
,
native_result
);
warn!
(
" Wasm result {:?}"
,
wasm_result
);
wasm_result
});
client
.executor
()
.call_at_state
(
&
state
,
&
mut
overlay
,
"initialise_block"
,
&
header
.encode
(),
state_machine
::
native_when_possible
()
execution_manager
()
)
?
;
let
(
r
,
_
)
=
client
.executor
()
.call_at_state
(
&
state
,
&
mut
overlay
,
method
,
input
,
state_machine
::
native_when_possible
()
execution_manager
()
)
?
;
Ok
(
R
::
decode
(
&
mut
&
r
[
..
])
.ok_or_else
(||
client
::
error
::
Error
::
from
(
client
::
error
::
ErrorKind
::
CallResultDecode
(
method
)))
?
)
...
...
api/src/lib.rs
View file @
e17e5b31
...
...
@@ -32,6 +32,9 @@ extern crate substrate_state_machine as state_machine;
#[macro_use]
extern
crate
error_chain
;
#[macro_use]
extern
crate
log
;
#[cfg(test)]
extern
crate
substrate_keyring
as
keyring
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment