Skip to content

Commit

Permalink
hooker: cargo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ybensacq committed Aug 9, 2024
1 parent a63f93f commit 1e01356
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
21 changes: 11 additions & 10 deletions bin/solis/src/hooker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,17 @@ impl<P: Provider + Sync + Send + 'static + std::fmt::Debug, EF: ExecutorFactory>
}

// ERC20 to ERC721 : we check the allowance and the offerer balance.
if order.route == RouteType::Erc20ToErc721 && !self
.verify_balance(&BalanceVerifier {
currency_address: ContractAddress(order.currency_address.into()),
offerer: cainome::cairo_serde::ContractAddress(order.offerer.into()),
start_amount: U256 {
low: order.start_amount.low,
high: order.start_amount.high,
},
})
.await
if order.route == RouteType::Erc20ToErc721
&& !self
.verify_balance(&BalanceVerifier {
currency_address: ContractAddress(order.currency_address.into()),
offerer: cainome::cairo_serde::ContractAddress(order.offerer.into()),
start_amount: U256 {
low: order.start_amount.low,
high: order.start_amount.high,
},
})
.await
{
println!("verify balance for starknet before failed");
return false;
Expand Down
6 changes: 3 additions & 3 deletions crates/katana/rpc/rpc/src/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ use katana_rpc_types::{
use katana_rpc_types_builder::ReceiptBuilder;
use katana_tasks::{BlockingTaskPool, TokioTaskSpawner};
use starknet::core::types::{
BlockTag, DeclareTransactionTrace, DeployAccountTransactionTrace,
ExecuteInvocation, InvokeTransactionTrace, L1HandlerTransactionTrace, RevertedInvocation,
SimulatedTransaction, TransactionExecutionStatus, TransactionStatus, TransactionTrace,
BlockTag, DeclareTransactionTrace, DeployAccountTransactionTrace, ExecuteInvocation,
InvokeTransactionTrace, L1HandlerTransactionTrace, RevertedInvocation, SimulatedTransaction,
TransactionExecutionStatus, TransactionStatus, TransactionTrace,
};

pub struct StarknetApi<EF: ExecutorFactory> {
Expand Down

0 comments on commit 1e01356

Please sign in to comment.