From b349c7296b2dbdff150b6b4e57f1f115e2407043 Mon Sep 17 00:00:00 2001
From: librelois <c@elo.tf>
Date: Wed, 25 Nov 2020 17:57:05 +0100
Subject: [PATCH] [ref] dbs:txs_history: use Vec instead of BTreeSet

---
 rust-libs/duniter-dbs-write-ops/src/gva/tx.rs | 8 ++++----
 rust-libs/duniter-dbs/src/gva_v1.rs           | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs b/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs
index d4ef23ae9..94ab275e1 100644
--- a/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs
+++ b/rust-libs/duniter-dbs-write-ops/src/gva/tx.rs
@@ -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
diff --git a/rust-libs/duniter-dbs/src/gva_v1.rs b/rust-libs/duniter-dbs/src/gva_v1.rs
index e1a0e85f2..66c14eb06 100644
--- a/rust-libs/duniter-dbs/src/gva_v1.rs
+++ b/rust-libs/duniter-dbs/src/gva_v1.rs
@@ -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,
-- 
GitLab