Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FunctionGatewayV2 #204

Closed
wants to merge 4 commits into from
Closed

FunctionGatewayV2 #204

wants to merge 4 commits into from

Conversation

puma314
Copy link
Contributor

@puma314 puma314 commented Sep 29, 2023

No description provided.

mapping(bytes32 => address) functionIdToVerifier;

function callbackRequestV1(
bytes32 _functionId,
Copy link
Contributor

@jtguibas jtguibas Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like a better name for this function is something like requestWithContextV1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and likewise fulfillRequestWithContextV1

delete requests[_requestId];
}

function storeRequestV1(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if most users are going to use this, we should just call it requestV1 imo

}
}

function verifyStored(
Copy link
Contributor

@jtguibas jtguibas Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of this function should be one word, like verify or check or something

// Default case
oracle[_functionId][inputHash] = outputHash;

if (_address != address(0)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should have the callback functionality in a separate function rather than shove it in here

revert CallbackFailed(_callbackAddress, _callbackSelector);
}

delete requests[_requestId];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant to the changes but please remember to delete requests[_requestId]; before the .call

@jtguibas jtguibas closed this Oct 10, 2023
@jtguibas jtguibas reopened this Oct 10, 2023
return;
}

VerifiedCall currentVerifiedCall = VerifiedCall({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really surprised if saving currentVerifiedCall to memory like this works, pretty sure it needs to be a storage slot.

@puma314 puma314 closed this Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants