Skip to content

Commit

Permalink
Merge pull request #135 from weaveVM/chore-revert-arweave-str-proof
Browse files Browse the repository at this point in the history
chore: Revert to arweave storage proof
  • Loading branch information
andreespirela authored Feb 10, 2025
2 parents 814abd6 + 99d030a commit fcf7967
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ borsh = "1.5.1"
brotlic = "0.8.2"

exex-wvm-da = { git = "https://github.com/weaveVM/exex-templates?i", tag = "v0.1.0" }
exex-wvm-bigquery = { git = "https://github.com/weaveVM/exex-templates?i", tag = "v0.1.0" }
exex-wvm-bigquery = { git = "https://github.com/weaveVM/exex-templates?i", tag = "v0.2.0" }

# fees
fees = { git = "https://github.com/weaveVM/miscalleneous?c", branch = "main" }
Expand Down
22 changes: 13 additions & 9 deletions crates/rpc/rpc-eth-api/src/helpers/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,23 @@ pub trait EthTransactions: LoadTransaction<Provider: BlockReaderIdExt> {

/// WVM Exclusive
/// Obtains the Arweave Hash of the transaction containing the WEVM Block
fn get_arweave_storage_proof(
&self,
block_height: String,
) -> impl Future<Output = Result<String, EthApiError>> + Send
fn get_arweave_storage_proof(&self, block_height: String,) -> impl Future<Output = Result<String, EthApiError>> + Send
where
Self: EthApiSpec + LoadBlock + LoadPendingBlock + Call,
{
Self: EthApiSpec + LoadBlock + LoadPendingBlock + Call {
let bq_client = (&*PRECOMPILE_WVM_BIGQUERY_CLIENT).clone();

async move {
match bq_client.bq_query_state(block_height.clone()).await {
Some(arweave_id) => Ok(arweave_id),
None => Err(EthApiError::TransactionNotFound),
let result_set = bq_client.bq_query_block(block_height).await;

match result_set {
Some(result_set) => {
match result_set.get_string_by_name("arweave_id") {
Ok(Some(arweave_id)) => Ok(arweave_id), // Successfully found the string
Ok(None) => Err(EthApiError::TransactionNotFound), // Field missing
Err(err) => Err(EthApiError::TransactionNotFound), // Handle the inner error
}
}
None => Err(EthApiError::TransactionNotFound), // Result set is None
}
}
}
Expand Down

0 comments on commit fcf7967

Please sign in to comment.