Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
4ff38677
Commit
4ff38677
authored
1 year ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
fix(
#214
): also allow this feature for gtest and g1
parent
a086d74a
No related branches found
No related tags found
1 merge request
!255
Resolve "Allow native Runtime execution"
Pipeline
#36459
passed
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
node/src/service.rs
+28
-0
28 additions, 0 deletions
node/src/service.rs
with
28 additions
and
0 deletions
node/src/service.rs
+
28
−
0
View file @
4ff38677
...
...
@@ -89,7 +89,9 @@ pub mod gdev_executor {
#[allow(dead_code)]
#[cfg(feature
=
"g1"
)]
pub
mod
g1_executor
{
use
crate
::
service
::
HostFunctions
;
pub
use
g1_runtime
;
use
sc_executor
::
sp_wasm_interface
::{
Function
,
HostFunctionRegistry
};
pub
struct
G1Executor
;
impl
sc_executor
::
NativeExecutionDispatch
for
G1Executor
{
...
...
@@ -103,12 +105,26 @@ pub mod g1_executor {
g1_runtime
::
native_version
()
}
}
impl
sc_executor
::
sp_wasm_interface
::
HostFunctions
for
G1Executor
{
fn
host_functions
()
->
Vec
<&
'static
dyn
Function
>
{
HostFunctions
::
host_functions
()
}
fn
register_static
<
T
>
(
registry
:
&
mut
T
)
->
Result
<
(),
T
::
Error
>
where
T
:
HostFunctionRegistry
,
{
HostFunctions
::
register_static
(
registry
)
}
}
}
#[allow(dead_code)]
#[cfg(feature
=
"gtest"
)]
pub
mod
gtest_executor
{
use
crate
::
service
::
HostFunctions
;
pub
use
gtest_runtime
;
use
sc_executor
::
sp_wasm_interface
::{
Function
,
HostFunctionRegistry
};
pub
struct
GTestExecutor
;
impl
sc_executor
::
NativeExecutionDispatch
for
GTestExecutor
{
...
...
@@ -122,6 +138,18 @@ pub mod gtest_executor {
gtest_runtime
::
native_version
()
}
}
impl
sc_executor
::
sp_wasm_interface
::
HostFunctions
for
GTestExecutor
{
fn
host_functions
()
->
Vec
<&
'static
dyn
Function
>
{
HostFunctions
::
host_functions
()
}
fn
register_static
<
T
>
(
registry
:
&
mut
T
)
->
Result
<
(),
T
::
Error
>
where
T
:
HostFunctionRegistry
,
{
HostFunctions
::
register_static
(
registry
)
}
}
}
///
/// The minimum period of blocks on which justifications will be
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment