Commit b9e073a1 authored by Éloïs's avatar Éloïs
Browse files

[ref] gva:bca: move bincode_opts in duniter_bca_types

parent c75feffb
......@@ -1163,9 +1163,9 @@ dependencies = [
name = "duniter-bca-types"
version = "0.1.0"
dependencies = [
"bincode",
"dubp",
"serde",
"smallvec",
]
[[package]]
......
......@@ -33,7 +33,9 @@ use crate::utils::AsyncReader;
use async_bincode::AsyncBincodeReader;
use bincode::Options as _;
use dubp::crypto::keys::{ed25519::Ed25519KeyPair, Signator};
use duniter_bca_types::{BcaReq, BcaReqTypeV0, BcaResp, BcaRespTypeV0, BcaRespV0, ReqExecError};
use duniter_bca_types::{
bincode_opts, BcaReq, BcaReqTypeV0, BcaResp, BcaRespTypeV0, BcaRespV0, ReqExecError,
};
use duniter_dbs::{FileBackend, SharedDbs};
use futures::{prelude::stream::FuturesUnordered, StreamExt, TryStream, TryStreamExt};
use once_cell::sync::OnceCell;
......@@ -201,12 +203,6 @@ impl BcaExecutor {
}
}
pub(crate) fn bincode_opts() -> impl bincode::Options {
bincode::options()
.with_limit(u32::max_value() as u64)
.allow_trailing_bytes()
}
#[cfg(test)]
mod tests {
use super::*;
......
......@@ -6,9 +6,9 @@ license = "AGPL-3.0"
edition = "2018"
[dependencies]
bincode = "1.3"
dubp = { version = "0.49.0" }
serde = { version = "1.0.105", features = ["derive"] }
smallvec = { version = "1.4.0", features = ["serde"] }
[features]
default = ["duniter"]
......
......@@ -25,11 +25,18 @@
pub mod prepare_payment;
use crate::prepare_payment::{PrepareSimplePayment, PrepareSimplePaymentResp};
use bincode::Options as _;
use dubp::crypto::hashs::Hash;
use dubp::crypto::keys::ed25519::{PublicKey, Signature};
use dubp::wallet::prelude::*;
use serde::{Deserialize, Serialize};
//use smallvec::SmallVec;
pub fn bincode_opts() -> impl bincode::Options {
bincode::options()
.with_limit(u32::max_value() as u64)
.allow_trailing_bytes()
}
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub enum BcaReq {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment