Skip to content

Commit

Permalink
chore: change firebase url to base58 (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko authored May 7, 2024
1 parent 6b0784c commit 0afc273
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions atoma-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ impl AtomaSuiClient {

debug!("Submitted transaction with response: {:?}", tx_response);

let tx_digest = tx_response.digest.into_inner();
let tx_digest = tx_response.digest.base58_encode();
if let Some(events) = tx_response.events {
for event in events.data.iter() {
debug!("Got a transaction event: {:?}", event.type_.name.as_str());
if event.type_.name.as_str() == "FirstSubmissionEvent" {
self.output_manager_tx.send((tx_digest, response)).await?;
self.output_manager_tx
.send((tx_digest.clone(), response))
.await?;
break; // we don't need to check other events, as at this point the node knows it has been selected for
}
}
Expand Down
6 changes: 4 additions & 2 deletions atoma-event-subscribe/sui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::time::Duration;
use atoma_sui::subscriber::{SuiSubscriber, SuiSubscriberError};
use clap::Parser;
use sui_sdk::types::base_types::ObjectID;
use tracing::info;
use tracing::{error, info};

#[derive(Debug, Parser)]
struct Args {
Expand Down Expand Up @@ -41,7 +41,9 @@ async fn main() -> Result<(), SuiSubscriberError> {

tokio::spawn(async move {
info!("initializing subscribe");
event_subscriber.subscribe().await.unwrap();
if let Err(err) = event_subscriber.subscribe().await {
error!("Failed to subscribe: {:?}", err);
}
Ok::<_, SuiSubscriberError>(())
});

Expand Down
4 changes: 1 addition & 3 deletions atoma-output-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ impl AtomaOutputManager {
) -> Result<(), AtomaOutputManagerError> {
let client = Client::new();
let mut url = self.firebase_uri.clone();
let mut suffix = hex::encode(tx_digest);
suffix.push_str(".json");
url.push(suffix);
url.push(format!("{tx_digest}.json"));
info!("Firebase's output url: {:?}", url);
debug!(
"Submitting to Firebase's real time storage, the data: {}",
Expand Down
2 changes: 1 addition & 1 deletion atoma-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::{anyhow, Error, Result};
use serde::{Deserialize, Serialize};
use serde_json::Value;

pub type Digest = [u8; 32];
pub type Digest = String;
pub type SmallId = u64;

/// Represents a request object containing information about a request
Expand Down

0 comments on commit 0afc273

Please sign in to comment.