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

rpcv05 update DeclareTxn types #421

Merged
merged 3 commits into from
Oct 20, 2023
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
1 change: 0 additions & 1 deletion account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,6 @@ func TestAddDeclareTxn(t *testing.T) {
SenderAddress: AccountAddress,
CompiledClassHash: compClassHash,
ClassHash: classHash,
ContractClass: class,
}

err = acnt.SignDeclareTransaction(context.Background(), &tx)
Expand Down
56 changes: 22 additions & 34 deletions rpc/types_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,49 +56,37 @@ type L1HandlerTxn struct {
}

type DeclareTxnV0 struct {
MaxFee *felt.Felt `json:"max_fee"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
Type TransactionType `json:"type"`

Type TransactionType `json:"type"`
// SenderAddress the address of the account contract sending the declaration transaction
SenderAddress *felt.Felt `json:"sender_address"`

DeprecatedContractClass `json:"contract_class,omitempty"`
ClassHash *felt.Felt `json:"class_hash,omitempty"`
SenderAddress *felt.Felt `json:"sender_address"`
MaxFee *felt.Felt `json:"max_fee"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
ClassHash *felt.Felt `json:"class_hash"`
}

type DeclareTxnV1 struct {
MaxFee *felt.Felt `json:"max_fee"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
Type TransactionType `json:"type"`

// ClassHash the hash of the declared class
ClassHash *felt.Felt `json:"class_hash,omitempty"`

DeprecatedContractClass `json:"contract_class,omitempty"`

Type TransactionType `json:"type"`
// SenderAddress the address of the account contract sending the declaration transaction
SenderAddress *felt.Felt `json:"sender_address"`
SenderAddress *felt.Felt `json:"sender_address"`
MaxFee *felt.Felt `json:"max_fee"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
// ClassHash the hash of the declared class
ClassHash *felt.Felt `json:"class_hash"`
}

type DeclareTxnV2 struct {
MaxFee *felt.Felt `json:"max_fee"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
Type TransactionType `json:"type"`

Type TransactionType `json:"type"`
// SenderAddress the address of the account contract sending the declaration transaction
SenderAddress *felt.Felt `json:"sender_address"`

CompiledClassHash *felt.Felt `json:"compiled_class_hash"`

ContractClass `json:"contract_class,omitempty"`
ClassHash *felt.Felt `json:"class_hash,omitempty"`
SenderAddress *felt.Felt `json:"sender_address"`
CompiledClassHash *felt.Felt `json:"compiled_class_hash"`
MaxFee *felt.Felt `json:"max_fee"`
Version TransactionVersion `json:"version"`
Signature []*felt.Felt `json:"signature"`
Nonce *felt.Felt `json:"nonce"`
ClassHash *felt.Felt `json:"class_hash"`
}

// DeployTxn The structure of a deploy transaction. Note that this transaction type is deprecated and will no longer be supported in future versions
Expand Down