mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
Generic Fixes (#1103)
* Update trade_details_page.dart * let web3dart calculate gas price and max gas while just providing the priority fee per gas needed
This commit is contained in:
parent
f07062d987
commit
b1859b9e63
3 changed files with 6 additions and 6 deletions
|
@ -65,13 +65,11 @@ class EthereumClient {
|
||||||
|
|
||||||
bool _isEthereum = currency == CryptoCurrency.eth;
|
bool _isEthereum = currency == CryptoCurrency.eth;
|
||||||
|
|
||||||
final price = await _client!.getGasPrice();
|
final price = _client!.getGasPrice();
|
||||||
|
|
||||||
final Transaction transaction = Transaction(
|
final Transaction transaction = Transaction(
|
||||||
from: privateKey.address,
|
from: privateKey.address,
|
||||||
to: EthereumAddress.fromHex(toAddress),
|
to: EthereumAddress.fromHex(toAddress),
|
||||||
maxGas: gas,
|
|
||||||
gasPrice: price,
|
|
||||||
maxPriorityFeePerGas: EtherAmount.fromInt(EtherUnit.gwei, priority.tip),
|
maxPriorityFeePerGas: EtherAmount.fromInt(EtherUnit.gwei, priority.tip),
|
||||||
value: _isEthereum ? EtherAmount.inWei(BigInt.parse(amount)) : EtherAmount.zero(),
|
value: _isEthereum ? EtherAmount.inWei(BigInt.parse(amount)) : EtherAmount.zero(),
|
||||||
);
|
);
|
||||||
|
@ -101,7 +99,7 @@ class EthereumClient {
|
||||||
return PendingEthereumTransaction(
|
return PendingEthereumTransaction(
|
||||||
signedTransaction: signedTransaction,
|
signedTransaction: signedTransaction,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
fee: BigInt.from(gas) * price.getInWei,
|
fee: BigInt.from(gas) * (await price).getInWei,
|
||||||
sendTransaction: _sendTransaction,
|
sendTransaction: _sendTransaction,
|
||||||
exponent: exponent,
|
exponent: exponent,
|
||||||
);
|
);
|
||||||
|
|
|
@ -51,10 +51,11 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Observer(builder: (_) {
|
return Observer(builder: (_) {
|
||||||
// FIX-ME: Added `context` it was not used here before, maby bug ?
|
int itemsCount = tradeDetailsViewModel.items.length;
|
||||||
|
|
||||||
return SectionStandardList(
|
return SectionStandardList(
|
||||||
sectionCount: 1,
|
sectionCount: 1,
|
||||||
itemCounter: (int _) => tradeDetailsViewModel.items.length,
|
itemCounter: (int _) => itemsCount,
|
||||||
itemBuilder: (__, index) {
|
itemBuilder: (__, index) {
|
||||||
final item = tradeDetailsViewModel.items[index];
|
final item = tradeDetailsViewModel.items[index];
|
||||||
|
|
||||||
|
|
|
@ -161,6 +161,7 @@ class ExceptionHandler {
|
||||||
"Handshake error in client",
|
"Handshake error in client",
|
||||||
"Error while launching http",
|
"Error while launching http",
|
||||||
"OS Error: Network is unreachable",
|
"OS Error: Network is unreachable",
|
||||||
|
"ClientException: Write failed, uri=https:",
|
||||||
];
|
];
|
||||||
|
|
||||||
static Future<void> _addDeviceInfo(File file) async {
|
static Future<void> _addDeviceInfo(File file) async {
|
||||||
|
|
Loading…
Reference in a new issue