-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1319 from eqlabs/fix-1316
fix: RPC v0.4 is missing tx changes from v0.3
- Loading branch information
Showing
18 changed files
with
1,274 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
pub use crate::BlockHash; | ||
pub use crate::BlockHeader; | ||
pub use crate::BlockNumber; | ||
pub use crate::BlockTimestamp; | ||
pub use crate::ByteCodeOffset; | ||
pub use crate::CallParam; | ||
pub use crate::CallResultValue; | ||
pub use crate::CasmHash; | ||
pub use crate::ChainId; | ||
pub use crate::ClassCommitment; | ||
pub use crate::ClassCommitmentLeafHash; | ||
pub use crate::ClassHash; | ||
pub use crate::ConstructorParam; | ||
pub use crate::ContractAddress; | ||
pub use crate::ContractAddressSalt; | ||
pub use crate::ContractClass; | ||
pub use crate::ContractNonce; | ||
pub use crate::ContractRoot; | ||
pub use crate::ContractStateHash; | ||
pub use crate::EntryPoint; | ||
pub use crate::EthereumAddress; | ||
pub use crate::EventCommitment; | ||
pub use crate::EventData; | ||
pub use crate::EventKey; | ||
pub use crate::Fee; | ||
pub use crate::FromSliceError; | ||
pub use crate::GasPrice; | ||
pub use crate::L1ToL2MessageNonce; | ||
pub use crate::L1ToL2MessagePayloadElem; | ||
pub use crate::L2ToL1MessagePayloadElem; | ||
pub use crate::SequencerAddress; | ||
pub use crate::SierraHash; | ||
pub use crate::StarknetVersion; | ||
pub use crate::StateCommitment; | ||
pub use crate::StateUpdate; | ||
pub use crate::StorageAddress; | ||
pub use crate::StorageCommitment; | ||
pub use crate::StorageValue; | ||
pub use crate::TransactionCommitment; | ||
pub use crate::TransactionHash; | ||
pub use crate::TransactionIndex; | ||
pub use crate::TransactionNonce; | ||
pub use crate::TransactionSignatureElem; | ||
pub use crate::TransactionVersion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
use crate::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq)] | ||
pub struct Transaction { | ||
pub hash: TransactionHash, | ||
pub variant: TransactionVariant, | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq)] | ||
pub enum TransactionVariant { | ||
DeclareV0(DeclareTransactionV0V1), | ||
DeclareV1(DeclareTransactionV0V1), | ||
DeclareV2(DeclareTransactionV2), | ||
// Regenesis: deploy is a legacy variant and can be removed after regenesis. | ||
Deploy(DeployTransaction), | ||
DeployAccount(DeployAccountTransaction), | ||
InvokeV0(InvokeTransactionV0), | ||
InvokeV1(InvokeTransactionV1), | ||
L1Handler(L1HandlerTransaction), | ||
} | ||
|
||
impl From<DeclareTransactionV2> for TransactionVariant { | ||
fn from(value: DeclareTransactionV2) -> Self { | ||
Self::DeclareV2(value) | ||
} | ||
} | ||
impl From<DeployTransaction> for TransactionVariant { | ||
fn from(value: DeployTransaction) -> Self { | ||
Self::Deploy(value) | ||
} | ||
} | ||
impl From<DeployAccountTransaction> for TransactionVariant { | ||
fn from(value: DeployAccountTransaction) -> Self { | ||
Self::DeployAccount(value) | ||
} | ||
} | ||
impl From<InvokeTransactionV0> for TransactionVariant { | ||
fn from(value: InvokeTransactionV0) -> Self { | ||
Self::InvokeV0(value) | ||
} | ||
} | ||
impl From<InvokeTransactionV1> for TransactionVariant { | ||
fn from(value: InvokeTransactionV1) -> Self { | ||
Self::InvokeV1(value) | ||
} | ||
} | ||
impl From<L1HandlerTransaction> for TransactionVariant { | ||
fn from(value: L1HandlerTransaction) -> Self { | ||
Self::L1Handler(value) | ||
} | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct DeclareTransactionV0V1 { | ||
pub class_hash: ClassHash, | ||
pub max_fee: Fee, | ||
pub nonce: TransactionNonce, | ||
pub sender_address: ContractAddress, | ||
pub signature: Vec<TransactionSignatureElem>, | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct DeclareTransactionV2 { | ||
pub class_hash: ClassHash, | ||
pub max_fee: Fee, | ||
pub nonce: TransactionNonce, | ||
pub sender_address: ContractAddress, | ||
pub signature: Vec<TransactionSignatureElem>, | ||
pub compiled_class_hash: CasmHash, | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct DeployTransaction { | ||
pub contract_address: ContractAddress, | ||
pub contract_address_salt: ContractAddressSalt, | ||
pub class_hash: ClassHash, | ||
pub constructor_calldata: Vec<ConstructorParam>, | ||
pub version: TransactionVersion, | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct DeployAccountTransaction { | ||
pub contract_address: ContractAddress, | ||
pub max_fee: Fee, | ||
pub version: TransactionVersion, | ||
pub signature: Vec<TransactionSignatureElem>, | ||
pub nonce: TransactionNonce, | ||
pub contract_address_salt: ContractAddressSalt, | ||
pub constructor_calldata: Vec<CallParam>, | ||
pub class_hash: ClassHash, | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct InvokeTransactionV0 { | ||
pub calldata: Vec<CallParam>, | ||
pub sender_address: ContractAddress, | ||
pub entry_point_selector: EntryPoint, | ||
pub entry_point_type: Option<EntryPointType>, | ||
pub max_fee: Fee, | ||
pub signature: Vec<TransactionSignatureElem>, | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct InvokeTransactionV1 { | ||
pub calldata: Vec<CallParam>, | ||
pub sender_address: ContractAddress, | ||
pub max_fee: Fee, | ||
pub signature: Vec<TransactionSignatureElem>, | ||
pub nonce: TransactionNonce, | ||
} | ||
|
||
#[derive(Clone, Default, Debug, PartialEq, Eq)] | ||
pub struct L1HandlerTransaction { | ||
pub contract_address: ContractAddress, | ||
pub entry_point_selector: EntryPoint, | ||
pub nonce: TransactionNonce, | ||
pub calldata: Vec<CallParam>, | ||
pub version: TransactionVersion, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, PartialEq, Eq)] | ||
pub enum EntryPointType { | ||
External, | ||
L1Handler, | ||
} |
Oops, something went wrong.