Skip to content

Commit

Permalink
fix(gelato-bindings): add new API fields to web reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
luketchang committed May 20, 2022
1 parent 6d36e3a commit 021938d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion chains/nomad-ethereum/src/gelato/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ where
) -> Result<TxOutcome, ChainCommunicationError> {
let RelayResponse { task_id } = self.dispatch_tx(domain, contract_address, tx).await?;

info!(task_id = ?&task_id, "Submitted tx to Gelato relay. Polling task for completion...");
info!(task_id = ?&task_id, "Submitted tx to Gelato relay.");

info!(task_id = ?&task_id, "Polling Gelato task...");
self.poll_task_id(task_id)
.await
.map_err(|e| ChainCommunicationError::TxSubmissionError(e.into()))?
Expand Down
2 changes: 2 additions & 0 deletions chains/nomad-ethereum/src/gelato/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ impl UnfilledFowardRequest {
fee_token: self.fee_token,
payment_type: self.payment_type,
max_fee: self.max_fee.to_string(),
gas: self.gas.to_string(),
sponsor: self.sponsor,
sponsor_chain_id: self.sponsor_chain_id,
nonce: self.nonce,
enforce_sponsor_nonce: self.enforce_sponsor_nonce,
enforce_sponsor_nonce_ordering: self.enforce_sponsor_nonce_ordering,
sponsor_signature: hex_sig,
}
}
Expand Down
2 changes: 1 addition & 1 deletion gelato-relay/bin/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async fn main() -> Result<(), reqwest::Error> {
println!("Relay chains: {:?}", chains);

let task_status = gelato
.get_task_status("0x1a976f2bed20b154cb02a8c039705e34d4f5971a0f7b82ae1cdfd80bc1636d8f")
.get_task_status("0xce52ae7a6a3032848d76b161ac4c131fa995dcc67e3be5392dfb8466275d6679")
.await?;
println!("Task status: {:?}", task_status);

Expand Down
2 changes: 2 additions & 0 deletions gelato-relay/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ pub struct ForwardRequest {
pub fee_token: String,
pub payment_type: usize, // 1 = gas tank
pub max_fee: String,
pub gas: String,
pub sponsor: String,
pub sponsor_chain_id: usize, // same as chain_id
pub nonce: usize, // can default 0 if next field false
pub enforce_sponsor_nonce: bool, // default false given replay safe
pub enforce_sponsor_nonce_ordering: bool,
pub sponsor_signature: String,
}

Expand Down

0 comments on commit 021938d

Please sign in to comment.