feat: 查看钱包优化,地址增加链上查询
This commit is contained in:
@@ -64,7 +64,10 @@ class EthDriver implements ChainDriver
|
||||
if (is_string($hex) && bccomp($this->hexToDec($hex), '0', 0) > 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (\Throwable) {
|
||||
} catch (\Throwable $e) {
|
||||
if (ChainHttpTimeout::active()) {
|
||||
throw $e;
|
||||
}
|
||||
// fall through to balances
|
||||
}
|
||||
|
||||
@@ -72,7 +75,10 @@ class EthDriver implements ChainDriver
|
||||
if (bccomp($this->getNativeBalance($address), '0', 18) > 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (\Throwable) {
|
||||
} catch (\Throwable $e) {
|
||||
if (ChainHttpTimeout::active()) {
|
||||
throw $e;
|
||||
}
|
||||
// fall through to token
|
||||
}
|
||||
|
||||
@@ -82,7 +88,11 @@ class EthDriver implements ChainDriver
|
||||
if (bccomp($this->getTokenBalance($address, $contract), '0', 18) > 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (\Throwable) {
|
||||
} catch (\Throwable $e) {
|
||||
if (ChainHttpTimeout::active()) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -270,6 +280,6 @@ class EthDriver implements ChainDriver
|
||||
|
||||
private function http(): PendingRequest
|
||||
{
|
||||
return Http::connectTimeout(20)->timeout(120)->acceptJson()->asJson();
|
||||
return ChainHttpTimeout::apply(Http::connectTimeout(20)->timeout(120)->acceptJson()->asJson());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user