-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move driver models into
infra
(#2409)
# Description No new functionality. Fixes #2286 # Changes Moved driver api model into `infra` Removed quote model since not used. ## How to test Existing e2e tests
- Loading branch information
Showing
10 changed files
with
206 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//! Types for communicating with drivers as defined in | ||
//! `crates/driver/openapi.yml`. | ||
pub mod reveal; | ||
pub mod settle; | ||
pub mod solve; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use { | ||
crate::boundary::bytes_hex, | ||
serde::{Deserialize, Serialize}, | ||
serde_with::serde_as, | ||
}; | ||
|
||
#[serde_as] | ||
#[derive(Clone, Debug, Default, Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Request { | ||
/// Unique ID of the solution (per driver competition), to reveal. | ||
#[serde_as(as = "serde_with::DisplayFromStr")] | ||
pub solution_id: u64, | ||
} | ||
|
||
#[serde_as] | ||
#[derive(Clone, Debug, Default, Deserialize)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct Calldata { | ||
#[serde(with = "bytes_hex")] | ||
pub internalized: Vec<u8>, | ||
#[serde(with = "bytes_hex")] | ||
pub uninternalized: Vec<u8>, | ||
} | ||
|
||
#[derive(Clone, Debug, Default, Deserialize)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct Response { | ||
pub calldata: Calldata, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use { | ||
crate::boundary::bytes_hex, | ||
primitive_types::H256, | ||
serde::{Deserialize, Serialize}, | ||
serde_with::serde_as, | ||
}; | ||
|
||
#[serde_as] | ||
#[derive(Clone, Debug, Default, Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Request { | ||
/// Unique ID of the solution (per driver competition), to settle. | ||
#[serde_as(as = "serde_with::DisplayFromStr")] | ||
pub solution_id: u64, | ||
} | ||
|
||
#[serde_as] | ||
#[derive(Clone, Debug, Default, Deserialize)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct Response { | ||
pub calldata: Calldata, | ||
pub tx_hash: H256, | ||
} | ||
|
||
#[serde_as] | ||
#[derive(Clone, Debug, Default, Deserialize)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct Calldata { | ||
#[serde(with = "bytes_hex")] | ||
pub internalized: Vec<u8>, | ||
#[serde(with = "bytes_hex")] | ||
pub uninternalized: Vec<u8>, | ||
} |
Oops, something went wrong.