Skip to content

Commit

Permalink
return hash
Browse files Browse the repository at this point in the history
  • Loading branch information
move47 committed Mar 27, 2024
1 parent db3fcfa commit 04cebfa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/builder-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ snafu = { workspace = true }
tagged-base64 = { workspace = true }
tide-disco = { workspace = true }
toml = { workspace = true }
commit = { workspace = true }
versioned-binary-serialization = { workspace = true }
13 changes: 7 additions & 6 deletions crates/builder-api/src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use std::{fmt::Display, path::PathBuf};

use crate::{
api::load_api,
data_source::{AcceptsTxnSubmits, BuilderDataSource},
};
use clap::Args;
use commit::Committable;
use derive_more::From;
use futures::FutureExt;
use hotshot_types::{
Expand All @@ -17,11 +22,6 @@ use tide_disco::{
};
use versioned_binary_serialization::version::StaticVersionType;

use crate::{
api::load_api,
data_source::{AcceptsTxnSubmits, BuilderDataSource},
};

#[derive(Args, Default)]
pub struct Options {
#[arg(long = "builder-api-path", env = "HOTSHOT_BUILDER_API_PATH")]
Expand Down Expand Up @@ -188,8 +188,9 @@ where
let tx = req
.body_auto::<<Types as NodeType>::Transaction, Ver>(Ver::instance())
.context(TxnUnpackSnafu)?;
let hash = tx.commit();
state.submit_txn(tx).await.context(TxnSubmitSnafu)?;
Ok(())
Ok(hash)
}
.boxed()
})?;
Expand Down

0 comments on commit 04cebfa

Please sign in to comment.