Skip to content

Commit 954f9b0

Browse files
authored
Merge pull request #160 from confio/138-todo-fixme-review
Review TODO / FIXMEs
2 parents ab1b1b2 + ed31320 commit 954f9b0

File tree

8 files changed

+3
-18
lines changed

8 files changed

+3
-18
lines changed

contracts/tg4-mixer/src/contract.rs

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ pub fn instantiate(
6666
})?;
6767

6868
// add hooks to listen for all changes
69-
// TODO: what events to return here?
7069
let res = Response::new()
7170
.add_submessage(groups.left.add_hook(&env.contract.address)?)
7271
.add_submessage(groups.right.add_hook(&env.contract.address)?)

contracts/tg4-mixer/src/error.rs

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ pub enum ContractError {
1919
#[error("Unauthorized: {0}")]
2020
Unauthorized(String),
2121

22-
/// TODO: Remove this when we are ready to ensure we finished implementing everything
23-
#[error("Unimplemented")]
24-
Unimplemented {},
25-
2622
#[error("Contract {0} doesn't fulfill the tg4 interface")]
2723
NotTg4(String),
2824

contracts/tg4-mixer/src/functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use cosmwasm_std::{Decimal as StdDecimal, Fraction, Uint64};
88
use crate::error::ContractError;
99

1010
pub fn std_to_decimal(std_decimal: StdDecimal) -> Decimal {
11-
Decimal::from_i128_with_scale(std_decimal.numerator().u128() as i128, 18) // FIXME: StdDecimal::DECIMAL_PLACES is private
11+
Decimal::from_i128_with_scale(std_decimal.numerator().u128() as i128, 18) // FIXME: StdDecimal::DECIMAL_PLACES is private (https://github.com/CosmWasm/cosmwasm/issues/1361)
1212
}
1313

1414
/// This defines the functions we can use for proof of engagement points.

contracts/tg4-stake/src/contract.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ pub fn execute_claim<Q: CustomQuery>(
475475
Ok(res)
476476
}
477477

478-
// TODO: put in cosmwasm-std
478+
// TODO: put in cosmwasm-std (https://github.com/CosmWasm/cosmwasm/issues/1359)
479479
fn coins_to_string(coins: &[Coin]) -> String {
480480
let strings: Vec<_> = coins
481481
.iter()

contracts/tgrade-validator-voting/src/msg.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub struct InstantiateMsg {
1414
pub group_addr: String,
1515
}
1616

17-
// TODO: add some T variants? Maybe good enough as fixed Empty for now
1817
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
1918
#[serde(rename_all = "snake_case")]
2019
pub enum ExecuteMsg {

contracts/tgrade-valset/src/contract.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,7 @@ fn privilege_change<Q: CustomQuery>(_deps: DepsMut<Q>, change: PrivilegeChangeMs
638638
]);
639639
Response::new().add_submessages(msgs)
640640
}
641-
PrivilegeChangeMsg::Demoted {} => {
642-
// TODO: signal this is frozen?
643-
Response::new()
644-
}
641+
PrivilegeChangeMsg::Demoted {} => Response::new(),
645642
}
646643
}
647644

contracts/tgrade-valset/src/msg.rs

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub struct InstantiateMsg {
2020
pub membership: String,
2121
/// Minimum points needed by an address in `membership` to be considered for the validator set.
2222
/// 0-point members are always filtered out.
23-
/// TODO: if we allow sub-1 scaling factors, determine if this is pre-/post- scaling
2423
/// (use points for cw4, power for Tendermint)
2524
pub min_points: u64,
2625
/// The maximum number of validators that can be included in the Tendermint validator set.
@@ -45,7 +44,6 @@ pub struct InstantiateMsg {
4544
pub initial_keys: Vec<OperatorInitInfo>,
4645

4746
/// A scaling factor to multiply cw4-group points to produce the Tendermint validator power
48-
/// (TODO: should we allow this to reduce points? Like 1/1000?)
4947
pub scaling: Option<u32>,
5048

5149
/// Percentage of total accumulated fees that is subtracted from tokens minted as rewards.
@@ -355,7 +353,6 @@ impl ValidatorMetadata {
355353
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
356354
pub struct OperatorInitInfo {
357355
pub operator: String,
358-
/// TODO: better name to specify this is the Tendermint pubkey for consensus?
359356
pub validator_pubkey: Pubkey,
360357
pub metadata: ValidatorMetadata,
361358
}

contracts/tgrade-valset/src/state.rs

-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub struct Config {
1919
pub membership: Tg4Contract,
2020
/// minimum points needed by an address in `membership` to be considered for the validator set.
2121
/// 0-point members are always filtered out.
22-
/// TODO: if we allow sub-1 scaling factors, determine if this is pre-/post- scaling
2322
/// (use points for tg4, power for tendermint)
2423
pub min_points: u64,
2524
/// The maximum number of validators that can be included in the Tendermint validator set.
@@ -28,7 +27,6 @@ pub struct Config {
2827
/// lexicographically sorted).
2928
pub max_validators: u32,
3029
/// A scaling factor to multiply tg4-engagement points to produce the tendermint validator power
31-
/// (TODO: should we allow this to reduce points? Like 1/1000?)
3230
pub scaling: Option<u32>,
3331
/// Total reward paid out each epoch. This will be split among all validators during the last
3432
/// epoch.
@@ -93,7 +91,6 @@ pub struct EpochInfo {
9391
/// additions and updates.
9492
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, JsonSchema, Debug)]
9593
pub struct ValidatorInfo {
96-
/// TODO: better name to specify this is the Tendermint pubkey for consensus?
9794
pub validator_pubkey: Pubkey,
9895
pub operator: Addr,
9996
/// The voting power in Tendermint sdk

0 commit comments

Comments
 (0)