Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverted changes in BroadcastDeclareTxnV3 #604

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions rpc/types_broadcast_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,23 @@ func (tx BroadcastDeclareTxnV2) GetContractClass() interface{} {
}

type BroadcastDeclareTxnV3 struct {
DeclareTxnV3
ContractClass *ContractClass `json:"contract_class"`
Type TransactionType `json:"type"`
SenderAddress *felt.Felt `json:"sender_address"`
CompiledClassHash *felt.Felt `json:"compiled_class_hash"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
ContractClass *ContractClass `json:"contract_class"`
ResourceBounds ResourceBoundsMapping `json:"resource_bounds"`
Tip U64 `json:"tip"`
// The data needed to allow the paymaster to pay for the transaction in native tokens
PayMasterData []*felt.Felt `json:"paymaster_data"`
// The data needed to deploy the account contract from which this tx will be initiated
AccountDeploymentData []*felt.Felt `json:"account_deployment_data"`
// The storage domain of the account's nonce (an account has a nonce per DA mode)
NonceDataMode DataAvailabilityMode `json:"nonce_data_availability_mode"`
// The storage domain of the account's balance from which fee will be charged
FeeMode DataAvailabilityMode `json:"fee_data_availability_mode"`
}

func (tx BroadcastDeclareTxnV3) GetContractClass() interface{} {
Expand Down
44 changes: 21 additions & 23 deletions rpc/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,28 @@ func TestDeclareTransaction(t *testing.T) {
},
{
DeclareTx: BroadcastDeclareTxnV3{
DeclareTxnV3: DeclareTxnV3{
Type: TransactionType_Declare,
Version: TransactionV3,
Signature: []*felt.Felt{},
Nonce: utils.TestHexToFelt(t, "0x0"),
NonceDataMode: DAModeL1,
FeeMode: DAModeL1,
ResourceBounds: ResourceBoundsMapping{
L1Gas: ResourceBounds{
MaxAmount: "0x0",
MaxPricePerUnit: "0x0",
},
L2Gas: ResourceBounds{
MaxAmount: "0x0",
MaxPricePerUnit: "0x0",
},
Type: TransactionType_Declare,
Version: TransactionV3,
Signature: []*felt.Felt{},
Nonce: utils.TestHexToFelt(t, "0x0"),
NonceDataMode: DAModeL1,
FeeMode: DAModeL1,
ResourceBounds: ResourceBoundsMapping{
L1Gas: ResourceBounds{
MaxAmount: "0x0",
MaxPricePerUnit: "0x0",
},
Tip: "",
PayMasterData: []*felt.Felt{},
SenderAddress: utils.TestHexToFelt(t, "0x0"),
CompiledClassHash: utils.TestHexToFelt(t, "0x0"),
ClassHash: utils.TestHexToFelt(t, "0x0"),
AccountDeploymentData: []*felt.Felt{},
}},
L2Gas: ResourceBounds{
MaxAmount: "0x0",
MaxPricePerUnit: "0x0",
},
},
Tip: "",
PayMasterData: []*felt.Felt{},
SenderAddress: utils.TestHexToFelt(t, "0x0"),
CompiledClassHash: utils.TestHexToFelt(t, "0x0"),
AccountDeploymentData: []*felt.Felt{},
},
ExpectedResp: AddDeclareTransactionResponse{
TransactionHash: utils.TestHexToFelt(t, "0x41d1f5206ef58a443e7d3d1ca073171ec25fa75313394318fc83a074a6631c3")},
ExpectedError: nil,
Expand Down
Loading