Skip to content

Commit c92afb9

Browse files
committed
reverted to nominator instead of numerator
1 parent cbd3822 commit c92afb9

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

contracts/cw-ics20-latest/src/contract.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,11 +1231,11 @@ mod test {
12311231
let cw20_raw_denom = token_addr.as_str();
12321232
let local_channel = "channel-1234";
12331233
let ratio = Ratio {
1234-
numerator: 1,
1234+
nominator: 1,
12351235
denominator: 10,
12361236
};
12371237
let fee_amount =
1238-
Uint128::from(amount) * Decimal::from_ratio(ratio.numerator, ratio.denominator);
1238+
Uint128::from(amount) * Decimal::from_ratio(ratio.nominator, ratio.denominator);
12391239
let mut deps = setup(&[remote_channel, local_channel], &[]);
12401240
TOKEN_FEE
12411241
.save(deps.as_mut().storage, denom, &ratio)
@@ -1420,11 +1420,11 @@ mod test {
14201420
let cw20_raw_denom = original_sender;
14211421
let local_channel = "channel-1234";
14221422
let ratio = Ratio {
1423-
numerator: 1,
1423+
nominator: 1,
14241424
denominator: 10,
14251425
};
14261426
let fee_amount =
1427-
Uint128::from(amount) * Decimal::from_ratio(ratio.numerator, ratio.denominator);
1427+
Uint128::from(amount) * Decimal::from_ratio(ratio.nominator, ratio.denominator);
14281428
let mut deps = setup(&[remote_channel, local_channel], &[]);
14291429
TOKEN_FEE
14301430
.save(deps.as_mut().storage, denom, &ratio)
@@ -1587,14 +1587,14 @@ mod test {
15871587
TokenFee {
15881588
token_denom: "orai".to_string(),
15891589
ratio: Ratio {
1590-
numerator: 1,
1590+
nominator: 1,
15911591
denominator: 10,
15921592
},
15931593
},
15941594
TokenFee {
15951595
token_denom: "atom".to_string(),
15961596
ratio: Ratio {
1597-
numerator: 1,
1597+
nominator: 1,
15981598
denominator: 5,
15991599
},
16001600
},

contracts/cw-ics20-latest/src/ibc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ pub fn deduct_fee(token_fee: Ratio, amount: Uint128) -> Uint128 {
945945
return Uint128::from(0u64);
946946
}
947947
amount.mul(Decimal::from_ratio(
948-
token_fee.numerator,
948+
token_fee.nominator,
949949
token_fee.denominator,
950950
))
951951
}

contracts/cw-ics20-latest/src/ibc_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ mod test {
249249
deps.as_mut().storage,
250250
denom,
251251
&Ratio {
252-
numerator: 1,
252+
nominator: 1,
253253
denominator: 10,
254254
},
255255
)
@@ -962,7 +962,7 @@ mod test {
962962
assert_eq!(
963963
deduct_fee(
964964
Ratio {
965-
numerator: 1,
965+
nominator: 1,
966966
denominator: 0,
967967
},
968968
Uint128::from(1000u64)
@@ -972,7 +972,7 @@ mod test {
972972
assert_eq!(
973973
deduct_fee(
974974
Ratio {
975-
numerator: 1,
975+
nominator: 1,
976976
denominator: 1,
977977
},
978978
Uint128::from(1000u64)
@@ -982,7 +982,7 @@ mod test {
982982
assert_eq!(
983983
deduct_fee(
984984
Ratio {
985-
numerator: 1,
985+
nominator: 1,
986986
denominator: 100,
987987
},
988988
Uint128::from(1000u64)
@@ -1042,7 +1042,7 @@ mod test {
10421042
storage,
10431043
token_fee_denom,
10441044
&Ratio {
1045-
numerator: 1,
1045+
nominator: 1,
10461046
denominator: 100,
10471047
},
10481048
)

contracts/cw-ics20-latest/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub struct RelayerFee {
117117

118118
#[cw_serde]
119119
pub struct Ratio {
120-
pub numerator: u64,
120+
pub nominator: u64,
121121
pub denominator: u64,
122122
}
123123

0 commit comments

Comments
 (0)