Skip to content

Conversation

@jmg-duarte
Copy link
Contributor

Description

Migrates OrderQuoteRequest struct from using ethcontract's H160 to alloy's Address type for address fields (from, sell_token, buy_token, receiver). This is part of the ongoing ethcontract → alloy library migration.

Changes

  • Update OrderQuoteRequest struct in model/src/quote.rs to use alloy::primitives::Address instead of H160
  • Update orderbook/src/api/post_quote.rs tests to use alloy Address constructors
  • Update orderbook/src/quoter.rs to handle alloy Address types
  • Add .into_legacy() conversions in shared/src/order_quoting.rs when converting OrderQuoteRequest to PreOrderData (which still uses H160)
  • Fix all e2e tests (14 files) to properly convert between H160 and alloy Address:
    • Use .into_alloy() when converting H160 → Address for OrderQuoteRequest
    • Use .into_legacy() when converting Address → H160 for legacy functions
    • Dereference address references where needed (*token.address())

How to test

Existing tests

@jmg-duarte jmg-duarte requested a review from a team as a code owner November 25, 2025 17:56
@jmg-duarte jmg-duarte changed the title Migrate OrderQuoteRequest to use alloy Address types [TRIVIAL] Migrate OrderQuoteRequest to use alloy Address types Nov 26, 2025
Base automatically changed from jmgd/alloy/changes to main November 26, 2025 12:55
@jmg-duarte jmg-duarte added this pull request to the merge queue Nov 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2025
@jmg-duarte jmg-duarte added this pull request to the merge queue Nov 26, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2025
# Description

Migrates `OrderQuoteRequest` struct from using ethcontract's `H160` to
alloy's `Address` type for address fields (`from`, `sell_token`,
`buy_token`, `receiver`). This is part of the ongoing ethcontract →
alloy library migration.

# Changes

- [x] Update `OrderQuoteRequest` struct in `model/src/quote.rs` to use
`alloy::primitives::Address` instead of `H160`
- [x] Update `orderbook/src/api/post_quote.rs` tests to use alloy
`Address` constructors
- [x] Update `orderbook/src/quoter.rs` to handle alloy Address types
- [x] Add `.into_legacy()` conversions in `shared/src/order_quoting.rs`
when converting `OrderQuoteRequest` to `PreOrderData` (which still uses
H160)
- [x] Fix all e2e tests (14 files) to properly convert between H160 and
alloy Address:
- Use `.into_alloy()` when converting H160 → Address for
OrderQuoteRequest
- Use `.into_legacy()` when converting Address → H160 for legacy
functions
  - Dereference address references where needed (`*token.address()`)


## How to test
Existing tests

<!--
## Related Issues

Fixes #
-->

---------

Co-authored-by: Claude <noreply@anthropic.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2025
@jmg-duarte jmg-duarte added this pull request to the merge queue Nov 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2025
@jmg-duarte jmg-duarte enabled auto-merge November 26, 2025 14:54
@jmg-duarte jmg-duarte added this pull request to the merge queue Nov 26, 2025
Merged via the queue into main with commit 5923b47 Nov 26, 2025
18 checks passed
@jmg-duarte jmg-duarte deleted the jmgd/alloy/order_quote_request branch November 26, 2025 15:20
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants