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
ink
Commits
14bfc6e2
Commit
14bfc6e2
authored
Nov 19, 2019
by
Andrew Jones
Browse files
TEMPORARY: diagnostic logging
parent
2618fb4a
Pipeline
#69443
failed with stages
in 11 minutes and 10 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
core/src/env2/env_access/mutable.rs
View file @
14bfc6e2
...
...
@@ -333,6 +333,7 @@ where
where
R
:
scale
::
Decode
,
{
self
.println
(
"mutable::get_runtime_storage"
);
T
::
get_runtime_storage
(
&
mut
self
.buffer
,
key
)
}
}
core/src/env2/srml/impls.rs
View file @
14bfc6e2
...
...
@@ -419,10 +419,13 @@ where
I
:
AsMut
<
[
u8
]
>
+
EnlargeTo
,
R
:
scale
::
Decode
,
{
Self
::
println
(
"get_runtime_storage"
);
let
ret
=
ext
::
get_runtime_storage
(
key
);
if
!
ret
.is_success
()
{
Self
::
println
(
"get_runtime_storage: is_success == false"
);
return
Err
(
Error
::
InvalidStorageKey
)
}
Self
::
println
(
"get_runtime_storage: is_success == true"
);
let
req_len
=
ext
::
scratch_size
();
buffer
.enlarge_to
(
req_len
);
let
ret
=
ext
::
scratch_read
(
&
mut
buffer
.as_mut
()[
0
..
req_len
],
0
);
...
...
examples/lang2/runtime-storage/src/lib.rs
View file @
14bfc6e2
...
...
@@ -35,8 +35,10 @@ mod runtime {
/// Returns the account balance, read directly from runtime storage
#[ink(message)]
fn
get_balance
(
&
self
,
account
:
AccountId
)
->
Balance
{
self
.env
()
.println
(
"get_balance"
);
const
BALANCE_OF
:
&
[
u8
]
=
b"balance:"
;
let
key
=
account
.to_keyed_vec
(
BALANCE_OF
);
self
.env
()
.println
(
"constructed key"
);
match
self
.env
()
.get_runtime_storage
::
<
Balance
>
(
&
key
)
{
Ok
(
balance
)
=>
{
self
.env
()
.println
(
"get_runtime_storage: Read balance Ok"
);
...
...
Andrew Jones
@ascjones
mentioned in commit
55a858fa
·
Nov 20, 2019
mentioned in commit
55a858fa
mentioned in commit 55a858fa8d2d070ea69ec11703de1d1b7d9f9057
Toggle commit list
Andrew Jones
@ascjones
mentioned in commit
b7ca7525
·
Nov 21, 2019
mentioned in commit
b7ca7525
mentioned in commit b7ca7525563e576ebef41801174c413d43166dc1
Toggle commit list
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