Skip to content

Commit

Permalink
rpcv05 update DeclareTxn types (#421)
Browse files Browse the repository at this point in the history
* rpcv05 update DeclareTxn types

* fix account err

---------

Co-authored-by: Carmen Irene Cabrera Rodríguez <[email protected]>
  • Loading branch information
rianhughes and cicr99 committed Oct 20, 2023
1 parent 1e4b860 commit 4395faa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
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

0 comments on commit 4395faa

Please sign in to comment.