Skip to content

Commit

Permalink
rename mempool related variables (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh authored Sep 16, 2024
1 parent 4bacb69 commit 34078d6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions server/url_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,21 @@ func ExtractParametersFromUrl(reqUrl *url.URL, allBuilders []string) (params URL
if len(useMempoolQuery) != 0 && useMempoolQuery[0] == "true" {
params.pref.Privacy.UseMempool = true
}
allowRevertQuery := normalizedQuery["allowrevert"]
if len(allowRevertQuery) != 0 && allowRevertQuery[0] == "true" {
params.pref.AllowRevert = true
canRevertQuery := normalizedQuery["canrevert"]
if len(canRevertQuery) != 0 && canRevertQuery[0] == "true" {
params.pref.CanRevert = true
}
customMempoolQuery := normalizedQuery["custommempool"]
if len(customMempoolQuery) != 0 {
cm, err := url.QueryUnescape(customMempoolQuery[0])
mempoolRPC := normalizedQuery["mempoolrpc"]
if len(mempoolRPC) != 0 {
cm, err := url.QueryUnescape(mempoolRPC[0])
if err != nil {
return params, ErrIncorrectMempoolURL
}
_, err = url.Parse(customMempoolQuery[0])
_, err = url.Parse(mempoolRPC[0])
if err != nil {
return params, ErrIncorrectMempoolURL
}
params.pref.Privacy.CustomMempool = cm
params.pref.Privacy.MempoolRPC = cm
}

return params, nil
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func TestRelayTx(t *testing.T) {

// Ensure that request was signed properly
pubkey := crypto.PubkeyToAddress(relaySigningKey.PublicKey).Hex()
require.Equal(t, pubkey+":0x446933e9be3df94013f61764c18dfa4e521b2d822c0cc7b42063b9bbc8960f697c0dd1d9835cb22b83b0765106d7fdbb9d2257d0dfcbf3feefb0e972f872266100", testutils.MockBackendLastRawRequest.Header.Get("X-Flashbots-Signature"))
require.Equal(t, pubkey+":0xe0f86ee2f36b4e254cd74aa1859a6d67c2e57e22e10d593bcdbcb815a1ab46d82aa9c8cbea8ac79d590b5a7ca5491a5621060a6a9d3be9016880c6a09980e32d00", testutils.MockBackendLastRawRequest.Header.Get("X-Flashbots-Signature"))

// Check result - should be the tx hash
var res string
Expand Down
16 changes: 8 additions & 8 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ type SendPrivateTxRequestWithPreferences struct {
}

type TxPrivacyPreferences struct {
Hints []string `json:"hints"`
Builders []string `json:"builders"`
UseMempool bool `json:"useMempool"`
CustomMempool string `json:"customMempool"`
Hints []string `json:"hints"`
Builders []string `json:"builders"`
UseMempool bool `json:"useMempool"`
MempoolRPC string `json:"mempoolRpc"`
}

type TxValidityPreferences struct {
Expand All @@ -128,8 +128,8 @@ type RefundConfig struct {
}

type PrivateTxPreferences struct {
Privacy TxPrivacyPreferences `json:"privacy"`
Validity TxValidityPreferences `json:"validity"`
Fast bool `json:"fast"`
AllowRevert bool `json:"allowRevert"`
Privacy TxPrivacyPreferences `json:"privacy"`
Validity TxValidityPreferences `json:"validity"`
Fast bool `json:"fast"`
CanRevert bool `json:"canRevert"`
}

0 comments on commit 34078d6

Please sign in to comment.