Skip to content

Commit 596f377

Browse files
committed
Fixed #169, checking the timestamp unit when redeem deposits
1 parent f48b4fc commit 596f377

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

frame/chainrelay/eth/backing/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ decl_module! {
226226

227227
<MomentT<T>>::saturated_from(Moment::try_from(month)? as _)
228228
};
229-
// TODO: Check the time unit in seconds or milliseconds
229+
// https://github.com/evolutionlandorg/bank/blob/master/contracts/GringottsBankV2.sol#L178
230+
// The start_at here is in seconds, will be converted to milliseconds later in on_deposit_redeem
230231
let start_at = {
231232
let start_at = result
232233
.params[3]
@@ -238,7 +239,8 @@ decl_module! {
238239
<MomentT<T>>::saturated_from(Moment::try_from(start_at)? as _)
239240
};
240241
let redeemed_ring = {
241-
// TODO: div 10**18 and mul 10**9
242+
// The decimal in Ethereum is 10**18, and the decimal in Darwinia is 10**9,
243+
// div 10**18 and mul 10**9
242244
let amount = result.params[5]
243245
.value
244246
.clone()

frame/staking/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ impl<T: Trait> OnDepositRedeem<T::AccountId> for Module<T> {
23832383
let controller = Self::bonded(&stash).ok_or(<Error<T>>::NotStash)?;
23842384
let ledger = Self::ledger(&controller).ok_or(<Error<T>>::NotController)?;
23852385

2386-
// TODO: Issue #169, checking the timestamp unit difference between Ethereum and Darwinia
2386+
// The timestamp unit is different between Ethereum and Darwinia, converting from seconds to milliseconds
23872387
let start_time = start_time * 1000;
23882388
let promise_month = months.min(36);
23892389

0 commit comments

Comments
 (0)