Skip to content

Commit

Permalink
httperror on parent
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Nov 30, 2023
1 parent 696f734 commit f7e93df
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions contracts/utils/UniversalResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ error ResolverNotContract();

error ResolverError(bytes returnData);

error HttpError(HttpErrorItem[] errors);

struct HttpErrorItem {
uint16 status;
string message;
}

struct MulticallData {
bytes name;
bytes[] data;
Expand Down Expand Up @@ -61,13 +68,6 @@ struct Result {
}

interface BatchGateway {
struct HttpErrorItem {
uint16 status;
string message;
}

error HttpError(HttpErrorItem[] errors);

function query(
OffchainLookupCallData[] memory data
) external returns (bool[] memory failures, bytes[] memory responses);
Expand Down Expand Up @@ -593,12 +593,12 @@ contract UniversalResolver is ERC165, Ownable {

function _checkResolveSingle(Result memory result) internal pure {
if (!result.success) {
if (bytes4(result.returnData) == BatchGateway.HttpError.selector) {
(, BatchGateway.HttpErrorItem[] memory errors) = abi.decode(
if (bytes4(result.returnData) == HttpError.selector) {
(, HttpErrorItem[] memory errors) = abi.decode(
result.returnData,
(bytes4, BatchGateway.HttpErrorItem[])
(bytes4, HttpErrorItem[])
);
revert BatchGateway.HttpError(errors);
revert HttpError(errors);
}
revert ResolverError(result.returnData);
}
Expand Down

0 comments on commit f7e93df

Please sign in to comment.