Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
b349c729
Commit
b349c729
authored
4 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[ref] dbs:txs_history: use Vec instead of BTreeSet
parent
1511e466
No related branches found
No related tags found
1 merge request
!1335
Gva proto 2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
rust-libs/duniter-dbs-write-ops/src/gva/tx.rs
+4
-4
4 additions, 4 deletions
rust-libs/duniter-dbs-write-ops/src/gva/tx.rs
rust-libs/duniter-dbs/src/gva_v1.rs
+2
-2
2 additions, 2 deletions
rust-libs/duniter-dbs/src/gva_v1.rs
with
6 additions
and
6 deletions
rust-libs/duniter-dbs-write-ops/src/gva/tx.rs
+
4
−
4
View file @
b349c729
...
...
@@ -43,7 +43,7 @@ pub(crate) fn apply_tx<B: Backend>(
// Insert on col `txs_by_issuer`
for
pubkey
in
tx
.issuers
()
{
let
mut
hashs
=
txs_by_issuer
.get
(
&
PubKeyKeyV2
(
pubkey
))
?
.unwrap_or_default
();
hashs
.
insert
(
tx_hash
);
hashs
.
push
(
tx_hash
);
txs_by_issuer
.upsert
(
PubKeyKeyV2
(
pubkey
),
hashs
);
}
// Insert on col `txs_by_recipient`
...
...
@@ -51,7 +51,7 @@ pub(crate) fn apply_tx<B: Backend>(
let
mut
hashs
=
txs_by_recipient
.get
(
&
PubKeyKeyV2
(
pubkey
))
?
.unwrap_or_default
();
hashs
.
insert
(
tx_hash
);
hashs
.
push
(
tx_hash
);
txs_by_recipient
.upsert
(
PubKeyKeyV2
(
pubkey
),
hashs
);
}
...
...
@@ -243,7 +243,7 @@ fn remove_tx<B: Backend>(
// Remove tx hash in col `txs_by_issuer`
for
pubkey
in
tx_db
.tx
.issuers
()
{
let
mut
hashs_
=
txs_by_issuer
.get
(
&
PubKeyKeyV2
(
pubkey
))
?
.unwrap_or_default
();
hashs_
.
remove
(
&
tx_hash
);
hashs_
.
pop
(
);
txs_by_issuer
.upsert
(
PubKeyKeyV2
(
pubkey
),
hashs_
)
}
// Remove tx hash in col `txs_by_recipient`
...
...
@@ -251,7 +251,7 @@ fn remove_tx<B: Backend>(
let
mut
hashs_
=
txs_by_recipient
.get
(
&
PubKeyKeyV2
(
pubkey
))
?
.unwrap_or_default
();
hashs_
.
remove
(
&
tx_hash
);
hashs_
.
pop
(
);
txs_by_recipient
.upsert
(
PubKeyKeyV2
(
pubkey
),
hashs_
)
}
// Remove tx itself
...
...
This diff is collapsed.
Click to expand it.
rust-libs/duniter-dbs/src/gva_v1.rs
+
2
−
2
View file @
b349c729
...
...
@@ -19,8 +19,8 @@ db_schema!(
GvaV1
,
[
[
"txs"
,
Txs
,
HashKeyV2
,
TxDbV2
],
[
"txs_by_issuer"
,
TxsByIssuer
,
PubKeyKeyV2
,
BTreeSet
<
Hash
>
],
[
"txs_by_recipient"
,
TxsByRecipient
,
PubKeyKeyV2
,
BTreeSet
<
Hash
>
],
[
"txs_by_issuer"
,
TxsByIssuer
,
PubKeyKeyV2
,
Vec
<
Hash
>
],
[
"txs_by_recipient"
,
TxsByRecipient
,
PubKeyKeyV2
,
Vec
<
Hash
>
],
[
"scripts_by_pubkey"
,
ScriptsByPubkey
,
...
...
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