refactor: move eth logic out of libstatus wrapper (#21)
This commit is contained in:
parent
5a0fd2d762
commit
62975ef419
|
@ -15,8 +15,8 @@ import unicode
|
||||||
import transactions
|
import transactions
|
||||||
import algorithm
|
import algorithm
|
||||||
import web3/[ethtypes, conversions], stew/byteutils, stint
|
import web3/[ethtypes, conversions], stew/byteutils, stint
|
||||||
import libstatus/eth/contracts
|
import eth/contracts
|
||||||
import libstatus/eth/transactions as eth_transactions
|
import eth/transactions as eth_transactions
|
||||||
import chronicles, libp2p/[multihash, multicodec, cid]
|
import chronicles, libp2p/[multihash, multicodec, cid]
|
||||||
|
|
||||||
import ./settings as status_settings
|
import ./settings as status_settings
|
||||||
|
|
|
@ -5,7 +5,7 @@ import
|
||||||
web3/ethtypes, stew/byteutils, nimcrypto, json_serialization, chronicles
|
web3/ethtypes, stew/byteutils, nimcrypto, json_serialization, chronicles
|
||||||
|
|
||||||
import
|
import
|
||||||
../../types/[network_type], ../settings, ../coder, transactions, methods, ../../utils
|
../types/[network_type], ../libstatus/settings, ../libstatus/coder, transactions, methods, ../utils
|
||||||
|
|
||||||
export
|
export
|
||||||
GetPackData, PackData, BuyToken, ApproveAndCall, Transfer, BalanceOf, Register, SetPubkey,
|
GetPackData, PackData, BuyToken, ApproveAndCall, Transfer, BalanceOf, Register, SetPubkey,
|
|
@ -2,7 +2,7 @@ import
|
||||||
web3/ethtypes
|
web3/ethtypes
|
||||||
|
|
||||||
import
|
import
|
||||||
transactions, ../../types/[rpc_response, transaction]
|
transactions, ../types/[rpc_response, transaction]
|
||||||
|
|
||||||
proc sendTransaction*(tx: var TransactionData, password: string, success: var bool): string =
|
proc sendTransaction*(tx: var TransactionData, password: string, success: var bool): string =
|
||||||
success = true
|
success = true
|
|
@ -5,7 +5,7 @@ import
|
||||||
nimcrypto, web3/[encoding, ethtypes]
|
nimcrypto, web3/[encoding, ethtypes]
|
||||||
|
|
||||||
import
|
import
|
||||||
../../types/[rpc_response, transaction], ../coder, eth, transactions
|
../types/[rpc_response, transaction], ../libstatus/coder, eth, transactions
|
||||||
|
|
||||||
export sendTransaction
|
export sendTransaction
|
||||||
|
|
|
@ -5,7 +5,7 @@ import
|
||||||
json_serialization, chronicles, web3/ethtypes
|
json_serialization, chronicles, web3/ethtypes
|
||||||
|
|
||||||
import
|
import
|
||||||
../core, ../../types/[rpc_response, transaction], ../conversions
|
../libstatus/core, ../types/[rpc_response, transaction], ../libstatus/conversions
|
||||||
|
|
||||||
proc estimateGas*(tx: TransactionData): RpcResponse =
|
proc estimateGas*(tx: TransactionData): RpcResponse =
|
||||||
let response = core.callPrivateRPC("eth_estimateGas", %*[%tx])
|
let response = core.callPrivateRPC("eth_estimateGas", %*[%tx])
|
|
@ -9,7 +9,7 @@ from nimcrypto import fromHex
|
||||||
|
|
||||||
import # status-desktop libs
|
import # status-desktop libs
|
||||||
./core as status, ../types/[sticker, setting, rpc_response],
|
./core as status, ../types/[sticker, setting, rpc_response],
|
||||||
./eth/contracts, ./settings, ./edn_helpers
|
../eth/contracts, ./settings, ./edn_helpers
|
||||||
|
|
||||||
proc decodeContentHash*(value: string): string =
|
proc decodeContentHash*(value: string): string =
|
||||||
if value == "":
|
if value == "":
|
||||||
|
|
|
@ -5,7 +5,7 @@ import
|
||||||
web3/[ethtypes, conversions], json_serialization
|
web3/[ethtypes, conversions], json_serialization
|
||||||
|
|
||||||
import
|
import
|
||||||
./settings, ./core, ./wallet, ./eth/contracts,
|
./settings, ./core, ./wallet, ../eth/contracts,
|
||||||
../types/[setting, network_type, rpc_response]
|
../types/[setting, network_type, rpc_response]
|
||||||
from ../utils import parseAddress
|
from ../utils import parseAddress
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import # project deps
|
||||||
chronicles, web3/[ethtypes, conversions], stint
|
chronicles, web3/[ethtypes, conversions], stint
|
||||||
|
|
||||||
import # local deps
|
import # local deps
|
||||||
libstatus/eth/contracts as status_contracts,
|
eth/contracts as status_contracts,
|
||||||
libstatus/stickers as status_stickers, transactions,
|
libstatus/stickers as status_stickers, transactions,
|
||||||
libstatus/wallet, ../eventemitter
|
libstatus/wallet, ../eventemitter
|
||||||
import ./types/[sticker, transaction, rpc_response]
|
import ./types/[sticker, transaction, rpc_response]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import libstatus/tokens as status_tokens
|
import libstatus/tokens as status_tokens
|
||||||
import libstatus/eth/contracts
|
import eth/contracts
|
||||||
import ../eventemitter
|
import ../eventemitter
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
|
@ -8,7 +8,7 @@ import ../libstatus/accounts/constants as constants
|
||||||
import ../libstatus/wallet as status_wallet
|
import ../libstatus/wallet as status_wallet
|
||||||
import ../libstatus/settings as status_settings
|
import ../libstatus/settings as status_settings
|
||||||
import ../libstatus/tokens as status_tokens
|
import ../libstatus/tokens as status_tokens
|
||||||
import ../libstatus/eth/contracts as status_contracts
|
import ../eth/contracts as status_contracts
|
||||||
import web3/conversions
|
import web3/conversions
|
||||||
from ../utils import parseAddress, wei2Eth
|
from ../utils import parseAddress, wei2Eth
|
||||||
import setting, network_type
|
import setting, network_type
|
||||||
|
|
|
@ -8,7 +8,7 @@ import libstatus/tokens as status_tokens
|
||||||
import libstatus/settings as status_settings
|
import libstatus/settings as status_settings
|
||||||
import libstatus/wallet as status_wallet
|
import libstatus/wallet as status_wallet
|
||||||
import libstatus/accounts/constants as constants
|
import libstatus/accounts/constants as constants
|
||||||
import libstatus/eth/[eth, contracts]
|
import eth/[eth, contracts]
|
||||||
from libstatus/core import getBlockByNumber
|
from libstatus/core import getBlockByNumber
|
||||||
from utils as libstatus_utils import eth2Wei, gwei2Wei, wei2Gwei, first, toUInt64, parseAddress
|
from utils as libstatus_utils import eth2Wei, gwei2Wei, wei2Gwei, first, toUInt64, parseAddress
|
||||||
import wallet/[balance_manager, collectibles]
|
import wallet/[balance_manager, collectibles]
|
||||||
|
|
|
@ -6,7 +6,7 @@ import # vendor libs
|
||||||
stint
|
stint
|
||||||
|
|
||||||
import # status-desktop libs
|
import # status-desktop libs
|
||||||
../libstatus/core as status, ../libstatus/eth/contracts as contracts,
|
../libstatus/core as status, ../eth/contracts as contracts,
|
||||||
../stickers as status_stickers,
|
../stickers as status_stickers,
|
||||||
web3/[conversions, ethtypes], ../utils, account
|
web3/[conversions, ethtypes], ../utils, account
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import libstatus/tokens as status_tokens
|
||||||
import libstatus/wallet as status_wallet
|
import libstatus/wallet as status_wallet
|
||||||
import libstatus/network as status_network
|
import libstatus/network as status_network
|
||||||
import libstatus/settings as status_settings
|
import libstatus/settings as status_settings
|
||||||
import libstatus/eth/[contracts]
|
import eth/[contracts]
|
||||||
import wallet2/[balance_manager, collectibles, network]
|
import wallet2/[balance_manager, collectibles, network]
|
||||||
import wallet2/account as wallet_account
|
import wallet2/account as wallet_account
|
||||||
import ./types/[account, transaction, network_type, setting, gas_prediction, rpc_response]
|
import ./types/[account, transaction, network_type, setting, gas_prediction, rpc_response]
|
||||||
|
|
|
@ -6,7 +6,7 @@ import # vendor libs
|
||||||
stint
|
stint
|
||||||
|
|
||||||
import # status-desktop libs
|
import # status-desktop libs
|
||||||
../libstatus/core as status, ../libstatus/eth/contracts as contracts,
|
../libstatus/core as status, ../eth/contracts as contracts,
|
||||||
../stickers as status_stickers,
|
../stickers as status_stickers,
|
||||||
web3/[conversions, ethtypes], ../utils, account
|
web3/[conversions, ethtypes], ../utils, account
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue