Skip to content

Commit

Permalink
Declare Tx rpcv4
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Aug 21, 2023
1 parent e409e6e commit e3b7d94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rpc/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) {
},
Status: "ACCEPTED_ON_L1",
Transactions: []Transaction{
DeclareTxn{
DeclareTxnV1{
CommonTransaction: CommonTransaction{
TransactionHash: utils.TestHexToFelt(t, "0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"),
BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{
Expand Down Expand Up @@ -515,7 +515,7 @@ func TestCaptureUnsupportedBlockTxn(t *testing.T) {
_, okv1 := v.(InvokeTxnV1)
_, okv0 := v.(InvokeTxnV0)
_, okl1 := v.(L1HandlerTxn)
_, okdec := v.(DeclareTxn)
_, okdec := v.(DeclareTxnV1)
_, okdep := v.(DeployTxn)
_, okdepac := v.(DeployAccountTxn)
if !okv0 && !okv1 && !okl1 && !okdec && !okdep && !okdepac {
Expand Down
2 changes: 1 addition & 1 deletion rpc/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func adaptTransaction(t TXN) (Transaction, error) {
json.Unmarshal(txMarshalled, &tx)
return tx, nil
case TransactionType_Declare:
var tx DeclareTxn
var tx DeclareTxnV1
json.Unmarshal(txMarshalled, &tx)
return tx, nil
case TransactionType_DeployAccount:
Expand Down
6 changes: 3 additions & 3 deletions rpc/types_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (tx L1HandlerTxn) Hash() *felt.Felt {
return tx.TransactionHash
}

type DeclareTxn struct {
type DeclareTxnV1 struct {
CommonTransaction

// ClassHash the hash of the declared class
Expand All @@ -103,7 +103,7 @@ type DeclareTxn struct {
SenderAddress *felt.Felt `json:"sender_address"`
}

func (tx DeclareTxn) Hash() *felt.Felt {
func (tx DeclareTxnV1) Hash() *felt.Felt {
return tx.TransactionHash
}

Expand Down Expand Up @@ -195,7 +195,7 @@ func unmarshalTxn(t interface{}) (Transaction, error) {
case map[string]interface{}:
switch TransactionType(casted["type"].(string)) {
case TransactionType_Declare:
var txn DeclareTxn
var txn DeclareTxnV1
remarshal(casted, &txn)
return txn, nil
case TransactionType_Deploy:
Expand Down

0 comments on commit e3b7d94

Please sign in to comment.