Skip to content

feat: example code to sign & send Orders #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025
Merged

Conversation

anna-carroll
Copy link
Contributor

@anna-carroll anna-carroll commented May 1, 2025

  • construct a simple example Order
  • sign the Order
  • send the Order
  • drive-by: update Filler code to use SignetSystemConstants

@anna-carroll anna-carroll requested a review from a team as a code owner May 1, 2025 10:09
@anna-carroll anna-carroll changed the title feat feat: example code to sign & send Orders May 1, 2025
@anna-carroll anna-carroll self-assigned this May 1, 2025
Base automatically changed from anna/filler-ex to main May 7, 2025 14:18
@@ -87,6 +87,17 @@ impl SignetSystemConstants {
self.host.is_system_contract(address)
}

/// Get the Order contract address for the given chain id.
pub const fn orders_for(&self, chain_id: u64) -> Option<Address> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is the most idiomatic way to do this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fn signature is idiomatic, but it's kinda weird in that there are exactly 2 choices, and the caller will always know which they want, so why do we allow passing an arbitrary chain id? caller should probably use .host_orders() or .rollup_orders() directly instead?

Copy link
Member

@prestwich prestwich May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's kinda fine this way I guess? the agg may contain invalid or junk data and this is one of the better ways to handle that I suppose

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i wish we didn't have an arbitrary chain id here, but james's argument is sound

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically lgtm, just the convo about the chain id

@@ -87,6 +87,17 @@ impl SignetSystemConstants {
self.host.is_system_contract(address)
}

/// Get the Order contract address for the given chain id.
pub const fn orders_for(&self, chain_id: u64) -> Option<Address> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i wish we didn't have an arbitrary chain id here, but james's argument is sound

@anna-carroll anna-carroll merged commit 59dffe1 into main May 12, 2025
5 checks passed
@anna-carroll anna-carroll deleted the anna/order-ex branch May 12, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants