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
9d8c2e3f
Commit
9d8c2e3f
authored
3 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
feat(smith-membership):metadata: replace peer id by p2p endpoint
parent
053902ba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
runtime/common/src/entities.rs
+37
-2
37 additions, 2 deletions
runtime/common/src/entities.rs
runtime/common/src/lib.rs
+0
-35
0 additions, 35 deletions
runtime/common/src/lib.rs
with
37 additions
and
37 deletions
runtime/common/src/entities.rs
+
37
−
2
View file @
9d8c2e3f
...
...
@@ -21,10 +21,45 @@ use scale_info::TypeInfo;
#[cfg(feature
=
"std"
)]
use
serde
::{
Deserialize
,
Serialize
};
#[macro_export]
macro_rules!
declare_session_keys
{
{}
=>
{
pub
mod
opaque
{
use
super
::
*
;
impl_opaque_keys!
{
pub
struct
SessionKeys
{
pub
grandpa
:
Grandpa
,
pub
babe
:
Babe
,
pub
im_online
:
ImOnline
,
pub
authority_discovery
:
AuthorityDiscovery
,
}
}
#[derive(Clone,
codec::Decode,
Debug,
codec::Encode,
Eq,
PartialEq)]
pub
struct
SessionKeysWrapper
(
pub
SessionKeys
);
impl
From
<
SessionKeysWrapper
>
for
SessionKeys
{
fn
from
(
keys_wrapper
:
SessionKeysWrapper
)
->
SessionKeys
{
keys_wrapper
.0
}
}
impl
scale_info
::
TypeInfo
for
SessionKeysWrapper
{
type
Identity
=
[
u8
;
128
];
fn
type_info
()
->
scale_info
::
Type
{
Self
::
Identity
::
type_info
()
}
}
}
}
}
#[cfg_attr(feature
=
"std"
,
derive(Deserialize,
Serialize))]
#[derive(Clone,
Encode,
Decode,
Default,
Eq,
PartialEq,
RuntimeDebug,
TypeInfo)]
#[derive(Clone,
Encode,
Decode,
Eq,
PartialEq,
RuntimeDebug,
TypeInfo)]
pub
struct
SmithsMembershipMetaData
<
SessionKeysWrapper
>
{
pub
p
eer_id
:
[
u8
;
32
]
,
pub
p
2p_endpoint
:
sp_runtime
::
RuntimeString
,
pub
session_keys
:
SessionKeysWrapper
,
}
...
...
This diff is collapsed.
Click to expand it.
runtime/common/src/lib.rs
+
0
−
35
View file @
9d8c2e3f
...
...
@@ -88,38 +88,3 @@ impl<
.map
(|
idty_value
|
idty_value
.owner_key
)
}
}
#[macro_export]
macro_rules!
declare_session_keys
{
{}
=>
{
pub
mod
opaque
{
use
super
::
*
;
impl_opaque_keys!
{
pub
struct
SessionKeys
{
pub
grandpa
:
Grandpa
,
pub
babe
:
Babe
,
pub
im_online
:
ImOnline
,
pub
authority_discovery
:
AuthorityDiscovery
,
}
}
#[derive(Clone,
codec::Decode,
Debug,
codec::Encode,
Eq,
PartialEq)]
pub
struct
SessionKeysWrapper
(
pub
SessionKeys
);
impl
From
<
SessionKeysWrapper
>
for
SessionKeys
{
fn
from
(
keys_wrapper
:
SessionKeysWrapper
)
->
SessionKeys
{
keys_wrapper
.0
}
}
impl
scale_info
::
TypeInfo
for
SessionKeysWrapper
{
type
Identity
=
[
u8
;
128
];
fn
type_info
()
->
scale_info
::
Type
{
Self
::
Identity
::
type_info
()
}
}
}
}
}
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