Skip to content

Commit

Permalink
Format e2e contracts and ci check (#118)
Browse files Browse the repository at this point in the history
* Format e2e contracts and ci check

* Add helper method to format

* Fix issue
  • Loading branch information
ferranbt authored Dec 7, 2023
1 parent 61b8f85 commit 11f4230
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 315 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Lint
run: make lint

- name: Lint contracts
run: cd suave && forge fmt --check

- name: Build contracts
run: cd suave && forge build

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ devnet-up:

devnet-down:
docker-compose -f ./suave/devenv/docker-compose.yml down

fmt-contracts:
cd suave && forge fmt
1 change: 0 additions & 1 deletion suave/e2e/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var (
MevShareBundleSenderContract = newArtifact("bids.sol/MevShareBundleSenderContract.json")
buildEthBlockContract = newArtifact("bids.sol/EthBlockBidContract.json")
ethBlockBidSenderContract = newArtifact("bids.sol/EthBlockBidSenderContract.json")
suaveLibContract = newArtifact("SuaveAbi.sol/SuaveAbi.json")
exampleCallSourceContract = newArtifact("example.sol/ExampleEthCallSource.json")
exampleCallTargetContract = newArtifact("example.sol/ExampleEthCallTarget.json")
)
Expand Down
8 changes: 4 additions & 4 deletions suave/e2e/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ func TestBlockBuildingPrecompiles(t *testing.T) {
require.NoError(t, err)

{ // Test the bundle simulation precompile through eth_call
calldata, err := suaveLibContract.Abi.Methods["simulateBundle"].Inputs.Pack(bundleBytes)
calldata, err := artifacts.SuaveAbi.Methods["simulateBundle"].Inputs.Pack(bundleBytes)
require.NoError(t, err)

var simResult hexutil.Bytes
Expand Down Expand Up @@ -785,7 +785,7 @@ func TestBlockBuildingPrecompiles(t *testing.T) {
FeeRecipient: common.Address{0x42},
}

packed, err := suaveLibContract.Abi.Methods["buildEthBlock"].Inputs.Pack(payloadArgsTuple, bid.Id, "")
packed, err := artifacts.SuaveAbi.Methods["buildEthBlock"].Inputs.Pack(payloadArgsTuple, bid.Id, "")
require.NoError(t, err)

var simResult hexutil.Bytes
Expand All @@ -799,7 +799,7 @@ func TestBlockBuildingPrecompiles(t *testing.T) {

require.NotNil(t, simResult)

unpacked, err := suaveLibContract.Abi.Methods["buildEthBlock"].Outputs.Unpack(simResult)
unpacked, err := artifacts.SuaveAbi.Methods["buildEthBlock"].Outputs.Unpack(simResult)
require.NoError(t, err)

// TODO: test builder bid
Expand Down Expand Up @@ -1446,7 +1446,7 @@ func requireNoRpcError(t *testing.T, rpcErr error) {
require.NoError(t, rpcErr, decodedError)
}

unpacked, err := suaveLibContract.Abi.Errors["PeekerReverted"].Inputs.Unpack(decodedError[4:])
unpacked, err := artifacts.SuaveAbi.Errors["PeekerReverted"].Inputs.Unpack(decodedError[4:])
if err != nil {
require.NoError(t, err, rpcErr.Error())
} else {
Expand Down
19 changes: 0 additions & 19 deletions suave/sol/libraries/SuaveAbi.sol

This file was deleted.

Loading

0 comments on commit 11f4230

Please sign in to comment.