Skip to content

Commit

Permalink
Fix gas price thing in test
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSparksCode committed Aug 16, 2023
1 parent 770610c commit 3a554fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/contracts/atlas/ExecutionEnvironment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ contract ExecutionEnvironment is Test {
console.logBytes(userData);

(success, userData) = _control().delegatecall(userData);

console.log("it broke above rip");
require(success, "ERR-EC02 DelegateRevert");
} else {
revert("ERR-P02 UserCallStatic");
Expand Down
3 changes: 3 additions & 0 deletions src/contracts/protocol/ProtocolControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,18 @@ abstract contract ProtocolControl is Test, GovernanceControl, ExecutionBase {
// Safety and support functions and modifiers that make the relationship between protocol
// and FastLane's backend trustless.
modifier validControl() {
console.log("modifier: valid control");
require(control == _control(), "ERR-PC050 InvalidControl");
_;
}
modifier mustBeDelegated() {
console.log("modifier: must be delegated");
require(address(this) != control, "ERR-PC051 MustBeDelegated");
_;
}

modifier onlyApprovedDelegateCaller() {
console.log("modifier: only approved delegate caller");
require(msg.sender == escrow, "ERR-PC060 InvalidCaller");
_;
}
Expand Down
6 changes: 5 additions & 1 deletion test/SwapIntent.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ contract SwapIntentTest is BaseTest {
surplusToken: address(0)
});

// TODO remove
console.log("swapIntentController.delegateUser()");
console.log(swapIntentController.delegateUser());

// Searcher deploys the RFQ searcher contract (defined at bottom of this file)
vm.startPrank(searcherOneEOA);
SimpleRFQSearcher rfqSearcher = new SimpleRFQSearcher(address(atlas));
Expand Down Expand Up @@ -102,7 +106,7 @@ contract SwapIntentTest is BaseTest {
userCall = txBuilder.buildUserCall({
from: userEOA, // NOTE: Would from ever not be user?
to: address(swapIntentController),
maxFeePerGas: 50, // TODO update
maxFeePerGas: tx.gasprice + 1, // TODO update
value: 0,
data: userCallData
});
Expand Down

0 comments on commit 3a554fd

Please sign in to comment.