[INFO] cloning repository https://github.com/Krypt1n/krypton
[INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Krypt1n/krypton" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKrypt1n%2Fkrypton", kill_on_drop: false }`
[INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKrypt1n%2Fkrypton'...
[INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }`
[INFO] [stdout] f37608ce9e3399b5fdb51c573f2b0148b2c3ccd3
[INFO] linting Krypt1n/krypton against nightly for clippy-nonminimal_bool-denied
[INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKrypt1n%2Fkrypton" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }`
[INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'...
[INFO] [stderr] done.
[INFO] started tweaking git repo https://github.com/Krypt1n/krypton
[INFO] finished tweaking git repo https://github.com/Krypt1n/krypton
[INFO] tweaked toml for git repo https://github.com/Krypt1n/krypton written to /workspace/builds/worker-1-tc1/source/Cargo.toml
[INFO] validating manifest of git repo https://github.com/Krypt1n/krypton on toolchain nightly
[INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }`
[INFO] crate git repo https://github.com/Krypt1n/krypton already has a lockfile, it will not be regenerated
[INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }`
[INFO] [stderr] Updating crates.io index
[INFO] [stderr] Downloading crates ...
[INFO] [stderr] Downloaded base64ct v1.8.1
[INFO] [stderr] Downloaded doc-comment v0.3.4
[INFO] [stderr] Downloaded built v0.6.1
[INFO] [stderr] Downloaded phantom-type v0.4.2
[INFO] [stderr] Downloaded cargo-lock v9.0.0
[INFO] [stderr] Downloaded pubnub v0.7.0
[INFO] [stderr] Downloaded ed25519-dalek v2.2.0
[INFO] [stderr] Downloaded nix v0.31.2
[INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }`
[INFO] [stdout] e839ca548bf67b6e0cc152e03d50a3d4f648c309faeba029925825ec0cb14a5c
[INFO] running `Command { std: "docker" "start" "-a" "e839ca548bf67b6e0cc152e03d50a3d4f648c309faeba029925825ec0cb14a5c", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "inspect" "e839ca548bf67b6e0cc152e03d50a3d4f648c309faeba029925825ec0cb14a5c", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "e839ca548bf67b6e0cc152e03d50a3d4f648c309faeba029925825ec0cb14a5c", kill_on_drop: false }`
[INFO] [stdout] e839ca548bf67b6e0cc152e03d50a3d4f648c309faeba029925825ec0cb14a5c
[INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }`
[INFO] [stdout] 51f182d01c01b5a6b23cebebc57a9d35d6cce698c350c39681e9908bde72e273
[INFO] running `Command { std: "docker" "start" "-a" "51f182d01c01b5a6b23cebebc57a9d35d6cce698c350c39681e9908bde72e273", kill_on_drop: false }`
[INFO] [stderr] Compiling libc v0.2.183
[INFO] [stderr] Checking futures-core v0.3.32
[INFO] [stderr] Compiling find-msvc-tools v0.1.6
[INFO] [stderr] Checking futures-sink v0.3.32
[INFO] [stderr] Compiling serde v1.0.228
[INFO] [stderr] Checking slab v0.4.12
[INFO] [stderr] Compiling syn v2.0.111
[INFO] [stderr] Compiling syn v1.0.109
[INFO] [stderr] Compiling semver v1.0.27
[INFO] [stderr] Checking memchr v2.8.0
[INFO] [stderr] Checking http v1.4.0
[INFO] [stderr] Checking bitflags v2.11.0
[INFO] [stderr] Checking futures-io v0.3.32
[INFO] [stderr] Checking futures-task v0.3.32
[INFO] [stderr] Checking futures-channel v0.3.32
[INFO] [stderr] Compiling num-traits v0.2.19
[INFO] [stderr] Compiling indexmap v2.13.0
[INFO] [stderr] Checking tracing-core v0.1.36
[INFO] [stderr] Compiling cc v1.2.51
[INFO] [stderr] Compiling winnow v0.5.40
[INFO] [stderr] Compiling strsim v0.10.0
[INFO] [stderr] Compiling openssl v0.10.75
[INFO] [stderr] Compiling crossbeam-utils v0.8.21
[INFO] [stderr] Checking sync_wrapper v1.0.2
[INFO] [stderr] Compiling getrandom v0.4.1
[INFO] [stderr] Compiling doc-comment v0.3.4
[INFO] [stderr] Checking tracing v0.1.44
[INFO] [stderr] Compiling zmij v1.0.21
[INFO] [stderr] Compiling rustc_version v0.4.1
[INFO] [stderr] Compiling nix v0.31.2
[INFO] [stderr] Compiling serde_json v1.0.149
[INFO] [stderr] Checking sha2 v0.10.9
[INFO] [stderr] Checking rustls-pki-types v1.14.0
[INFO] [stderr] Compiling curve25519-dalek v4.1.3
[INFO] [stderr] Checking event-listener v2.5.3
[INFO] [stderr] Compiling num-integer v0.1.46
[INFO] [stderr] Checking signature v2.2.0
[INFO] [stderr] Checking time v0.3.47
[INFO] [stderr] Compiling num-bigint v0.4.6
[INFO] [stderr] Checking hmac v0.12.1
[INFO] [stderr] Checking ed25519 v2.2.3
[INFO] [stderr] Checking spin v0.9.8
[INFO] [stderr] Checking concurrent-queue v2.5.0
[INFO] [stderr] Checking http-body v1.0.1
[INFO] [stderr] Checking base64 v0.21.7
[INFO] [stderr] Checking chrono v0.4.42
[INFO] [stderr] Checking serde_bytes v0.11.19
[INFO] [stderr] Checking async-channel v1.9.0
[INFO] [stderr] Checking http-body-util v0.1.3
[INFO] [stderr] Compiling openssl-sys v0.9.111
[INFO] [stderr] Compiling blake3 v1.8.2
[INFO] [stderr] Checking parking_lot_core v0.9.12
[INFO] [stderr] Checking errno v0.3.14
[INFO] [stderr] Checking socket2 v0.6.2
[INFO] [stderr] Checking mio v1.1.1
[INFO] [stderr] Checking getrandom v0.2.16
[INFO] [stderr] Checking uuid v1.21.0
[INFO] [stderr] Checking signal-hook-registry v1.4.8
[INFO] [stderr] Checking rand_core v0.6.4
[INFO] [stderr] Checking parking_lot v0.12.5
[INFO] [stderr] Checking getrandom v0.3.4
[INFO] [stderr] Checking rand_chacha v0.3.1
[INFO] [stderr] Checking rand v0.8.5
[INFO] [stderr] Checking ctrlc v3.5.2
[INFO] [stderr] Compiling native-tls v0.2.18
[INFO] [stderr] Compiling darling_core v0.14.4
[INFO] [stderr] Compiling snafu-derive v0.7.5
[INFO] [stderr] Compiling darling_macro v0.14.4
[INFO] [stderr] Checking snafu v0.7.5
[INFO] [stderr] Compiling darling v0.14.4
[INFO] [stderr] Compiling derive_builder_core v0.12.0
[INFO] [stderr] Compiling synstructure v0.13.2
[INFO] [stderr] Compiling zerovec-derive v0.11.2
[INFO] [stderr] Compiling displaydoc v0.2.5
[INFO] [stderr] Compiling serde_derive v1.0.228
[INFO] [stderr] Compiling tokio-macros v2.6.0
[INFO] [stderr] Compiling futures-macro v0.3.32
[INFO] [stderr] Compiling openssl-macros v0.1.1
[INFO] [stderr] Compiling enum-ordinalize v3.1.15
[INFO] [stderr] Compiling curve25519-dalek-derive v0.1.1
[INFO] [stderr] Compiling async-trait v0.1.89
[INFO] [stderr] Compiling zerofrom-derive v0.1.6
[INFO] [stderr] Compiling yoke-derive v0.8.1
[INFO] [stderr] Compiling derive_builder_macro v0.12.0
[INFO] [stderr] Compiling educe v0.4.23
[INFO] [stderr] Checking derive_builder v0.12.0
[INFO] [stderr] Checking tokio v1.49.0
[INFO] [stderr] Compiling zerofrom v0.1.6
[INFO] [stderr] Compiling yoke v0.8.1
[INFO] [stderr] Checking futures-util v0.3.32
[INFO] [stderr] Compiling zerovec v0.11.5
[INFO] [stderr] Compiling zerotrie v0.2.3
[INFO] [stderr] Checking tinystr v0.8.2
[INFO] [stderr] Checking potential_utf v0.1.4
[INFO] [stderr] Checking icu_collections v2.1.1
[INFO] [stderr] Checking phantom-type v0.4.2
[INFO] [stderr] Checking icu_locale_core v2.1.1
[INFO] [stderr] Checking ed25519-dalek v2.2.0
[INFO] [stderr] Checking icu_provider v2.1.1
[INFO] [stderr] Checking icu_normalizer v2.1.1
[INFO] [stderr] Checking icu_properties v2.1.2
[INFO] [stderr] Compiling serde_spanned v0.6.9
[INFO] [stderr] Compiling toml_datetime v0.6.11
[INFO] [stderr] Checking serde_urlencoded v0.7.1
[INFO] [stderr] Checking hashbrown v0.14.5
[INFO] [stderr] Compiling toml_edit v0.19.15
[INFO] [stderr] Checking idna_adapter v1.2.1
[INFO] [stderr] Checking idna v1.1.0
[INFO] [stderr] Checking url v2.5.8
[INFO] [stderr] Checking tokio-util v0.7.18
[INFO] [stderr] Checking tokio-native-tls v0.3.1
[INFO] [stderr] Checking tower v0.5.3
[INFO] [stderr] Checking futures-executor v0.3.32
[INFO] [stderr] Checking futures v0.3.32
[INFO] [stderr] Checking tower-http v0.6.8
[INFO] [stderr] Checking h2 v0.4.13
[INFO] [stderr] Compiling toml v0.7.8
[INFO] [stderr] Compiling cargo-lock v9.0.0
[INFO] [stderr] Compiling built v0.6.1
[INFO] [stderr] Compiling pubnub v0.7.0
[INFO] [stderr] Checking hyper v1.8.1
[INFO] [stderr] Checking hyper-util v0.1.20
[INFO] [stderr] Checking hyper-tls v0.6.0
[INFO] [stderr] Checking reqwest v0.12.28
[INFO] [stderr] Checking krypton v0.1.0 (/opt/rustwide/workdir)
[INFO] [stdout] warning: unused import: `reward_tx`
[INFO] [stdout] --> src/block.rs:4:126
[INFO] [stdout] |
[INFO] [stdout] 4 | ...ty, errors::BlockError, transaction::{reward::{emission_tx, reward_tx}, transaction::*}};
[INFO] [stdout] | ^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant field names in struct initialization
[INFO] [stdout] --> src/block.rs:72:13
[INFO] [stdout] |
[INFO] [stdout] 72 | prev_hash: prev_hash,
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `prev_hash`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
[INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused imports: `PUBLIC_KEY_LENGTH` and `SIGNATURE_LENGTH`
[INFO] [stdout] --> src/transaction/transaction.rs:3:5
[INFO] [stdout] |
[INFO] [stdout] 3 | PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH, Signature, SigningKey, VerifyingKey, ed25519::{Error, signature::SignerMut}
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant field names in struct initialization
[INFO] [stdout] --> src/transaction/transaction.rs:38:21
[INFO] [stdout] |
[INFO] [stdout] 38 | kind: kind,
[INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: empty line after doc comment
[INFO] [stdout] --> src/node/node.rs:40:1
[INFO] [stdout] |
[INFO] [stdout] 40 | / /// Мысль: такое чувство, что ручная сборка p2p-сети была бы полегче.
[INFO] [stdout] 41 | |
[INFO] [stdout] | |_^
[INFO] [stdout] 42 | use crate::{
[INFO] [stdout] | - the comment documents this `use` import
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
[INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
[INFO] [stdout] = help: if the empty line is unintentional, remove it
[INFO] [stdout] help: if the comment should document the parent module use an inner doc comment
[INFO] [stdout] |
[INFO] [stdout] 1 ~ //! Код реализует основные методы для работы с узлом блокчейн сети krypton.
[INFO] [stdout] 2 ~ //! Жизненный цикл Node основан на четырех состояниях:
[INFO] [stdout] 3 ~ //! Idle -> PreparingBlock -> Mining -> ApplyingBlock
[INFO] [stdout] 4 ~ //! Параллельно с основным циклом прослушиваются каналы "пиринговой" сети Krypton
[INFO] [stdout] 5 ~ //! Сеть построена на базе PubNub SDK, который предоставляет необходимые инструменты
[INFO] [stdout] 6 ~ //! для демонстрации работы, но ни как не для общественного использования!
[INFO] [stdout] 7 ~ //!
[INFO] [stdout] 8 ~ //! Откинув всю "рутинную" работу по разработке узла, можно выделить особенные
[INFO] [stdout] 9 ~ //! моменты, которые требуют глубокого изучения и тщательной реализации:
[INFO] [stdout] 10 ~ //!
[INFO] [stdout] 11 ~ //! 1. Остановка формирования блока, если был получен блок по сети
[INFO] [stdout] 12 ~ //! С этой частью связаны проблемы, вроде остановка добавления блока в локальную
[INFO] [stdout] 13 ~ //! цепочку при получении того же блока по сети. В частности решается изначальной публикацие блока,
[INFO] [stdout] 14 ~ //! а после уже добавления в локальную цепочку. Конфликты неизбежны: они будут решаться правилами
[INFO] [stdout] 15 ~ //! консенсуса уже распределенной сети. Главное – добавить проверку присутствия индекса в
[INFO] [stdout] 16 ~ //! локальной цепочке
[INFO] [stdout] 17 ~ //!
[INFO] [stdout] 18 ~ //! 2. Получения всей цепочки новым узлом (в частности также ее хранение)
[INFO] [stdout] 19 ~ //! В отличии от проблемы №1 здесь все видно: необходимо реализовать распределение всей цепочки
[INFO] [stdout] 20 ~ //! для новопришедших узлов. Я преположил, что новый узел может связываться с любым другим
[INFO] [stdout] 21 ~ //! узлов по каналу и получать от того файл json, который будет сохранять в себе и будет
[INFO] [stdout] 22 ~ //! работать с ним напрямую, не загружая его в runtime цепочку – это поможет сохранить
[INFO] [stdout] 23 ~ //! память и уменьшить время старта. После получения файла новый узел, конечно, полностью должен
[INFO] [stdout] 24 ~ //! проанализировать цепочку для составления актуального state, который также може сохраняться в
[INFO] [stdout] 25 ~ //! файл для оптимизированного дальнейшего запуска узла. Отсюда, как я уже упомянул, исходит метод
[INFO] [stdout] 26 ~ //! хранения данных в локальных json файлах, постоянно их синхронизируя.
[INFO] [stdout] 27 ~ //!
[INFO] [stdout] 28 ~ //! 2.1 С какими узлами создавать каналы для передачи json файлов?
[INFO] [stdout] 29 ~ //! Здесь есть два варианта: либо запрограммировать список main узлов, которые всегда будут доступны,
[INFO] [stdout] 30 ~ //! либо придумывать что-то с созданием каналов по ходу работы узла, без человека. Также можно, для
[INFO] [stdout] 31 ~ //! демонстрации, сделать ручной ввод адреса узла, у которого новый узел будет брать файлы.
[INFO] [stdout] 32 ~ //!
[INFO] [stdout] 33 ~ //! 3. Как публиковать state, чтобы вебсайт мог узнать баланс конкретного адреса?
[INFO] [stdout] 34 ~ //! State также будет представлять собой канал, куда каждый узел, публикующий в канал blockchain
[INFO] [stdout] 35 ~ //! блок, будет также публиковать измененный state, который будет обновлен на каждом узле.
[INFO] [stdout] 36 ~ //!
[INFO] [stdout] 37 ~ //! Мысль: в блокчейнах с алгоритмом PoS вся логика работает совершенно иначе дабы обеспечить
[INFO] [stdout] 38 ~ //! миллионы TPS.
[INFO] [stdout] 39 ~ //!
[INFO] [stdout] 40 ~ //! Мысль: такое чувство, что ручная сборка p2p-сети была бы полегче.
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant field names in struct initialization
[INFO] [stdout] --> src/node/node.rs:130:13
[INFO] [stdout] |
[INFO] [stdout] 130 | state: state,
[INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `state`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused import: `reward_tx`
[INFO] [stdout] --> src/block.rs:4:126
[INFO] [stdout] |
[INFO] [stdout] 4 | ...ty, errors::BlockError, transaction::{reward::{emission_tx, reward_tx}, transaction::*}};
[INFO] [stdout] | ^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant field names in struct initialization
[INFO] [stdout] --> src/block.rs:72:13
[INFO] [stdout] |
[INFO] [stdout] 72 | prev_hash: prev_hash,
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `prev_hash`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
[INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused imports: `PUBLIC_KEY_LENGTH` and `SIGNATURE_LENGTH`
[INFO] [stdout] --> src/transaction/transaction.rs:3:5
[INFO] [stdout] |
[INFO] [stdout] 3 | PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH, Signature, SigningKey, VerifyingKey, ed25519::{Error, signature::SignerMut}
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant field names in struct initialization
[INFO] [stdout] --> src/transaction/transaction.rs:38:21
[INFO] [stdout] |
[INFO] [stdout] 38 | kind: kind,
[INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `kind`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: empty line after doc comment
[INFO] [stdout] --> src/node/node.rs:40:1
[INFO] [stdout] |
[INFO] [stdout] 40 | / /// Мысль: такое чувство, что ручная сборка p2p-сети была бы полегче.
[INFO] [stdout] 41 | |
[INFO] [stdout] | |_^
[INFO] [stdout] 42 | use crate::{
[INFO] [stdout] | - the comment documents this `use` import
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
[INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
[INFO] [stdout] = help: if the empty line is unintentional, remove it
[INFO] [stdout] help: if the comment should document the parent module use an inner doc comment
[INFO] [stdout] |
[INFO] [stdout] 1 ~ //! Код реализует основные методы для работы с узлом блокчейн сети krypton.
[INFO] [stdout] 2 ~ //! Жизненный цикл Node основан на четырех состояниях:
[INFO] [stdout] 3 ~ //! Idle -> PreparingBlock -> Mining -> ApplyingBlock
[INFO] [stdout] 4 ~ //! Параллельно с основным циклом прослушиваются каналы "пиринговой" сети Krypton
[INFO] [stdout] 5 ~ //! Сеть построена на базе PubNub SDK, который предоставляет необходимые инструменты
[INFO] [stdout] 6 ~ //! для демонстрации работы, но ни как не для общественного использования!
[INFO] [stdout] 7 ~ //!
[INFO] [stdout] 8 ~ //! Откинув всю "рутинную" работу по разработке узла, можно выделить особенные
[INFO] [stdout] 9 ~ //! моменты, которые требуют глубокого изучения и тщательной реализации:
[INFO] [stdout] 10 ~ //!
[INFO] [stdout] 11 ~ //! 1. Остановка формирования блока, если был получен блок по сети
[INFO] [stdout] 12 ~ //! С этой частью связаны проблемы, вроде остановка добавления блока в локальную
[INFO] [stdout] 13 ~ //! цепочку при получении того же блока по сети. В частности решается изначальной публикацие блока,
[INFO] [stdout] 14 ~ //! а после уже добавления в локальную цепочку. Конфликты неизбежны: они будут решаться правилами
[INFO] [stdout] 15 ~ //! консенсуса уже распределенной сети. Главное – добавить проверку присутствия индекса в
[INFO] [stdout] 16 ~ //! локальной цепочке
[INFO] [stdout] 17 ~ //!
[INFO] [stdout] 18 ~ //! 2. Получения всей цепочки новым узлом (в частности также ее хранение)
[INFO] [stdout] 19 ~ //! В отличии от проблемы №1 здесь все видно: необходимо реализовать распределение всей цепочки
[INFO] [stdout] 20 ~ //! для новопришедших узлов. Я преположил, что новый узел может связываться с любым другим
[INFO] [stdout] 21 ~ //! узлов по каналу и получать от того файл json, который будет сохранять в себе и будет
[INFO] [stdout] 22 ~ //! работать с ним напрямую, не загружая его в runtime цепочку – это поможет сохранить
[INFO] [stdout] 23 ~ //! память и уменьшить время старта. После получения файла новый узел, конечно, полностью должен
[INFO] [stdout] 24 ~ //! проанализировать цепочку для составления актуального state, который также може сохраняться в
[INFO] [stdout] 25 ~ //! файл для оптимизированного дальнейшего запуска узла. Отсюда, как я уже упомянул, исходит метод
[INFO] [stdout] 26 ~ //! хранения данных в локальных json файлах, постоянно их синхронизируя.
[INFO] [stdout] 27 ~ //!
[INFO] [stdout] 28 ~ //! 2.1 С какими узлами создавать каналы для передачи json файлов?
[INFO] [stdout] 29 ~ //! Здесь есть два варианта: либо запрограммировать список main узлов, которые всегда будут доступны,
[INFO] [stdout] 30 ~ //! либо придумывать что-то с созданием каналов по ходу работы узла, без человека. Также можно, для
[INFO] [stdout] 31 ~ //! демонстрации, сделать ручной ввод адреса узла, у которого новый узел будет брать файлы.
[INFO] [stdout] 32 ~ //!
[INFO] [stdout] 33 ~ //! 3. Как публиковать state, чтобы вебсайт мог узнать баланс конкретного адреса?
[INFO] [stdout] 34 ~ //! State также будет представлять собой канал, куда каждый узел, публикующий в канал blockchain
[INFO] [stdout] 35 ~ //! блок, будет также публиковать измененный state, который будет обновлен на каждом узле.
[INFO] [stdout] 36 ~ //!
[INFO] [stdout] 37 ~ //! Мысль: в блокчейнах с алгоритмом PoS вся логика работает совершенно иначе дабы обеспечить
[INFO] [stdout] 38 ~ //! миллионы TPS.
[INFO] [stdout] 39 ~ //!
[INFO] [stdout] 40 ~ //! Мысль: такое чувство, что ручная сборка p2p-сети была бы полегче.
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant field names in struct initialization
[INFO] [stdout] --> src/node/node.rs:130:13
[INFO] [stdout] |
[INFO] [stdout] 130 | state: state,
[INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `state`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `e`
[INFO] [stdout] --> src/node/node.rs:279:45
[INFO] [stdout] |
[INFO] [stdout] 279 | ... Err(e) => eprintln!("Не удалось добавить полученную из сети транзакцию")
[INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e`
[INFO] [stdout] |
[INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `presence`
[INFO] [stdout] --> src/node/node.rs:290:38
[INFO] [stdout] |
[INFO] [stdout] 290 | Update::Presence(presence) => {
[INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_presence`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `object`
[INFO] [stdout] --> src/node/node.rs:293:40
[INFO] [stdout] |
[INFO] [stdout] 293 | Update::AppContext(object) => {
[INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_object`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `action`
[INFO] [stdout] --> src/node/node.rs:296:43
[INFO] [stdout] |
[INFO] [stdout] 296 | Update::MessageAction(action) => {
[INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_action`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `file`
[INFO] [stdout] --> src/node/node.rs:299:34
[INFO] [stdout] |
[INFO] [stdout] 299 | Update::File(file) => {
[INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: length comparison to zero
[INFO] [stdout] --> src/blockchain.rs:25:12
[INFO] [stdout] |
[INFO] [stdout] 25 | if self.chain.len() != 0 {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.chain.is_empty()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant closure
[INFO] [stdout] --> src/blockchain.rs:26:64
[INFO] [stdout] |
[INFO] [stdout] 26 | validate_block(&block, &self.last_block()).map_err(|e| BlockchainError::InvalidBlock(e))?;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `BlockchainError::InvalidBlock`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
[INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant closure
[INFO] [stdout] --> src/blockchain.rs:30:43
[INFO] [stdout] |
[INFO] [stdout] 30 | state.apply_block(&block).map_err(|e| BlockchainError::InvalidState(e))?;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `BlockchainError::InvalidState`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: manual implementation of `.is_multiple_of()`
[INFO] [stdout] --> src/blockchain.rs:43:12
[INFO] [stdout] |
[INFO] [stdout] 43 | if height % DIFFICULTY_ADJUST_INTERVAL == 0 {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `height.is_multiple_of(DIFFICULTY_ADJUST_INTERVAL)`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of
[INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: you should consider adding a `Default` implementation for `State`
[INFO] [stdout] --> src/state.rs:10:5
[INFO] [stdout] |
[INFO] [stdout] 10 | / pub fn new() -> Self {
[INFO] [stdout] 11 | | let balances: HashMap
= HashMap::new();
[INFO] [stdout] 12 | | Self {
[INFO] [stdout] 13 | | balances
[INFO] [stdout] 14 | | }
[INFO] [stdout] 15 | | }
[INFO] [stdout] | |_____^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
[INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default
[INFO] [stdout] help: try adding this
[INFO] [stdout] |
[INFO] [stdout] 9 + impl Default for State {
[INFO] [stdout] 10 + fn default() -> Self {
[INFO] [stdout] 11 + Self::new()
[INFO] [stdout] 12 + }
[INFO] [stdout] 13 + }
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait
[INFO] [stdout] --> src/state.rs:56:9
[INFO] [stdout] |
[INFO] [stdout] 56 | self.balances.entry(user.clone()).or_insert(0).clone()
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.balances.entry(user.clone()).or_insert(0)`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
[INFO] [stdout] --> src/block.rs:66:67
[INFO] [stdout] |
[INFO] [stdout] 66 | pub fn new(prev_hash: [u8; OUT_LEN], block_height: &u64, txs: &Vec, difficulty: u32) -> Self {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
[INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default
[INFO] [stdout] help: change this to
[INFO] [stdout] |
[INFO] [stdout] 66 - pub fn new(prev_hash: [u8; OUT_LEN], block_height: &u64, txs: &Vec, difficulty: u32) -> Self {
[INFO] [stdout] 66 + pub fn new(prev_hash: [u8; OUT_LEN], block_height: &u64, txs: &[Transaction], difficulty: u32) -> Self {
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:104:27
[INFO] [stdout] |
[INFO] [stdout] 104 | validate_block_header(&block, &prev_block)?;
[INFO] [stdout] | ^^^^^^ help: change this to: `block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:104:35
[INFO] [stdout] |
[INFO] [stdout] 104 | validate_block_header(&block, &prev_block)?;
[INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `prev_block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:105:33
[INFO] [stdout] |
[INFO] [stdout] 105 | validate_block_transactions(&block)?;
[INFO] [stdout] | ^^^^^^ help: change this to: `block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:106:24
[INFO] [stdout] |
[INFO] [stdout] 106 | validate_block_pow(&block)?;
[INFO] [stdout] | ^^^^^^ help: change this to: `block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this boolean expression can be simplified
[INFO] [stdout] --> src/block.rs:148:12
[INFO] [stdout] |
[INFO] [stdout] 148 | if !validate_transaction(&tx).is_ok() {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `validate_transaction(&tx).is_err()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
[INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:148:34
[INFO] [stdout] |
[INFO] [stdout] 148 | if !validate_transaction(&tx).is_ok() {
[INFO] [stdout] | ^^^ help: change this to: `tx`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: module has the same name as its containing module
[INFO] [stdout] --> src/transaction/mod.rs:1:1
[INFO] [stdout] |
[INFO] [stdout] 1 | pub mod transaction;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
[INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/transaction/transaction.rs:72:55
[INFO] [stdout] |
[INFO] [stdout] 72 | let signature = Signature::from_bytes(&signature);
[INFO] [stdout] | ^^^^^^^^^^ help: change this to: `signature`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/transaction/transaction.rs:75:59
[INFO] [stdout] |
[INFO] [stdout] 75 | let public_key = VerifyingKey::from_bytes(&public_key);
[INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `public_key`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: using `clone` on type `VerifyingKey` which implements the `Copy` trait
[INFO] [stdout] --> src/transaction/transaction.rs:118:30
[INFO] [stdout] |
[INFO] [stdout] 118 | Ok(public_key) => Ok(public_key.clone()),
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*public_key`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: length comparison to zero
[INFO] [stdout] --> src/transaction/transaction.rs:149:8
[INFO] [stdout] |
[INFO] [stdout] 149 | if txs.len() == 0 {
[INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `txs.is_empty()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait
[INFO] [stdout] --> src/transaction/transaction.rs:154:16
[INFO] [stdout] |
[INFO] [stdout] 154 | return txs[0].as_bytes().clone();
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*txs[0].as_bytes()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `e`
[INFO] [stdout] --> src/node/node.rs:279:45
[INFO] [stdout] |
[INFO] [stdout] 279 | ... Err(e) => eprintln!("Не удалось добавить полученную из сети транзакцию")
[INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_e`
[INFO] [stdout] |
[INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `presence`
[INFO] [stdout] --> src/node/node.rs:290:38
[INFO] [stdout] |
[INFO] [stdout] 290 | Update::Presence(presence) => {
[INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_presence`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `object`
[INFO] [stdout] --> src/node/node.rs:293:40
[INFO] [stdout] |
[INFO] [stdout] 293 | Update::AppContext(object) => {
[INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_object`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `action`
[INFO] [stdout] --> src/node/node.rs:296:43
[INFO] [stdout] |
[INFO] [stdout] 296 | Update::MessageAction(action) => {
[INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_action`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused variable: `file`
[INFO] [stdout] --> src/node/node.rs:299:34
[INFO] [stdout] |
[INFO] [stdout] 299 | Update::File(file) => {
[INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file`
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unneeded `return` statement
[INFO] [stdout] --> src/consensus/pow.rs:12:5
[INFO] [stdout] |
[INFO] [stdout] 12 | return SUCCESS_MINING_OPCODE;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default
[INFO] [stdout] help: remove `return`
[INFO] [stdout] |
[INFO] [stdout] 12 - return SUCCESS_MINING_OPCODE;
[INFO] [stdout] 12 + SUCCESS_MINING_OPCODE
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: you should consider adding a `Default` implementation for `TxPool`
[INFO] [stdout] --> src/txpool.rs:9:5
[INFO] [stdout] |
[INFO] [stdout] 9 | / pub fn new() -> Self {
[INFO] [stdout] 10 | | Self {
[INFO] [stdout] 11 | | txs: vec![]
[INFO] [stdout] 12 | | }
[INFO] [stdout] 13 | | }
[INFO] [stdout] | |_____^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
[INFO] [stdout] help: try adding this
[INFO] [stdout] |
[INFO] [stdout] 8 + impl Default for TxPool {
[INFO] [stdout] 9 + fn default() -> Self {
[INFO] [stdout] 10 + Self::new()
[INFO] [stdout] 11 + }
[INFO] [stdout] 12 + }
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unneeded `return` statement
[INFO] [stdout] --> src/txpool.rs:18:23
[INFO] [stdout] |
[INFO] [stdout] 18 | Err(_) => return Err(TxPoolError::InvalidTransaction)
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[INFO] [stdout] help: remove `return`
[INFO] [stdout] |
[INFO] [stdout] 18 - Err(_) => return Err(TxPoolError::InvalidTransaction)
[INFO] [stdout] 18 + Err(_) => Err(TxPoolError::InvalidTransaction)
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: passing a unit value to a function
[INFO] [stdout] --> src/txpool.rs:17:22
[INFO] [stdout] |
[INFO] [stdout] 17 | Ok(_) => Ok(self.txs.push(tx)),
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
[INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default
[INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()`
[INFO] [stdout] |
[INFO] [stdout] 17 ~ Ok(_) => {
[INFO] [stdout] 18 + self.txs.push(tx);
[INFO] [stdout] 19 + Ok(())
[INFO] [stdout] 20 ~ },
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
[INFO] [stdout] --> src/txpool.rs:23:54
[INFO] [stdout] |
[INFO] [stdout] 23 | let txs: Vec = self.txs[0..size].iter().cloned().collect();
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect
[INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: struct `TxPool` has a public `len` method, but no `is_empty` method
[INFO] [stdout] --> src/txpool.rs:31:5
[INFO] [stdout] |
[INFO] [stdout] 31 | pub fn len(&self) -> usize {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
[INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: module has the same name as its containing module
[INFO] [stdout] --> src/node/mod.rs:1:1
[INFO] [stdout] |
[INFO] [stdout] 1 | pub mod node;
[INFO] [stdout] | ^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:12:5
[INFO] [stdout] |
[INFO] [stdout] 12 | /// С этой частью связаны проблемы, вроде остановка добавления блока в локальную
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 12 | /// С этой частью связаны проблемы, вроде остановка добавления блока в локальную
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:13:5
[INFO] [stdout] |
[INFO] [stdout] 13 | /// цепочку при получении того же блока по сети. В частности решается изначальной публикацие блока,
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 13 | /// цепочку при получении того же блока по сети. В частности решается изначальной публикацие блока,
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:14:5
[INFO] [stdout] |
[INFO] [stdout] 14 | /// а после уже добавления в локальную цепочку. Конфликты неизбежны: они будут решаться правилами
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 14 | /// а после уже добавления в локальную цепочку. Конфликты неизбежны: они будут решаться правилами
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:15:5
[INFO] [stdout] |
[INFO] [stdout] 15 | /// консенсуса уже распределенной сети. Главное – добавить проверку присутствия индекса в
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 15 | /// консенсуса уже распределенной сети. Главное – добавить проверку присутствия индекса в
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:16:5
[INFO] [stdout] |
[INFO] [stdout] 16 | /// локальной цепочке
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 16 | /// локальной цепочке
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:19:5
[INFO] [stdout] |
[INFO] [stdout] 19 | /// В отличии от проблемы №1 здесь все видно: необходимо реализовать распределение всей цепочки
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 19 | /// В отличии от проблемы №1 здесь все видно: необходимо реализовать распределение всей цепочки
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:20:5
[INFO] [stdout] |
[INFO] [stdout] 20 | /// для новопришедших узлов. Я преположил, что новый узел может связываться с любым другим
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 20 | /// для новопришедших узлов. Я преположил, что новый узел может связываться с любым другим
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:21:5
[INFO] [stdout] |
[INFO] [stdout] 21 | /// узлов по каналу и получать от того файл json, который будет сохранять в себе и будет
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 21 | /// узлов по каналу и получать от того файл json, который будет сохранять в себе и будет
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:22:5
[INFO] [stdout] |
[INFO] [stdout] 22 | /// работать с ним напрямую, не загружая его в runtime цепочку – это поможет сохранить
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 22 | /// работать с ним напрямую, не загружая его в runtime цепочку – это поможет сохранить
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:23:5
[INFO] [stdout] |
[INFO] [stdout] 23 | /// память и уменьшить время старта. После получения файла новый узел, конечно, полностью должен
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 23 | /// память и уменьшить время старта. После получения файла новый узел, конечно, полностью должен
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:24:5
[INFO] [stdout] |
[INFO] [stdout] 24 | /// проанализировать цепочку для составления актуального state, который также може сохраняться в
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 24 | /// проанализировать цепочку для составления актуального state, который также може сохраняться в
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:25:5
[INFO] [stdout] |
[INFO] [stdout] 25 | /// файл для оптимизированного дальнейшего запуска узла. Отсюда, как я уже упомянул, исходит метод
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 25 | /// файл для оптимизированного дальнейшего запуска узла. Отсюда, как я уже упомянул, исходит метод
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:26:5
[INFO] [stdout] |
[INFO] [stdout] 26 | /// хранения данных в локальных json файлах, постоянно их синхронизируя.
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 26 | /// хранения данных в локальных json файлах, постоянно их синхронизируя.
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:34:5
[INFO] [stdout] |
[INFO] [stdout] 34 | /// State также будет представлять собой канал, куда каждый узел, публикующий в канал blockchain
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 34 | /// State также будет представлять собой канал, куда каждый узел, публикующий в канал blockchain
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:35:5
[INFO] [stdout] |
[INFO] [stdout] 35 | /// блок, будет также публиковать измененный state, который будет обновлен на каждом узле.
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 35 | /// блок, будет также публиковать измененный state, который будет обновлен на каждом узле.
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: length comparison to zero
[INFO] [stdout] --> src/blockchain.rs:25:12
[INFO] [stdout] |
[INFO] [stdout] 25 | if self.chain.len() != 0 {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.chain.is_empty()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant closure
[INFO] [stdout] --> src/blockchain.rs:26:64
[INFO] [stdout] |
[INFO] [stdout] 26 | validate_block(&block, &self.last_block()).map_err(|e| BlockchainError::InvalidBlock(e))?;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `BlockchainError::InvalidBlock`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
[INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: redundant closure
[INFO] [stdout] --> src/blockchain.rs:30:43
[INFO] [stdout] |
[INFO] [stdout] 30 | state.apply_block(&block).map_err(|e| BlockchainError::InvalidState(e))?;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `BlockchainError::InvalidState`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: manual implementation of `.is_multiple_of()`
[INFO] [stdout] --> src/blockchain.rs:43:12
[INFO] [stdout] |
[INFO] [stdout] 43 | if height % DIFFICULTY_ADJUST_INTERVAL == 0 {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `height.is_multiple_of(DIFFICULTY_ADJUST_INTERVAL)`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of
[INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: you should consider adding a `Default` implementation for `State`
[INFO] [stdout] --> src/state.rs:10:5
[INFO] [stdout] |
[INFO] [stdout] 10 | / pub fn new() -> Self {
[INFO] [stdout] 11 | | let balances: HashMap = HashMap::new();
[INFO] [stdout] 12 | | Self {
[INFO] [stdout] 13 | | balances
[INFO] [stdout] 14 | | }
[INFO] [stdout] 15 | | }
[INFO] [stdout] | |_____^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
[INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default
[INFO] [stdout] help: try adding this
[INFO] [stdout] |
[INFO] [stdout] 9 + impl Default for State {
[INFO] [stdout] 10 + fn default() -> Self {
[INFO] [stdout] 11 + Self::new()
[INFO] [stdout] 12 + }
[INFO] [stdout] 13 + }
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait
[INFO] [stdout] --> src/state.rs:56:9
[INFO] [stdout] |
[INFO] [stdout] 56 | self.balances.entry(user.clone()).or_insert(0).clone()
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.balances.entry(user.clone()).or_insert(0)`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args
[INFO] [stdout] --> src/node/node.rs:112:43
[INFO] [stdout] |
[INFO] [stdout] 112 | println!("Адрес узла: {}", address.to_string());
[INFO] [stdout] | ^^^^^^^^^^^^ help: remove this
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
[INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unneeded `return` statement
[INFO] [stdout] --> src/node/node.rs:358:9
[INFO] [stdout] |
[INFO] [stdout] 358 | return;
[INFO] [stdout] | ^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[INFO] [stdout] help: remove `return`
[INFO] [stdout] |
[INFO] [stdout] 357 - self.pubnub.disconnect();
[INFO] [stdout] 358 - return;
[INFO] [stdout] 357 + self.pubnub.disconnect();
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this `if` statement can be collapsed
[INFO] [stdout] --> src/node/node.rs:273:25
[INFO] [stdout] |
[INFO] [stdout] 273 | / if *address.to_string() != message.sender.unwrap() {
[INFO] [stdout] 274 | | if let Ok(utf8_message) = String::from_utf8(message.data.clone()) {
[INFO] [stdout] 275 | | if let Ok(tx) = serde_json::from_str::(&utf8_message) {
[INFO] [stdout] 276 | | println!("Пришла транзакция. Добавляю в txpool...");
[INFO] [stdout] ... |
[INFO] [stdout] 288 | | }
[INFO] [stdout] | |_________________________^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
[INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default
[INFO] [stdout] help: collapse nested if block
[INFO] [stdout] |
[INFO] [stdout] 273 ~ if *address.to_string() != message.sender.unwrap()
[INFO] [stdout] 274 ~ && let Ok(utf8_message) = String::from_utf8(message.data.clone()) {
[INFO] [stdout] 275 | if let Ok(tx) = serde_json::from_str::(&utf8_message) {
[INFO] [stdout] ...
[INFO] [stdout] 286 | }
[INFO] [stdout] 287 ~ }
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default`
[INFO] [stdout] --> src/node/config.rs:14:5
[INFO] [stdout] |
[INFO] [stdout] 14 | / pub fn default() -> Self {
[INFO] [stdout] 15 | | Self {
[INFO] [stdout] 16 | | max_txs_per_block: TRANSACTION_SELECT_SIZE,
[INFO] [stdout] 17 | | mining_iteration_limit: MINING_ITERATION_COUNT
[INFO] [stdout] 18 | | }
[INFO] [stdout] 19 | | }
[INFO] [stdout] | |_____^
[INFO] [stdout] |
[INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
[INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
[INFO] [stdout] --> src/block.rs:66:67
[INFO] [stdout] |
[INFO] [stdout] 66 | pub fn new(prev_hash: [u8; OUT_LEN], block_height: &u64, txs: &Vec, difficulty: u32) -> Self {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
[INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default
[INFO] [stdout] help: change this to
[INFO] [stdout] |
[INFO] [stdout] 66 - pub fn new(prev_hash: [u8; OUT_LEN], block_height: &u64, txs: &Vec, difficulty: u32) -> Self {
[INFO] [stdout] 66 + pub fn new(prev_hash: [u8; OUT_LEN], block_height: &u64, txs: &[Transaction], difficulty: u32) -> Self {
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:104:27
[INFO] [stdout] |
[INFO] [stdout] 104 | validate_block_header(&block, &prev_block)?;
[INFO] [stdout] | ^^^^^^ help: change this to: `block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:104:35
[INFO] [stdout] |
[INFO] [stdout] 104 | validate_block_header(&block, &prev_block)?;
[INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `prev_block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:105:33
[INFO] [stdout] |
[INFO] [stdout] 105 | validate_block_transactions(&block)?;
[INFO] [stdout] | ^^^^^^ help: change this to: `block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:106:24
[INFO] [stdout] |
[INFO] [stdout] 106 | validate_block_pow(&block)?;
[INFO] [stdout] | ^^^^^^ help: change this to: `block`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this boolean expression can be simplified
[INFO] [stdout] --> src/block.rs:148:12
[INFO] [stdout] |
[INFO] [stdout] 148 | if !validate_transaction(&tx).is_ok() {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `validate_transaction(&tx).is_err()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
[INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/block.rs:148:34
[INFO] [stdout] |
[INFO] [stdout] 148 | if !validate_transaction(&tx).is_ok() {
[INFO] [stdout] | ^^^ help: change this to: `tx`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: module has the same name as its containing module
[INFO] [stdout] --> src/transaction/mod.rs:1:1
[INFO] [stdout] |
[INFO] [stdout] 1 | pub mod transaction;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
[INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/transaction/transaction.rs:72:55
[INFO] [stdout] |
[INFO] [stdout] 72 | let signature = Signature::from_bytes(&signature);
[INFO] [stdout] | ^^^^^^^^^^ help: change this to: `signature`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler
[INFO] [stdout] --> src/transaction/transaction.rs:75:59
[INFO] [stdout] |
[INFO] [stdout] 75 | let public_key = VerifyingKey::from_bytes(&public_key);
[INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `public_key`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: using `clone` on type `VerifyingKey` which implements the `Copy` trait
[INFO] [stdout] --> src/transaction/transaction.rs:118:30
[INFO] [stdout] |
[INFO] [stdout] 118 | Ok(public_key) => Ok(public_key.clone()),
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*public_key`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: length comparison to zero
[INFO] [stdout] --> src/transaction/transaction.rs:149:8
[INFO] [stdout] |
[INFO] [stdout] 149 | if txs.len() == 0 {
[INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `txs.is_empty()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait
[INFO] [stdout] --> src/transaction/transaction.rs:154:16
[INFO] [stdout] |
[INFO] [stdout] 154 | return txs[0].as_bytes().clone();
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*txs[0].as_bytes()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unneeded `return` statement
[INFO] [stdout] --> src/consensus/pow.rs:12:5
[INFO] [stdout] |
[INFO] [stdout] 12 | return SUCCESS_MINING_OPCODE;
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default
[INFO] [stdout] help: remove `return`
[INFO] [stdout] |
[INFO] [stdout] 12 - return SUCCESS_MINING_OPCODE;
[INFO] [stdout] 12 + SUCCESS_MINING_OPCODE
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: you should consider adding a `Default` implementation for `TxPool`
[INFO] [stdout] --> src/txpool.rs:9:5
[INFO] [stdout] |
[INFO] [stdout] 9 | / pub fn new() -> Self {
[INFO] [stdout] 10 | | Self {
[INFO] [stdout] 11 | | txs: vec![]
[INFO] [stdout] 12 | | }
[INFO] [stdout] 13 | | }
[INFO] [stdout] | |_____^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
[INFO] [stdout] help: try adding this
[INFO] [stdout] |
[INFO] [stdout] 8 + impl Default for TxPool {
[INFO] [stdout] 9 + fn default() -> Self {
[INFO] [stdout] 10 + Self::new()
[INFO] [stdout] 11 + }
[INFO] [stdout] 12 + }
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unneeded `return` statement
[INFO] [stdout] --> src/txpool.rs:18:23
[INFO] [stdout] |
[INFO] [stdout] 18 | Err(_) => return Err(TxPoolError::InvalidTransaction)
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[INFO] [stdout] help: remove `return`
[INFO] [stdout] |
[INFO] [stdout] 18 - Err(_) => return Err(TxPoolError::InvalidTransaction)
[INFO] [stdout] 18 + Err(_) => Err(TxPoolError::InvalidTransaction)
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: passing a unit value to a function
[INFO] [stdout] --> src/txpool.rs:17:22
[INFO] [stdout] |
[INFO] [stdout] 17 | Ok(_) => Ok(self.txs.push(tx)),
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
[INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default
[INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()`
[INFO] [stdout] |
[INFO] [stdout] 17 ~ Ok(_) => {
[INFO] [stdout] 18 + self.txs.push(tx);
[INFO] [stdout] 19 + Ok(())
[INFO] [stdout] 20 ~ },
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
[INFO] [stdout] --> src/txpool.rs:23:54
[INFO] [stdout] |
[INFO] [stdout] 23 | let txs: Vec = self.txs[0..size].iter().cloned().collect();
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect
[INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: struct `TxPool` has a public `len` method, but no `is_empty` method
[INFO] [stdout] --> src/txpool.rs:31:5
[INFO] [stdout] |
[INFO] [stdout] 31 | pub fn len(&self) -> usize {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
[INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: module has the same name as its containing module
[INFO] [stdout] --> src/node/mod.rs:1:1
[INFO] [stdout] |
[INFO] [stdout] 1 | pub mod node;
[INFO] [stdout] | ^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:12:5
[INFO] [stdout] |
[INFO] [stdout] 12 | /// С этой частью связаны проблемы, вроде остановка добавления блока в локальную
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 12 | /// С этой частью связаны проблемы, вроде остановка добавления блока в локальную
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:13:5
[INFO] [stdout] |
[INFO] [stdout] 13 | /// цепочку при получении того же блока по сети. В частности решается изначальной публикацие блока,
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 13 | /// цепочку при получении того же блока по сети. В частности решается изначальной публикацие блока,
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:14:5
[INFO] [stdout] |
[INFO] [stdout] 14 | /// а после уже добавления в локальную цепочку. Конфликты неизбежны: они будут решаться правилами
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 14 | /// а после уже добавления в локальную цепочку. Конфликты неизбежны: они будут решаться правилами
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:15:5
[INFO] [stdout] |
[INFO] [stdout] 15 | /// консенсуса уже распределенной сети. Главное – добавить проверку присутствия индекса в
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 15 | /// консенсуса уже распределенной сети. Главное – добавить проверку присутствия индекса в
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:16:5
[INFO] [stdout] |
[INFO] [stdout] 16 | /// локальной цепочке
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 16 | /// локальной цепочке
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:19:5
[INFO] [stdout] |
[INFO] [stdout] 19 | /// В отличии от проблемы №1 здесь все видно: необходимо реализовать распределение всей цепочки
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 19 | /// В отличии от проблемы №1 здесь все видно: необходимо реализовать распределение всей цепочки
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:20:5
[INFO] [stdout] |
[INFO] [stdout] 20 | /// для новопришедших узлов. Я преположил, что новый узел может связываться с любым другим
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 20 | /// для новопришедших узлов. Я преположил, что новый узел может связываться с любым другим
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:21:5
[INFO] [stdout] |
[INFO] [stdout] 21 | /// узлов по каналу и получать от того файл json, который будет сохранять в себе и будет
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 21 | /// узлов по каналу и получать от того файл json, который будет сохранять в себе и будет
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:22:5
[INFO] [stdout] |
[INFO] [stdout] 22 | /// работать с ним напрямую, не загружая его в runtime цепочку – это поможет сохранить
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 22 | /// работать с ним напрямую, не загружая его в runtime цепочку – это поможет сохранить
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:23:5
[INFO] [stdout] |
[INFO] [stdout] 23 | /// память и уменьшить время старта. После получения файла новый узел, конечно, полностью должен
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 23 | /// память и уменьшить время старта. После получения файла новый узел, конечно, полностью должен
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:24:5
[INFO] [stdout] |
[INFO] [stdout] 24 | /// проанализировать цепочку для составления актуального state, который также може сохраняться в
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 24 | /// проанализировать цепочку для составления актуального state, который также може сохраняться в
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:25:5
[INFO] [stdout] |
[INFO] [stdout] 25 | /// файл для оптимизированного дальнейшего запуска узла. Отсюда, как я уже упомянул, исходит метод
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 25 | /// файл для оптимизированного дальнейшего запуска узла. Отсюда, как я уже упомянул, исходит метод
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:26:5
[INFO] [stdout] |
[INFO] [stdout] 26 | /// хранения данных в локальных json файлах, постоянно их синхронизируя.
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 26 | /// хранения данных в локальных json файлах, постоянно их синхронизируя.
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:34:5
[INFO] [stdout] |
[INFO] [stdout] 34 | /// State также будет представлять собой канал, куда каждый узел, публикующий в канал blockchain
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 34 | /// State также будет представлять собой канал, куда каждый узел, публикующий в канал blockchain
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: doc list item without indentation
[INFO] [stdout] --> src/node/node.rs:35:5
[INFO] [stdout] |
[INFO] [stdout] 35 | /// блок, будет также публиковать измененный state, который будет обновлен на каждом узле.
[INFO] [stdout] | ^
[INFO] [stdout] |
[INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[INFO] [stdout] help: indent this line
[INFO] [stdout] |
[INFO] [stdout] 35 | /// блок, будет также публиковать измененный state, который будет обновлен на каждом узле.
[INFO] [stdout] | +++
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args
[INFO] [stdout] --> src/node/node.rs:112:43
[INFO] [stdout] |
[INFO] [stdout] 112 | println!("Адрес узла: {}", address.to_string());
[INFO] [stdout] | ^^^^^^^^^^^^ help: remove this
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
[INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unneeded `return` statement
[INFO] [stdout] --> src/node/node.rs:358:9
[INFO] [stdout] |
[INFO] [stdout] 358 | return;
[INFO] [stdout] | ^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
[INFO] [stdout] help: remove `return`
[INFO] [stdout] |
[INFO] [stdout] 357 - self.pubnub.disconnect();
[INFO] [stdout] 358 - return;
[INFO] [stdout] 357 + self.pubnub.disconnect();
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: this `if` statement can be collapsed
[INFO] [stdout] --> src/node/node.rs:273:25
[INFO] [stdout] |
[INFO] [stdout] 273 | / if *address.to_string() != message.sender.unwrap() {
[INFO] [stdout] 274 | | if let Ok(utf8_message) = String::from_utf8(message.data.clone()) {
[INFO] [stdout] 275 | | if let Ok(tx) = serde_json::from_str::(&utf8_message) {
[INFO] [stdout] 276 | | println!("Пришла транзакция. Добавляю в txpool...");
[INFO] [stdout] ... |
[INFO] [stdout] 288 | | }
[INFO] [stdout] | |_________________________^
[INFO] [stdout] |
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
[INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default
[INFO] [stdout] help: collapse nested if block
[INFO] [stdout] |
[INFO] [stdout] 273 ~ if *address.to_string() != message.sender.unwrap()
[INFO] [stdout] 274 ~ && let Ok(utf8_message) = String::from_utf8(message.data.clone()) {
[INFO] [stdout] 275 | if let Ok(tx) = serde_json::from_str::(&utf8_message) {
[INFO] [stdout] ...
[INFO] [stdout] 286 | }
[INFO] [stdout] 287 ~ }
[INFO] [stdout] |
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default`
[INFO] [stdout] --> src/node/config.rs:14:5
[INFO] [stdout] |
[INFO] [stdout] 14 | / pub fn default() -> Self {
[INFO] [stdout] 15 | | Self {
[INFO] [stdout] 16 | | max_txs_per_block: TRANSACTION_SELECT_SIZE,
[INFO] [stdout] 17 | | mining_iteration_limit: MINING_ITERATION_COUNT
[INFO] [stdout] 18 | | }
[INFO] [stdout] 19 | | }
[INFO] [stdout] | |_____^
[INFO] [stdout] |
[INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name
[INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
[INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused imports: `config::NodeConfig`, `node::Node`, and `reward::reward_tx`
[INFO] [stdout] --> tests/test.rs:4:12
[INFO] [stdout] |
[INFO] [stdout] 4 | node::{config::NodeConfig, node::Node},
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^
[INFO] [stdout] 5 | transaction::{transaction::{Transaction, TransactionKind}, reward::reward_tx, user::UserTransaction}
[INFO] [stdout] | ^^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: unused import: `anyhow::Result`
[INFO] [stdout] --> tests/test.rs:7:5
[INFO] [stdout] |
[INFO] [stdout] 7 | use anyhow::Result;
[INFO] [stdout] | ^^^^^^^^^^^^^^
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stdout] warning: function `get_user_keypair` is never used
[INFO] [stdout] --> tests/test.rs:10:4
[INFO] [stdout] |
[INFO] [stdout] 10 | fn get_user_keypair() -> (SigningKey, VerifyingKey) {
[INFO] [stdout] | ^^^^^^^^^^^^^^^^
[INFO] [stdout] |
[INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
[INFO] [stdout]
[INFO] [stdout]
[INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 48.46s
[INFO] running `Command { std: "docker" "inspect" "51f182d01c01b5a6b23cebebc57a9d35d6cce698c350c39681e9908bde72e273", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "51f182d01c01b5a6b23cebebc57a9d35d6cce698c350c39681e9908bde72e273", kill_on_drop: false }`
[INFO] [stdout] 51f182d01c01b5a6b23cebebc57a9d35d6cce698c350c39681e9908bde72e273