Skip to content
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

Feat(optimistic oracle): Table definition #39

Merged
merged 10 commits into from
Aug 13, 2024
29 changes: 29 additions & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,32 @@ pub struct VrfRequest {
pub _cursor: (Bound<i64>, Bound<i64>),
pub data_id: String,
}


#[derive(Queryable, Debug, QueryableByName, Selectable)]
#[diesel(primary_key(data_id))]
#[diesel(check_for_backend(diesel::pg::Pg))]
#[diesel(table_name = crate::schema::oo_requests)]
pub struct OORequest {
pub network: String,
pub data_id: String,
pub assertion_id: String,
pub domain_id: String,
pub claim: String,
pub asserter: String,
pub disputer: Option<String>,
pub disputed: Option<bool>,
pub callback_recipient: String,
pub escalation_manager: String,
pub caller: String,
pub expiration_timestamp: NaiveDateTime,
pub settled: Option<bool>,
pub settlement_resolution: Option<bool>,
pub settle_caller: Option<String>,
pub currency: String,
pub bond: BigDecimal,
pub _cursor: (Bound<i64>, Bound<i64>),
pub identifier: String,
pub updated_at: NaiveDateTime,
pub updated_at_tx: String,
}
38 changes: 37 additions & 1 deletion src/schema.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @generated automatically by Diesel CLI.

diesel::table! {
future_entry (data_id) {
#[max_length = 255]
Expand Down Expand Up @@ -172,6 +171,43 @@ diesel::table! {
}
}


diesel::table! {
oo_requests (data_id) {
#[max_length = 255]
network -> Varchar,
data_id -> Varchar,
assertion_id -> Varchar,
domain_id -> Varchar,
claim -> Text,
#[max_length = 255]
asserter -> Varchar,
#[max_length = 255]
disputer -> Nullable<Varchar>,
disputed -> Nullable<Bool>,
#[max_length = 255]
callback_recipient -> Varchar,
#[max_length = 255]
escalation_manager -> Varchar,
#[max_length = 255]
caller -> Varchar,
expiration_timestamp -> Timestamp,
settled -> Nullable<Bool>,
settlement_resolution -> Nullable<Bool>,
#[max_length = 255]
settle_caller -> Nullable<Varchar>,
#[max_length = 255]
currency -> Varchar,
bond -> Numeric,
_cursor -> Int8range,
identifier -> Varchar,
updated_at -> Timestamp,
#[max_length = 255]
updated_at_tx -> Varchar,
}
}


diesel::allow_tables_to_appear_in_same_query!(
future_entry,
mainnet_future_entry,
Expand Down
Loading