Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
duniter-core
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
Model registry
Monitor
Service Desk
Analyze
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-core
Commits
ce0cb755
Commit
ce0cb755
authored
4 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
feat(dbs): add col currency_params in db BcV2
parent
ef8d2557
No related branches found
No related tags found
No related merge requests found
Pipeline
#12437
passed
4 years ago
Stage: tests
Stage: quality
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
dbs/src/databases/bc_v2.rs
+1
-0
1 addition, 0 deletions
dbs/src/databases/bc_v2.rs
dbs/src/lib.rs
+2
-0
2 additions, 0 deletions
dbs/src/lib.rs
dbs/src/values.rs
+1
-0
1 addition, 0 deletions
dbs/src/values.rs
dbs/src/values/currency_params.rs
+51
-0
51 additions, 0 deletions
dbs/src/values/currency_params.rs
with
55 additions
and
0 deletions
dbs/src/databases/bc_v2.rs
+
1
−
0
View file @
ce0cb755
...
@@ -19,6 +19,7 @@ db_schema!(
...
@@ -19,6 +19,7 @@ db_schema!(
BcV2
,
BcV2
,
[
[
[
"blocks_meta"
,
BlocksMeta
,
U32BE
,
BlockMetaV2
],
[
"blocks_meta"
,
BlocksMeta
,
U32BE
,
BlockMetaV2
],
[
"currency_params"
,
CurrencyParams
,
(),
CurrencyParamsDbV2
],
[
"identities"
,
Identities
,
PubKeyKeyV2
,
IdtyDbV2
],
[
"identities"
,
Identities
,
PubKeyKeyV2
,
IdtyDbV2
],
[
"txs_hashs"
,
TxsHashs
,
HashKeyV2
,
()],
[
"txs_hashs"
,
TxsHashs
,
HashKeyV2
,
()],
[
"uds"
,
Uds
,
UdIdV2
,
()],
[
"uds"
,
Uds
,
UdIdV2
,
()],
...
...
This diff is collapsed.
Click to expand it.
dbs/src/lib.rs
+
2
−
0
View file @
ce0cb755
...
@@ -71,6 +71,7 @@ pub use values::block_head_db::BlockHeadDbV1;
...
@@ -71,6 +71,7 @@ pub use values::block_head_db::BlockHeadDbV1;
pub
use
values
::
block_meta
::
BlockMetaV2
;
pub
use
values
::
block_meta
::
BlockMetaV2
;
pub
use
values
::
block_number_array_db
::
BlockNumberArrayV1
;
pub
use
values
::
block_number_array_db
::
BlockNumberArrayV1
;
pub
use
values
::
cindex_db
::
CIndexDbV1
;
pub
use
values
::
cindex_db
::
CIndexDbV1
;
pub
use
values
::
currency_params
::
CurrencyParamsDbV2
;
pub
use
values
::
dunp_head
::
DunpHeadDbV1
;
pub
use
values
::
dunp_head
::
DunpHeadDbV1
;
pub
use
values
::
idty_db
::
IdtyDbV2
;
pub
use
values
::
idty_db
::
IdtyDbV2
;
pub
use
values
::
iindex_db
::
IIndexDbV1
;
pub
use
values
::
iindex_db
::
IIndexDbV1
;
...
@@ -97,6 +98,7 @@ pub(crate) use dubp::common::crypto::bases::BaseConversionError;
...
@@ -97,6 +98,7 @@ pub(crate) use dubp::common::crypto::bases::BaseConversionError;
pub
(
crate
)
use
dubp
::
common
::
crypto
::
hashs
::
Hash
;
pub
(
crate
)
use
dubp
::
common
::
crypto
::
hashs
::
Hash
;
pub
(
crate
)
use
dubp
::
common
::
crypto
::
keys
::
ed25519
::{
PublicKey
,
Signature
};
pub
(
crate
)
use
dubp
::
common
::
crypto
::
keys
::
ed25519
::{
PublicKey
,
Signature
};
pub
(
crate
)
use
dubp
::
common
::
crypto
::
keys
::{
PublicKey
as
_
,
Signature
as
_
};
pub
(
crate
)
use
dubp
::
common
::
crypto
::
keys
::{
PublicKey
as
_
,
Signature
as
_
};
pub
(
crate
)
use
dubp
::
common
::
currency_params
::
CurrencyParameters
;
pub
(
crate
)
use
dubp
::
common
::
prelude
::
*
;
pub
(
crate
)
use
dubp
::
common
::
prelude
::
*
;
pub
(
crate
)
use
dubp
::
documents
::
dubp_wallet
::
prelude
::
*
;
pub
(
crate
)
use
dubp
::
documents
::
dubp_wallet
::
prelude
::
*
;
pub
(
crate
)
use
kv_typed
::
db_schema
;
pub
(
crate
)
use
kv_typed
::
db_schema
;
...
...
This diff is collapsed.
Click to expand it.
dbs/src/values.rs
+
1
−
0
View file @
ce0cb755
...
@@ -18,6 +18,7 @@ pub mod block_head_db;
...
@@ -18,6 +18,7 @@ pub mod block_head_db;
pub
mod
block_meta
;
pub
mod
block_meta
;
pub
mod
block_number_array_db
;
pub
mod
block_number_array_db
;
pub
mod
cindex_db
;
pub
mod
cindex_db
;
pub
mod
currency_params
;
pub
mod
dunp_head
;
pub
mod
dunp_head
;
pub
mod
idty_db
;
pub
mod
idty_db
;
pub
mod
iindex_db
;
pub
mod
iindex_db
;
...
...
This diff is collapsed.
Click to expand it.
dbs/src/values/currency_params.rs
0 → 100644
+
51
−
0
View file @
ce0cb755
// Copyright (C) 2020 Éloïs SANCHEZ.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use
crate
::
*
;
#[derive(Clone,
Copy,
Debug,
Default,
Deserialize,
PartialEq,
Serialize)]
pub
struct
CurrencyParamsDbV2
(
pub
CurrencyParameters
);
impl
AsBytes
for
CurrencyParamsDbV2
{
fn
as_bytes
<
T
,
F
:
FnMut
(
&
[
u8
])
->
T
>
(
&
self
,
mut
f
:
F
)
->
T
{
f
(
&
bincode_db
()
.serialize
(
&
self
)
.unwrap_or_else
(|
_
|
unreachable!
()))
}
}
impl
kv_typed
::
prelude
::
FromBytes
for
CurrencyParamsDbV2
{
type
Err
=
bincode
::
Error
;
fn
from_bytes
(
bytes
:
&
[
u8
])
->
std
::
result
::
Result
<
Self
,
Self
::
Err
>
{
bincode_db
()
.deserialize
(
bytes
)
}
}
impl
ToDumpString
for
CurrencyParamsDbV2
{
fn
to_dump_string
(
&
self
)
->
String
{
todo!
()
}
}
#[cfg(feature
=
"explorer"
)]
impl
ExplorableValue
for
CurrencyParamsDbV2
{
fn
from_explorer_str
(
source
:
&
str
)
->
Result
<
Self
,
FromExplorerValueErr
>
{
serde_json
::
from_str
(
source
)
.map_err
(|
e
|
FromExplorerValueErr
(
e
.into
()))
}
fn
to_explorer_json
(
&
self
)
->
KvResult
<
serde_json
::
Value
>
{
serde_json
::
to_value
(
&
self
)
.map_err
(|
e
|
KvError
::
DeserError
(
e
.into
()))
}
}
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