Skip to content

Add auto_fill_txn

Add auto_fill_txn #86

Triggered via pull request April 15, 2024 15:05
Status Failure
Total duration 1m 6s
Artifacts

quality_test.yml

on: pull_request
clippy_check
57s
clippy_check
Fit to window
Zoom out
Zoom in

Annotations

10 errors and 4 warnings
cannot borrow `*client` as mutable more than once at a time: src/asynch/transaction/mod.rs#L115
error[E0499]: cannot borrow `*client` as mutable more than once at a time --> src/asynch/transaction/mod.rs:115:79 | 99 | async fn calculate_fee_per_transaction_type<'a, T, F>( | -- lifetime `'a` defined here ... 109 | let net_fee = get_fee(client, None, None).await?; | --------------------------- | | | | | first mutable borrow occurs here | argument requires that `*client` is borrowed for `'a` ... 115 | TransactionType::AccountDelete => get_owner_reserve_from_response(client).await?, | ^^^^^^ second mutable borrow occurs here
cannot move out of `autofilled_txn` because it is borrowed: src/asynch/transaction/mod.rs#L72
error[E0505]: cannot move out of `autofilled_txn` because it is borrowed --> src/asynch/transaction/mod.rs:72:8 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 47 | let mut autofilled_txn = AutofilledTransaction::new(transaction, None); | ------------------ binding `autofilled_txn` declared here ... 52 | let txn_common_fields = autofilled_txn.transaction.get_mut_common_fields(); | -------------------------------------------------- | | | borrow of `autofilled_txn.transaction` occurs here | argument requires that `autofilled_txn.transaction` is borrowed for `'a` ... 72 | Ok(autofilled_txn) | ^^^^^^^^^^^^^^ move out of `autofilled_txn` occurs here
cannot borrow `*client` as mutable more than once at a time: src/asynch/transaction/mod.rs#L68
error[E0499]: cannot borrow `*client` as mutable more than once at a time --> src/asynch/transaction/mod.rs:68:68 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 48 | set_network_id_and_build_version(client).await.unwrap(); | ---------------------------------------- | | | | | first mutable borrow occurs here | argument requires that `*client` is borrowed for `'a` ... 68 | let ledger_sequence = get_latest_validated_ledger_sequence(client).await?; | ^^^^^^ second mutable borrow occurs here
cannot borrow `*client` as mutable more than once at a time: src/asynch/transaction/mod.rs#L61
error[E0499]: cannot borrow `*client` as mutable more than once at a time --> src/asynch/transaction/mod.rs:61:22 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 48 | set_network_id_and_build_version(client).await.unwrap(); | ---------------------------------------- | | | | | first mutable borrow occurs here | argument requires that `*client` is borrowed for `'a` ... 61 | Some(client), | ^^^^^^ second mutable borrow occurs here
cannot borrow `autofilled_txn.transaction` as immutable because it is also borrowed as mutable: src/asynch/transaction/mod.rs#L60
error[E0502]: cannot borrow `autofilled_txn.transaction` as immutable because it is also borrowed as mutable --> src/asynch/transaction/mod.rs:60:17 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 52 | let txn_common_fields = autofilled_txn.transaction.get_mut_common_fields(); | -------------------------------------------------- | | | mutable borrow occurs here | argument requires that `autofilled_txn.transaction` is borrowed for `'a` ... 60 | &autofilled_txn.transaction, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ immutable borrow occurs here
cannot borrow `*client` as mutable more than once at a time: src/asynch/transaction/mod.rs#L55
error[E0499]: cannot borrow `*client` as mutable more than once at a time --> src/asynch/transaction/mod.rs:55:79 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 48 | set_network_id_and_build_version(client).await.unwrap(); | ---------------------------------------- | | | | | first mutable borrow occurs here | argument requires that `*client` is borrowed for `'a` ... 55 | Some(get_next_valid_seq_number(txn_common_fields.account.clone(), client, None).await?); | ^^^^^^ second mutable borrow occurs here
`autofilled_txn.transaction` does not live long enough: src/asynch/transaction/mod.rs#L52
error[E0597]: `autofilled_txn.transaction` does not live long enough --> src/asynch/transaction/mod.rs:52:29 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 47 | let mut autofilled_txn = AutofilledTransaction::new(transaction, None); | ------------------ binding `autofilled_txn` declared here ... 52 | let txn_common_fields = autofilled_txn.transaction.get_mut_common_fields(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------ | | | borrowed value does not live long enough | argument requires that `autofilled_txn.transaction` is borrowed for `'a` ... 73 | } | - `autofilled_txn.transaction` dropped here while still borrowed
cannot borrow `*client` as immutable because it is also borrowed as mutable: src/asynch/transaction/mod.rs#L50
error[E0502]: cannot borrow `*client` as immutable because it is also borrowed as mutable --> src/asynch/transaction/mod.rs:50:36 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 48 | set_network_id_and_build_version(client).await.unwrap(); | ---------------------------------------- | | | | | mutable borrow occurs here | argument requires that `*client` is borrowed for `'a` 49 | if autofilled_txn.netork_id.is_none() && txn_needs_network_id(client) { 50 | autofilled_txn.netork_id = client.get_common_fields().unwrap().network_id; | ^^^^^^ immutable borrow occurs here
cannot borrow `*client` as mutable more than once at a time: src/asynch/transaction/mod.rs#L49
error[E0499]: cannot borrow `*client` as mutable more than once at a time --> src/asynch/transaction/mod.rs:49:67 | 38 | pub async fn autofill<'a, F, T>( | -- lifetime `'a` defined here ... 48 | set_network_id_and_build_version(client).await.unwrap(); | ---------------------------------------- | | | | | first mutable borrow occurs here | argument requires that `*client` is borrowed for `'a` 49 | if autofilled_txn.netork_id.is_none() && txn_needs_network_id(client) { | ^^^^^^ second mutable borrow occurs here
clippy_check
Clippy had exited with the 101 exit code
constants have by default a `'static` lifetime: src/asynch/transaction/mod.rs#L35
warning: constants have by default a `'static` lifetime --> src/asynch/transaction/mod.rs:35:36 | 35 | const REQUIRED_NETWORKID_VERSION: &'static str = "1.11.0"; | -^^^^^^^---- help: consider removing `'static`: `&str` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
constants have by default a `'static` lifetime: src/asynch/transaction/mod.rs#L33
warning: constants have by default a `'static` lifetime --> src/asynch/transaction/mod.rs:33:23 | 33 | const OWNER_RESERVE: &'static str = "2000000"; // 2 XRP | -^^^^^^^---- help: consider removing `'static`: `&str` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
clippy_check
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
clippy_check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/