route testing

This commit is contained in:
owen05
2020-11-10 18:37:51 +08:00
parent d965ce1409
commit aadf5eb844
9 changed files with 802 additions and 202 deletions

View File

@@ -1,4 +1,5 @@
import BigNumber from "bignumber.js";
import { getDefaultWeb3 } from './EVM';
export const MAX_UINT256 = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
@@ -12,4 +13,9 @@ export function mweiStr(value: string): string {
export function gweiStr(gwei: string): string {
return new BigNumber(gwei).multipliedBy(10 ** 9).toFixed(0, BigNumber.ROUND_DOWN)
}
export function fromWei(value:string,unit:any): string {
var web3 = getDefaultWeb3();
return web3.utils.fromWei(value,unit);
}