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
9d95121e
Commit
9d95121e
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
WIP start fixing conflicts
parent
b8960000
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
distance-oracle/src/api.rs
+6
-16
6 additions, 16 deletions
distance-oracle/src/api.rs
distance-oracle/src/lib.rs
+5
-7
5 additions, 7 deletions
distance-oracle/src/lib.rs
resources/metadata.scale
+0
-0
0 additions, 0 deletions
resources/metadata.scale
with
11 additions
and
23 deletions
distance-oracle/src/api.rs
+
6
−
16
View file @
9d95121e
...
...
@@ -17,12 +17,10 @@
use
crate
::{
runtime
,
runtime
::
runtime_types
::{
pallet_distance
::
median
::
MedianAcc
,
sp_arithmetic
::
per_things
::
Perbill
,
sp_core
::
bounded
::{
bounded_btree_set
::
BoundedBTreeSet
,
bounded_vec
::
BoundedVec
},
pallet_distance
::
median
::
MedianAcc
,
sp_arithmetic
::
per_things
::
Perbill
,
},
};
use
sp_core
::
bounded
::{
bounded_btree_set
::
BoundedBTreeSet
,
bounded_vec
::
BoundedVec
};
use
sp_core
::
H256
;
use
subxt
::
storage
::
StorageKey
;
...
...
@@ -30,8 +28,8 @@ pub type Client = subxt::OnlineClient<crate::RuntimeConfig>;
pub
type
AccountId
=
subxt
::
ext
::
sp_runtime
::
AccountId32
;
pub
type
IdtyIndex
=
u32
;
pub
type
EvaluationPool
<
AccountId
,
IdtyIndex
>
=
(
BoundedVec
<
(
IdtyIndex
,
MedianAcc
<
Perbill
>
)
>
,
BoundedBTreeSet
<
AccountId
>
,
BoundedVec
<
(
IdtyIndex
,
MedianAcc
<
Perbill
>
),
u32
>
,
// FIXME is u32 still the good type?
BoundedBTreeSet
<
AccountId
,
u32
>
,
// FIXME idem
);
pub
async
fn
client
(
rpc_url
:
String
)
->
Client
{
...
...
@@ -111,10 +109,8 @@ pub struct MemberIter(
subxt
::
storage
::
KeyIter
<
crate
::
RuntimeConfig
,
Client
,
subxt
::
metadata
::
DecodeStaticType
<
runtime
::
runtime_types
::
sp_membership
::
MembershipData
<
u32
>
,
>
,
>
,
);
impl
MemberIter
{
...
...
@@ -141,13 +137,7 @@ pub async fn cert_iter(client: &Client, evaluation_block: H256) -> CertIter {
)
}
pub
struct
CertIter
(
subxt
::
storage
::
KeyIter
<
crate
::
RuntimeConfig
,
Client
,
subxt
::
metadata
::
DecodeStaticType
<
Vec
<
(
IdtyIndex
,
u32
)
>>
,
>
,
);
pub
struct
CertIter
(
subxt
::
storage
::
KeyIter
<
crate
::
RuntimeConfig
,
Client
,
Vec
<
(
IdtyIndex
,
u32
)
>>
);
impl
CertIter
{
pub
async
fn
next
(
...
...
This diff is collapsed.
Click to expand it.
distance-oracle/src/lib.rs
+
5
−
7
View file @
9d95121e
...
...
@@ -41,17 +41,15 @@ pub mod runtime {}
pub
enum
RuntimeConfig
{}
impl
subxt
::
config
::
Config
for
RuntimeConfig
{
type
Index
=
u32
;
type
BlockNumber
=
u32
;
//
type BlockNumber = u32;
type
Hash
=
sp_core
::
H256
;
type
Hash
ing
=
subxt
::
ext
::
sp_runtime
::
traits
::
BlakeTwo256
;
type
Hash
er
=
subxt
::
config
::
substrate
::
BlakeTwo256
;
type
AccountId
=
AccountId
;
type
Address
=
subxt
::
ext
::
sp_runtime
::
MultiAddress
<
Self
::
AccountId
,
u32
>
;
type
Header
=
subxt
::
ext
::
sp_runtime
::
generic
::
Header
<
Self
::
BlockNumber
,
subxt
::
ext
::
sp_runtime
::
traits
::
BlakeTwo256
,
>
;
type
Header
=
subxt
::
config
::
substrate
::
SubstrateHeader
<
u32
,
subxt
::
config
::
substrate
::
BlakeTwo256
>
;
type
Signature
=
subxt
::
ext
::
sp_runtime
::
MultiSignature
;
type
ExtrinsicParams
=
subxt
::
tx
::
BaseExtrinsicParams
<
Self
,
Tip
>
;
type
ExtrinsicParams
=
subxt
::
config
::
extrinsic_params
::
BaseExtrinsicParams
<
Self
,
Tip
>
;
}
#[derive(Copy,
Clone,
Debug,
Default,
Encode)]
...
...
This diff is collapsed.
Click to expand it.
resources/metadata.scale
+
0
−
0
View file @
9d95121e
No preview for this file type
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