Skip to content

Commit e774efd

Browse files
committed
Merge branch 'tiago/audit-todos' (#3234)
* origin/tiago/audit-todos: Changelog for #3234 Audit TODOs in codebase
2 parents 107e498 + 5817d5f commit e774efd

File tree

69 files changed

+223
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+223
-317
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Audit TODOs in the codebase.
2+
([\#3234](https://github.com/anoma/namada/pull/3234))

crates/apps_lib/src/cli.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,6 @@ pub mod args {
34113411

34123412
#[derive(Clone, Debug)]
34133413
pub struct LedgerDumpDb {
3414-
// TODO: allow to specify height
34153414
pub block_height: Option<BlockHeight>,
34163415
pub out_file_path: PathBuf,
34173416
pub historic: bool,

crates/apps_lib/src/cli/api.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use namada::tendermint_rpc::HttpClient;
33
use namada_sdk::error::Error;
44
use namada_sdk::queries::Client;
55
use namada_sdk::rpc::wait_until_node_is_synched;
6+
use tendermint_rpc::client::CompatMode;
67
use tendermint_rpc::Url as TendermintUrl;
78

89
/// Trait for clients that can be used with the CLI.
@@ -18,7 +19,11 @@ pub trait CliClient: Client + Sync {
1819
#[async_trait::async_trait(?Send)]
1920
impl CliClient for HttpClient {
2021
fn from_tendermint_address(address: &TendermintUrl) -> Self {
21-
HttpClient::new(address.clone()).unwrap()
22+
HttpClient::builder(address.clone().try_into().unwrap())
23+
.compat_mode(CompatMode::V0_37)
24+
.timeout(std::time::Duration::from_secs(30))
25+
.build()
26+
.unwrap()
2227
}
2328

2429
async fn wait_until_node_is_synced(

crates/apps_lib/src/cli/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ impl CliApi {
2727
match cmd {
2828
// Ledger cmds
2929
Sub::TxCustom(TxCustom(args)) => {
30-
// TODO: too much boilerplate to setup client
3130
let chain_ctx = ctx.borrow_mut_chain_or_exit();
3231
let ledger_address =
3332
chain_ctx.get(&args.tx.ledger_address);

crates/apps_lib/src/cli/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::cli::context::FromContext;
2020

2121
/// Environment variable where Ethereum relayer private
2222
/// keys are stored.
23-
// TODO: remove this in favor of getting eth keys from
23+
// TODO(namada#2029): remove this in favor of getting eth keys from
2424
// namadaw, ledger, or something more secure
2525
#[cfg_attr(not(feature = "namada-eth-bridge"), allow(dead_code))]
2626
const RELAYER_KEY_ENV_VAR: &str = "NAMADA_RELAYER_KEY";

crates/apps_lib/src/client/rpc.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,20 @@ pub async fn query_bonded_stake<N: Namada>(
10461046
get_validator_stake(context.client(), epoch, &validator).await;
10471047
match stake {
10481048
Some(stake) => {
1049-
// TODO: show if it's in consensus set, below capacity, or
1050-
// below threshold set
10511049
display_line!(
10521050
context.io(),
10531051
"Bonded stake of validator {validator}: {}",
10541052
stake.to_string_native()
1053+
);
1054+
query_and_print_validator_state(
1055+
context,
1056+
args::QueryValidatorState {
1057+
query: args.query,
1058+
validator,
1059+
epoch: args.epoch,
1060+
},
10551061
)
1062+
.await;
10561063
}
10571064
None => {
10581065
display_line!(

crates/apps_lib/src/config/genesis.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ pub mod tests {
598598
let (protocol_keypair, _eth_hot_bridge_keypair) =
599599
wallet::defaults::validator_keys();
600600

601-
// TODO: derive validator eth address from an eth keypair
602601
let eth_cold_gov_keypair: common::SecretKey =
603602
secp256k1::SigScheme::generate(&mut rng)
604603
.try_to_sk()

crates/apps_lib/src/config/genesis/templates.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ pub struct ChainParams<T: TemplateValidation> {
263263
/// Enable the native token transfer if it is true
264264
pub is_native_token_transferable: bool,
265265
/// Minimum number of blocks per epoch.
266-
// TODO: u64 only works with values up to i64::MAX with toml-rs!
266+
// NB: u64 only works with values up to i64::MAX with toml-rs!
267267
pub min_num_of_blocks: u64,
268268
/// Maximum duration per block (in seconds).
269-
// TODO: this is i64 because datetime wants it
269+
// NB: this is i64 because datetime wants it
270270
pub max_expected_time_per_block: i64,
271271
/// Max payload size, in bytes, for a tx batch proposal.
272272
///

crates/apps_lib/src/config/genesis/transactions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ pub type SignedBondTx<T> = Signed<BondTx<T>>;
591591
pub struct ValidatorAccountTx<PK: Ord> {
592592
/// The address of the validator.
593593
pub address: StringEncoded<EstablishedAddress>,
594-
// TODO: remove the vp field
594+
// TODO(namada#2554): remove the vp field
595595
pub vp: String,
596596
/// Commission rate charged on rewards for delegators (bounded inside
597597
/// 0-1)

crates/apps_lib/src/config/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,8 @@ And this is correct
364364
}
365365
"#;
366366

367-
// TODO: Replaced `block_sync` and `blocksync`
368-
// with `fast_sync` and `fastsync`
369-
// due to https://github.com/informalsystems/tendermint-rs/issues/1368
367+
// TODO(informalsystems/tendermint-rs#1368): Replaced
368+
// `block_sync` and `blocksync` with `fast_sync` and `fastsync`
370369
pub const DEFAULT_COMETBFT_CONFIG: &str = r#"
371370
372371
# This is a TOML config file.

0 commit comments

Comments
 (0)