diff --git a/Cargo.lock b/Cargo.lock index ceaaeaba9e0318ff5b0cb25806ba784ba3846121..d78e7b9183d86a7568fe9396cffcd20d4aab024c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -864,7 +864,7 @@ dependencies = [ [[package]] name = "dubp-wot" version = "0.11.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "log", "rayon", @@ -874,7 +874,7 @@ dependencies = [ [[package]] name = "duniter-bc-reader" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "anyhow", "dubp", @@ -885,7 +885,7 @@ dependencies = [ [[package]] name = "duniter-bca" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "anyhow", "arrayvec", @@ -908,7 +908,7 @@ dependencies = [ [[package]] name = "duniter-bca-types" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "arrayvec", "bincode", @@ -940,7 +940,7 @@ dependencies = [ [[package]] name = "duniter-conf" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "anyhow", "dubp", @@ -954,7 +954,7 @@ dependencies = [ [[package]] name = "duniter-core" version = "1.8.1" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "duniter-bc-reader", "duniter-conf", @@ -991,7 +991,7 @@ dependencies = [ [[package]] name = "duniter-dbs" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "arrayvec", "bincode", @@ -1014,7 +1014,7 @@ dependencies = [ [[package]] name = "duniter-dbs-write-ops" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "chrono", "dubp", @@ -1029,7 +1029,7 @@ dependencies = [ [[package]] name = "duniter-global" version = "1.8.1" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "async-rwlock", "dubp", @@ -1042,7 +1042,7 @@ dependencies = [ [[package]] name = "duniter-gva" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "anyhow", "arrayvec", @@ -1073,7 +1073,7 @@ dependencies = [ [[package]] name = "duniter-gva-conf" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "anyhow", "duniter-core", @@ -1085,7 +1085,7 @@ dependencies = [ [[package]] name = "duniter-gva-db" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "bincode", "chrono", @@ -1102,7 +1102,7 @@ dependencies = [ [[package]] name = "duniter-gva-dbs-reader" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "anyhow", "arrayvec", @@ -1116,7 +1116,7 @@ dependencies = [ [[package]] name = "duniter-gva-gql" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "anyhow", "arrayvec", @@ -1137,7 +1137,7 @@ dependencies = [ [[package]] name = "duniter-gva-indexer" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#ec2a0ecd8a17d373feeaf8d9253d281de2bd5bae" +source = "git+https://git.duniter.org/nodes/rust/modules/duniter-gva#7fe98256d2775eecaaedf03401f1a0ff9b08a49b" dependencies = [ "anyhow", "dubp", @@ -1152,6 +1152,7 @@ name = "duniter-integration-tests" version = "0.1.0" dependencies = [ "anyhow", + "chrono", "dubp", "duniter-core", "duniter-server", @@ -1166,7 +1167,7 @@ dependencies = [ [[package]] name = "duniter-mempools" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "dubp", "duniter-bc-reader", @@ -1179,7 +1180,7 @@ dependencies = [ [[package]] name = "duniter-module" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "anyhow", "async-mutex", @@ -1810,7 +1811,7 @@ dependencies = [ [[package]] name = "kv_typed" version = "0.1.0" -source = "git+https://git.duniter.org/nodes/rust/duniter-core#df4fa9e073efd91a9acbc7391fec5fc35c5e9872" +source = "git+https://git.duniter.org/nodes/rust/duniter-core#4f26e9e6f687f2c42adf7027bebb34f4ed58e600" dependencies = [ "byteorder", "cfg-if 0.1.10", diff --git a/app/lib/dal/fileDAL.ts b/app/lib/dal/fileDAL.ts index 204cc1b47f9d53905913d4c41be953bdea822b42..83c77b46cb2a30bca8fbaf5501f642c6893a1509 100644 --- a/app/lib/dal/fileDAL.ts +++ b/app/lib/dal/fileDAL.ts @@ -80,6 +80,7 @@ import { LevelDBMindex } from "./indexDAL/leveldb/LevelDBMindex"; import { ConfDAO } from "./indexDAL/abstract/ConfDAO"; import { ServerDAO } from "./server-dao"; import { PeerDTO } from "../dto/PeerDTO"; +import { RustPendingTx } from "../../../neon/native/server"; const readline = require("readline"); const indexer = require("../indexer").Indexer; @@ -853,10 +854,12 @@ export class FileDAL implements ServerDAO { return null; } else { let writtenBlock = tx.writtenBlock ? tx.writtenBlock : null; + let writtenTime = tx.writtenTime ? tx.writtenTime : tx.receivedTime; let dbTx = DBTx.fromTransactionDTO( await this.computeTxBlockstampTime(TransactionDTO.fromJSONObject(tx)) ); dbTx.block_number = writtenBlock; + dbTx.time = writtenTime || 0; return dbTx; } } @@ -1394,7 +1397,10 @@ export class FileDAL implements ServerDAO { } saveTransaction(tx: TransactionDTO) { - return this.rustServer.addPendingTx(tx); + let currentTimestamp = Math.floor(Date.now() / 1000); + return this.rustServer.addPendingTx( + tx.toTransactionDTOV10(currentTimestamp) + ); } async computeTxBlockstampTime(tx: TransactionDTO): Promise<TransactionDTO> { @@ -1416,6 +1422,16 @@ export class FileDAL implements ServerDAO { return db_tx; } + async RustPendingTxToDbTx(tx: RustPendingTx): Promise<DBTx> { + let receivedTime = tx.receivedTime; + let tx_dto = await this.computeTxBlockstampTime( + TransactionDTO.fromJSONObject(tx) + ); + let db_tx = DBTx.fromTransactionDTO(tx_dto); + db_tx.received = receivedTime; + return db_tx; + } + async getTransactionsHistory(pubkey: string) { const history: { sent: DBTx[]; @@ -1436,20 +1452,10 @@ export class FileDAL implements ServerDAO { res.received.map(async (tx) => this.RustDbTxToDbTx(tx)) ); history.sending = await Promise.all( - res.sending.map(async (tx) => { - let tx_dto = await this.computeTxBlockstampTime( - TransactionDTO.fromJSONObject(tx) - ); - return DBTx.fromTransactionDTO(tx_dto); - }) + res.sending.map(async (tx) => this.RustPendingTxToDbTx(tx)) ); history.pending = await Promise.all( - res.pending.map(async (tx) => { - let tx_dto = await this.computeTxBlockstampTime( - TransactionDTO.fromJSONObject(tx) - ); - return DBTx.fromTransactionDTO(tx_dto); - }) + res.pending.map(async (tx) => this.RustPendingTxToDbTx(tx)) ); return history; } diff --git a/app/lib/db/DBTx.ts b/app/lib/db/DBTx.ts index 1f0fd0e64b4e2c173b8d69a2aa8c0082c81fb1cb..66650570cd75ce873d01d9fae24eee7a2f336670 100644 --- a/app/lib/db/DBTx.ts +++ b/app/lib/db/DBTx.ts @@ -9,7 +9,7 @@ export class DBTx { comment: string; blockstamp: string; blockstampTime: number | null; - time: number | null; + time: number; inputs: string[]; unlocks: string[]; outputs: string[]; @@ -21,8 +21,6 @@ export class DBTx { received: number; output_base: number; output_amount: number; - written_on: string; - writtenOn: number; static fromTransactionDTO(tx: TransactionDTO) { const dbTx = new DBTx(); diff --git a/app/lib/dto/TransactionDTO.ts b/app/lib/dto/TransactionDTO.ts index 6cd8bf15a7fbc904f841f7356b28b94f0d974ef7..650d7cc3f9b57855a9eb8125b41e12f4af08ee70 100644 --- a/app/lib/dto/TransactionDTO.ts +++ b/app/lib/dto/TransactionDTO.ts @@ -306,6 +306,25 @@ export class TransactionDTO implements Cloneable { ); } + toTransactionDTOV10(receivedTime: number): TransactionDTOV10 { + return { + currency: this.currency, + locktime: this.locktime, + hash: this.hash, + blockstamp: this.blockstamp, + blockstampTime: this.blockstampTime, + issuers: this.issuers, + inputs: this.inputs, + unlocks: this.unlocks, + outputs: this.outputs, + signatures: this.signatures, + comment: this.comment, + receivedTime: receivedTime, + writtenBlock: undefined, + writtenTime: undefined, + }; + } + static toRAW(json: TransactionDTO, noSig = false) { let raw = ""; raw += "Version: " + json.version + "\n"; diff --git a/app/modules/bma/index.ts b/app/modules/bma/index.ts index fc1e5d3fe9c7242ec4bd0cd92289521f581ac0f6..4fde4d9d0f0dcef7a3b9190f5db3f1ab41071b45 100644 --- a/app/modules/bma/index.ts +++ b/app/modules/bma/index.ts @@ -280,6 +280,8 @@ export class BMAPI extends stream.Transform { if (this.conf.nobma) { this.conf.nobma = false; } + this.server.conf.ipv4 = "127.0.0.1"; + this.server.conf.port = 10901; if (this.server.conf.upnp) { this.server.conf.upnp = false; } diff --git a/app/modules/bma/lib/controllers/transactions.ts b/app/modules/bma/lib/controllers/transactions.ts index d645c73b6841f50de5c058b64e60ff12dcdaf7f9..907450992436f485728841b3a14dd952a1f994b1 100644 --- a/app/modules/bma/lib/controllers/transactions.ts +++ b/app/modules/bma/lib/controllers/transactions.ts @@ -18,6 +18,7 @@ import { TransactionDTO } from "../../../../lib/dto/TransactionDTO"; import { HttpSources, HttpTransaction, + HttpTransactionPending, HttpTxHistory, HttpTxOfHistory, HttpTxPending, @@ -28,7 +29,7 @@ import { Underscore } from "../../../../lib/common-libs/underscore"; const http2raw = require("../http2raw"); export class TransactionBinding extends AbstractController { - async parseTransaction(req: any): Promise<HttpTransaction> { + async parseTransaction(req: any): Promise<HttpTransactionPending> { const res = await this.pushEntity( req, http2raw.transaction, @@ -36,7 +37,6 @@ export class TransactionBinding extends AbstractController { ); return { version: res.version, - currency: res.currency, issuers: res.issuers, inputs: res.inputs, outputs: res.outputs, @@ -45,8 +45,7 @@ export class TransactionBinding extends AbstractController { comment: res.comment, locktime: res.locktime, hash: res.hash, - written_block: res.blockNumber, - raw: res.getRaw(), + receivedTime: Math.floor(Date.now() / 1000), }; } @@ -72,8 +71,6 @@ export class TransactionBinding extends AbstractController { version: tx.version, currency: tx.currency, locktime: tx.locktime, - // blockstamp: tx.blockstamp, - // blockstampTime: tx.blockstampTime, issuers: tx.issuers, inputs: tx.inputs, outputs: tx.outputs, @@ -81,10 +78,8 @@ export class TransactionBinding extends AbstractController { signatures: tx.signatures, comment: tx.comment, hash: tx.hash, - // time: tx.time, - // block_number: tx.block_number, written_block: tx.block_number, - // received: tx.received, + writtenTime: tx.time, raw: "", }; } @@ -155,6 +150,7 @@ export class TransactionBinding extends AbstractController { blockstampTime: tx.blockstampTime, signatures: tx.signatures, hash: tx.hash, + receivedTime: t.receivedTime || 0, }; }), }; @@ -192,8 +188,7 @@ function dbtx2HttpTxOfHistory(tx: DBTx): HttpTxOfHistory { signatures: tx.signatures, comment: tx.comment, hash: tx.hash, - time: tx.time, + time: tx.time || tx.received, block_number: tx.block_number, - received: tx.received, }; } diff --git a/app/modules/bma/lib/dtos.ts b/app/modules/bma/lib/dtos.ts index ded5d97115dca66adc9b2413fcb51d84d3dbe310..cb354c9ad45129c8860979d59361623aba012961 100644 --- a/app/modules/bma/lib/dtos.ts +++ b/app/modules/bma/lib/dtos.ts @@ -776,6 +776,7 @@ export interface HttpTransaction { signatures: string[]; raw: string; written_block: number | null; + writtenTime: number; hash: string; } @@ -789,6 +790,7 @@ export interface HttpTransactionPending { locktime: number; signatures: string[]; hash: string; + receivedTime: number; } export const Source = { @@ -846,11 +848,10 @@ export interface HttpTxOfHistory { outputs: string[]; comment: string; locktime: number; - received: number; signatures: string[]; hash: string; block_number: number | null; - time: number | null; + time: number; blockstamp: string; blockstampTime: number | null; } diff --git a/neon/native/server.d.ts b/neon/native/server.d.ts index a75d2334e450cff1cd796f5ba147fd86161f9132..8e53fd2b907b9d02b5a2bf97d4e0fc2d83a3f824 100644 --- a/neon/native/server.d.ts +++ b/neon/native/server.d.ts @@ -78,10 +78,27 @@ export class RustDbTx { unlocks: string[]; signatures: string[]; comment: string; + receivedTime: number; writtenBlockNumber: number; writtenTime: number; } +export class RustPendingTx { + version: number; + currency: string; + locktime: number; + hash: string; + blockstamp: string; + blockstampTime: number; + issuers: string[]; + inputs: string[]; + outputs: string[]; + unlocks: string[]; + signatures: string[]; + comment: string; + receivedTime: number; +} + export class RustServerConf { command: string | null currency: string @@ -92,8 +109,8 @@ export class RustServerConf { export class TxsHistory { sent: RustDbTx[]; received: RustDbTx[]; - sending: TransactionDTOV10[]; - pending: TransactionDTOV10[]; + sending: RustPendingTx[]; + pending: RustPendingTx[]; } export class RustServer { diff --git a/neon/native/src/server.rs b/neon/native/src/server.rs index 20e5865c270009c98a4783a6d004afef96113bc1..9662c2a90eebe4c60c1e6dd06533c7fe66f7954a 100644 --- a/neon/native/src/server.rs +++ b/neon/native/src/server.rs @@ -219,7 +219,7 @@ declare_types! { }; match res { Ok(txs) => { - let txs: Vec<_> = txs.into_iter().map(|tx| tx.0.to_string_object()).collect(); + let txs: Vec<_> = txs.into_iter().map(|tx| tx.doc.to_string_object()).collect(); Ok(neon_serde::to_value(&mut cx, &txs)?) }, Err(e) => cx.throw_error(format!("{}", e)), @@ -279,8 +279,16 @@ declare_types! { .into_iter() .map(|(tx, wb, wt)| DbTx::v10(tx.to_string_object(), tx.get_hash(), wb.number.0, wt)) .collect(); - let sending: Vec<_> = txs_history.sending.into_iter().map(|tx| tx.to_string_object()).collect(); - let pending: Vec<_> = txs_history.pending.into_iter().map(|tx| tx.to_string_object()).collect(); + let sending: Vec<_> = txs_history + .sending + .into_iter() + .map(|(tx, received_time)| PendingTx::v10( tx.to_string_object(), tx.get_hash(), received_time)) + .collect(); + let pending: Vec<_> = txs_history + .pending + .into_iter() + .map(|(tx, received_time)| PendingTx::v10( tx.to_string_object(), tx.get_hash(), received_time)) + .collect(); Ok(neon_serde::to_value(&mut cx, &TxsHistoryStringified { sent, @@ -430,7 +438,7 @@ impl DbTx { written_block_number: u32, written_time: i64, ) -> Self { - DbTx { + Self { version: 10, currency: tx_doc.currency, blockstamp: tx_doc.blockstamp, @@ -448,6 +456,46 @@ impl DbTx { } } +#[derive(Clone, Debug, Deserialize, Hash, Serialize, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] +pub struct PendingTx { + pub version: u32, + pub currency: String, + pub blockstamp: String, + pub locktime: u64, + pub issuers: Vec<String>, + pub inputs: Vec<String>, + pub unlocks: Vec<String>, + pub outputs: Vec<String>, + pub comment: String, + pub signatures: Vec<String>, + pub hash: String, + pub received_time: i64, +} + +impl PendingTx { + pub fn v10( + tx_doc: TransactionDocumentV10Stringified, + tx_hash: Hash, + received_time: i64, + ) -> Self { + Self { + version: 10, + currency: tx_doc.currency, + blockstamp: tx_doc.blockstamp, + locktime: tx_doc.locktime, + issuers: tx_doc.issuers, + inputs: tx_doc.inputs, + unlocks: tx_doc.unlocks, + outputs: tx_doc.outputs, + comment: tx_doc.comment, + signatures: tx_doc.signatures, + hash: tx_hash.to_hex(), + received_time, + } + } +} + #[allow(clippy::upper_case_acronyms)] #[derive(Deserialize, Serialize)] #[serde(rename_all = "camelCase")] @@ -481,6 +529,6 @@ struct RustServerConfStringified { struct TxsHistoryStringified { sent: Vec<DbTx>, received: Vec<DbTx>, - sending: Vec<TransactionDocumentV10Stringified>, - pending: Vec<TransactionDocumentV10Stringified>, + sending: Vec<PendingTx>, + pending: Vec<PendingTx>, } diff --git a/neon/native/transaction.d.ts b/neon/native/transaction.d.ts index 8135248b6753bd3e964c0346142895ae97eb16ef..e258a6e2cf29e9dbd0f1688b273080fb733c0ea5 100644 --- a/neon/native/transaction.d.ts +++ b/neon/native/transaction.d.ts @@ -12,7 +12,9 @@ export class TransactionDTOV10 { unlocks: string[]; signatures: string[]; comment: string; + receivedTime?: number; writtenBlock?: number; + writtenTime?: number; } export function rawTxParseAndVerify(raw: string, currency?: string): TransactionDTOV10; diff --git a/rust-libs/duniter-server/src/legacy/txs_mempool.rs b/rust-libs/duniter-server/src/legacy/txs_mempool.rs index 7dc898088fe2955b10b065054ee3b8ac5f39b77c..bcb78807b2d76ffae8d292746cc581badd787a48 100644 --- a/rust-libs/duniter-server/src/legacy/txs_mempool.rs +++ b/rust-libs/duniter-server/src/legacy/txs_mempool.rs @@ -53,7 +53,7 @@ impl DuniterServer { for event in events.deref() { match event { duniter_core::dbs::databases::txs_mp_v2::TxsEvent::Upsert { key, value } => { - new_pending_txs.insert(key.0, value.0.clone()); + new_pending_txs.insert(key.0, value.doc.clone()); } duniter_core::dbs::databases::txs_mp_v2::TxsEvent::Remove { key } => { new_pending_txs.remove(&key.0); @@ -73,7 +73,7 @@ impl DuniterServer { .execute(move |dbs| { dbs.txs_mp_db.txs().iter(.., |it| { it.values() - .filter_ok(|tx| tx.0.version() >= min_version) + .filter_ok(|tx| tx.doc.version() >= min_version) .collect() }) }) diff --git a/rust-libs/tests/duniter-integration-tests/Cargo.toml b/rust-libs/tests/duniter-integration-tests/Cargo.toml index a2d59ced2d8f846f39bea52e1949babdf7584368..1d2042ce53c18bc7a28cefa4a483c8ec42d1967e 100644 --- a/rust-libs/tests/duniter-integration-tests/Cargo.toml +++ b/rust-libs/tests/duniter-integration-tests/Cargo.toml @@ -7,6 +7,7 @@ edition = "2018" [dependencies] anyhow = "1.0.34" +chrono = "0.4" dubp = { version = "0.53.1", features = ["duniter"] } duniter-core = { git = "https://git.duniter.org/nodes/rust/duniter-core", features = ["bc-writer"] } duniter-server = { path = "../../duniter-server", features = ["gva"] } diff --git a/rust-libs/tests/duniter-integration-tests/src/lib.rs b/rust-libs/tests/duniter-integration-tests/src/lib.rs index d45f396a1fde50aecd37813e38cf1228900275de..094e25eead7dc01b6a382ca6a718bb845a0798e1 100644 --- a/rust-libs/tests/duniter-integration-tests/src/lib.rs +++ b/rust-libs/tests/duniter-integration-tests/src/lib.rs @@ -59,12 +59,13 @@ mod tests { } .build_with_signature(smallvec![]); + let received_time = chrono::offset::Utc::now().timestamp(); server.add_pending_tx_force(tx.clone())?; let txs_history = server.get_transactions_history(PublicKey::default())?; tx.get_hash(); - assert_eq!(txs_history.sending, vec![tx]); + assert_eq!(txs_history.sending, vec![(tx, received_time)]); server.remove_all_pending_txs()?;