Web native Solido - Remove moment used in Utils
Closed this issue · 2 comments
molekilla commented
Web native Solido - Remove moment used in Utils
molekilla commented
import moment from 'moment';
export class BlockNumberDateMapper {
constructor() { }
static getPastBlockNumber(currentBlock, date) {
const BLOCK_PERIOD = 10;
const now = moment();
const query = moment(date);
const seconds = now.diff(query, 'seconds');
const blocks = Math.round(seconds / BLOCK_PERIOD);
const findBlock = currentBlock - blocks;
return findBlock;
}
}
molekilla commented
Done