Skip to content

Commit

Permalink
feat: 🎨 Changelog update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbelleng committed Feb 17, 2024
1 parent 8960a6e commit 7acc264
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ git # Madara Changelog
- feat: add transparent representation to `Felt252Wrapper`
- feat(rpc/trace_api): add `trace_block_transaction`
- chore(db): changed the way hashes are encoded
- feat: add DeployTransaction implementation

## v0.7.0

Expand Down
4 changes: 2 additions & 2 deletions crates/client/rpc/src/trace_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ fn tx_execution_infos_to_tx_trace<B: BlockT>(
// TODO(#1291): Compute state diff correctly
state_diff: None,
}),
TxType::Deploy => todo!(), /* TODO: Implement this using Starknet-rs old commits (becareful, Receipt version
* exist but here we need a trace) */
TxType::Deploy => todo!(), // TODO: Implement this using Starknet-rs old commits (becareful, Receipt version
// exist but here we need a trace)
TxType::DeployAccount => {
TransactionTrace::DeployAccount(DeployAccountTransactionTrace {
validate_invocation,
Expand Down
31 changes: 14 additions & 17 deletions crates/pallets/starknet/src/transaction_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,20 @@ impl<T: Config> Pallet<T> {

match transaction {
UserOrL1HandlerTransaction::User(transaction) => {
let validation_result = match transaction {
// There is no way to validate it before the account is actuallly deployed
UserTransaction::DeployAccount(_) => Ok(None),
UserTransaction::Deploy(_) => Ok(None), /* TODO : Verify this (an account can do a
* DeployTransaction without being declared first?) */
UserTransaction::Declare(tx, contract_class) => tx
.try_into_executable::<T::SystemHash>(chain_id, contract_class.clone(), false)
.map_err(|_| InvalidTransaction::BadProof)?
.validate_tx(&mut state, &block_context, &mut execution_resources, &mut initial_gas, false),
UserTransaction::Invoke(tx) => tx.into_executable::<T::SystemHash>(chain_id, false).validate_tx(
&mut state,
&block_context,
&mut execution_resources,
&mut initial_gas,
false,
),
};
let validation_result =
match transaction {
// There is no way to validate it before the account is actuallly deployed
UserTransaction::DeployAccount(_) => Ok(None),
UserTransaction::Deploy(_) => Ok(None), // TODO : Verify this (an account can do a
// DeployTransaction without being declared first?)
UserTransaction::Declare(tx, contract_class) => tx
.try_into_executable::<T::SystemHash>(chain_id, contract_class.clone(), false)
.map_err(|_| InvalidTransaction::BadProof)?
.validate_tx(&mut state, &block_context, &mut execution_resources, &mut initial_gas, false),
UserTransaction::Invoke(tx) => tx
.into_executable::<T::SystemHash>(chain_id, false)
.validate_tx(&mut state, &block_context, &mut execution_resources, &mut initial_gas, false),
};

if let Err(TransactionExecutionError::ValidateTransactionError(
EntryPointExecutionError::PreExecutionError(PreExecutionError::UninitializedStorageAddress(
Expand Down

0 comments on commit 7acc264

Please sign in to comment.