From 34078d6bb3709c3ca8963007329ba15dec1df8c5 Mon Sep 17 00:00:00 2001 From: TymKh Date: Mon, 16 Sep 2024 16:36:54 +0200 Subject: [PATCH] rename mempool related variables (#155) --- server/url_params.go | 16 ++++++++-------- tests/e2e_test.go | 2 +- types/types.go | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/server/url_params.go b/server/url_params.go index 59bb9bb..773ee0f 100644 --- a/server/url_params.go +++ b/server/url_params.go @@ -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 diff --git a/tests/e2e_test.go b/tests/e2e_test.go index feb2f1d..98458d2 100644 --- a/tests/e2e_test.go +++ b/tests/e2e_test.go @@ -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 diff --git a/types/types.go b/types/types.go index e9477fa..3c9f6a3 100644 --- a/types/types.go +++ b/types/types.go @@ -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 { @@ -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"` }