From 9535312daf0bea0faa110656427656360c58867e Mon Sep 17 00:00:00 2001 From: rianhughes Date: Mon, 21 Aug 2023 12:49:40 +0300 Subject: [PATCH 1/5] Implement DeclareTxn rpcv04 --- rpc/block_test.go | 79 ++++++++++++++++++++++++++++++++++++++-- rpc/transaction.go | 21 +++++++++-- rpc/types_contract.go | 19 ++++++++++ rpc/types_transaction.go | 57 ++++++++++++++++++++++++++--- 4 files changed, 165 insertions(+), 11 deletions(-) diff --git a/rpc/block_test.go b/rpc/block_test.go index 0f634e0f..e542c833 100644 --- a/rpc/block_test.go +++ b/rpc/block_test.go @@ -351,7 +351,7 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { }, Status: "ACCEPTED_ON_L1", Transactions: []Transaction{ - DeclareTxn{ + DeclareTxnV0{ CommonTransaction: CommonTransaction{ TransactionHash: utils.TestHexToFelt(t, "0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ @@ -368,6 +368,63 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { }, } + var fullBlockGoerli848622 = Block{ + BlockHeader: BlockHeader{ + BlockHash: utils.TestHexToFelt(t, "0x32964e2e407bb9e71b2de8d9d9829b0537df7c4624e1816e6cece80781ab9cc"), + ParentHash: utils.TestHexToFelt(t, "0xecbed6cfe85c77f2f8acefe2effbda817f71ca7457f7ece8262d65cc87a9f7"), + SequencerAddress: utils.TestHexToFelt(t, "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8"), + BlockNumber: 848622, + NewRoot: utils.TestHexToFelt(t, "07c4302f09f6a72129679378e9b8d6c67774c5c4e80b1fc186da114f71637b2e"), + Timestamp: 1692416283, + }, + Status: "ACCEPTED_ON_L1", + Transactions: []Transaction{ + DeclareTxnV1{ + CommonTransaction: CommonTransaction{ + TransactionHash: utils.TestHexToFelt(t, "0x5ad2f85499ea92d33d4a44c8cd4640d1ee4e25c3ee6df0bdf0a76c12c052f0a"), + BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ + Type: TransactionType_Declare, + MaxFee: utils.TestHexToFelt(t, "0x27a64c6e425"), + Version: TransactionV1, + Signature: []*felt.Felt{utils.TestHexToFelt(t, "0x1454ab28f0bf18f0fd8002bc92169e6443feba6c605728c86850c0dcc9f6f9a"), utils.TestHexToFelt(t, "0xf545949c899ff1d16c61629996e898db2697a2e3e7fa9071b016500ca5c1d1")}, + Nonce: utils.TestHexToFelt(t, "0x333"), + }, + }, + ClassHash: utils.TestHexToFelt(t, "0x681076f783aa2b3faec6ce80bb5485a260ed1672007925e1d502b003aff2232"), + SenderAddress: utils.TestHexToFelt(t, "0x45dba6ce6a4dc3d2f31aa6da5f51007f1e43e84a1e62c4481bac5454dea4e6d"), + }, + }, + } + + var fullBlockGoerli849399 = Block{ + BlockHeader: BlockHeader{ + BlockHash: utils.TestHexToFelt(t, "0x6e5b26127400bac0cd1f3c2ab6e76850ec457c71b1f2fc7cda755bee8a1102a"), + ParentHash: utils.TestHexToFelt(t, "0x7cd085d4ab95b3307303cb836ab49c0fbc8d1f9befdcfdc65292d99c9466d05"), + SequencerAddress: utils.TestHexToFelt(t, "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8"), + BlockNumber: 849399, + NewRoot: utils.TestHexToFelt(t, "0x239a44410e78665f41f7a65ef3b5ed244ce411965498a83f80f904e22df1045"), + Timestamp: 1692560305, + }, + Status: "ACCEPTED_ON_L1", + Transactions: []Transaction{ + DeclareTxnV2{ + CommonTransaction: CommonTransaction{ + TransactionHash: utils.TestHexToFelt(t, "0x45d04652ba51685b7b82fc17b3d5741a7c43992369c0b0aebd60916fa23b9b2"), + BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ + Type: TransactionType_Declare, + MaxFee: utils.TestHexToFelt(t, "0x50c8f30287c"), + Version: TransactionV2, + Signature: []*felt.Felt{utils.TestHexToFelt(t, "0x6be01a56087382337a29fd4577dd20fd82cc9f38f69b8d19e07fc101c3c5ad9"), utils.TestHexToFelt(t, "0x4c633a5582d3932fbfcea8abd45c7453e88a562f1a38877b9575d6a6b926ea2")}, + Nonce: utils.TestHexToFelt(t, "0xd"), + }, + }, + ClassHash: utils.TestHexToFelt(t, "0x6fda8f6630f44571cd6b398795351b37daf27adacbf6fe9357bd23ad19b22f3"), + CompiledClassHash: utils.TestHexToFelt(t, "0x4380d7c6511f81668530570a8b07bd2148808f90e681bb769549ec4faafef65"), + SenderAddress: utils.TestHexToFelt(t, "0x6ef69146f56205e27624a9933f31d6009198c1ea480070a790f16a5d928be92"), + }, + }, + } + testSet := map[string][]testSetType{ "mock": {}, "testnet": { @@ -396,6 +453,20 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { LookupTxnPositionInExpected: 0, ExpectedBlockWithTxs: &fullBlockGoerli300114, }, + { + BlockID: WithBlockNumber(849399), + ExpectedError: nil, + LookupTxnPositionInOriginal: 71, + LookupTxnPositionInExpected: 0, + ExpectedBlockWithTxs: &fullBlockGoerli849399, + }, + { + BlockID: WithBlockNumber(848622), + ExpectedError: nil, + LookupTxnPositionInOriginal: 6, + LookupTxnPositionInExpected: 0, + ExpectedBlockWithTxs: &fullBlockGoerli848622, + }, }, "mainnet": {}, }[testEnv] @@ -515,10 +586,12 @@ func TestCaptureUnsupportedBlockTxn(t *testing.T) { _, okv1 := v.(InvokeTxnV1) _, okv0 := v.(InvokeTxnV0) _, okl1 := v.(L1HandlerTxn) - _, okdec := v.(DeclareTxn) + _, okdec0 := v.(DeclareTxnV0) + _, okdec1 := v.(DeclareTxnV1) + _, okdec2 := v.(DeclareTxnV2) _, okdep := v.(DeployTxn) _, okdepac := v.(DeployAccountTxn) - if !okv0 && !okv1 && !okl1 && !okdec && !okdep && !okdepac { + if !okv0 && !okv1 && !okl1 && !okdec0 && !okdec1 && !okdec2 && !okdep && !okdepac { t.Fatalf("New Type Detected %T at Block(%d)/Txn(%d)", v, i, k) } } diff --git a/rpc/transaction.go b/rpc/transaction.go index 6c9bf6c3..c8062399 100644 --- a/rpc/transaction.go +++ b/rpc/transaction.go @@ -21,9 +21,24 @@ func adaptTransaction(t TXN) (Transaction, error) { json.Unmarshal(txMarshalled, &tx) return tx, nil case TransactionType_Declare: - var tx DeclareTxn - json.Unmarshal(txMarshalled, &tx) - return tx, nil + + switch t.Version { + case &felt.Zero: + var tx DeclareTxnV0 + json.Unmarshal(txMarshalled, &tx) + return tx, nil + case felt.Zero.SetUint64(1): + var tx DeclareTxnV1 + json.Unmarshal(txMarshalled, &tx) + return tx, nil + case felt.Zero.SetUint64(2): + var tx DeclareTxnV2 + json.Unmarshal(txMarshalled, &tx) + return tx, nil + default: + return nil, errors.New("Internal error with adaptTransaction()") + } + case TransactionType_DeployAccount: var tx DeployAccountTxn json.Unmarshal(txMarshalled, &tx) diff --git a/rpc/types_contract.go b/rpc/types_contract.go index a929acf1..16550cc5 100644 --- a/rpc/types_contract.go +++ b/rpc/types_contract.go @@ -27,6 +27,25 @@ type EntryPointsByType struct { L1Handler []EntryPoint `json:"L1_HANDLER"` } +type DeprecatedContractClass struct { + // Program A base64 representation of the compressed program code + Program string `json:"program"` + + EntryPointsByType EntryPointsByType `json:"entry_points_by_type"` + + ABI *ABI `json:"abi,omitempty"` +} + +type ContractClassTemp struct { + SierraProgram []*felt.Felt `json:"sierra_program"` + + ContractClassVersion string `json:"contract_class_version"` + + EntryPointsByType EntryPointsByType `json:"entry_points_by_type"` + + ABI *ABI `json:"abi,omitempty"` +} + type ContractClass struct { // Program A base64 representation of the compressed program code Program string `json:"program"` diff --git a/rpc/types_transaction.go b/rpc/types_transaction.go index 6c8c6e66..cc6040b6 100644 --- a/rpc/types_transaction.go +++ b/rpc/types_transaction.go @@ -93,17 +93,48 @@ func (tx L1HandlerTxn) Hash() *felt.Felt { return tx.TransactionHash } -type DeclareTxn struct { +type DeclareTxnV0 struct { + CommonTransaction + + // 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"` +} + +type DeclareTxnV1 struct { CommonTransaction // ClassHash the hash of the declared class ClassHash *felt.Felt `json:"class_hash"` + DeprecatedContractClass `json:"contract_class"` + // SenderAddress the address of the account contract sending the declaration transaction SenderAddress *felt.Felt `json:"sender_address"` } -func (tx DeclareTxn) Hash() *felt.Felt { +type DeclareTxnV2 struct { + CommonTransaction + + // SenderAddress the address of the account contract sending the declaration transaction + SenderAddress *felt.Felt `json:"sender_address"` + + CompiledClassHash *felt.Felt `json:"compiled_class_hash"` + + ContractClassTemp `json:"contract_class,omitempty"` + ClassHash *felt.Felt `json:"class_hash,omitempty"` +} + +func (tx DeclareTxnV0) Hash() *felt.Felt { + return tx.TransactionHash +} + +func (tx DeclareTxnV1) Hash() *felt.Felt { + return tx.TransactionHash +} +func (tx DeclareTxnV2) Hash() *felt.Felt { return tx.TransactionHash } @@ -195,9 +226,24 @@ func unmarshalTxn(t interface{}) (Transaction, error) { case map[string]interface{}: switch TransactionType(casted["type"].(string)) { case TransactionType_Declare: - var txn DeclareTxn - remarshal(casted, &txn) - return txn, nil + + switch TransactionType(casted["version"].(string)) { + case "0x0": + var txn DeclareTxnV0 + remarshal(casted, &txn) + return txn, nil + case "0x1": + var txn DeclareTxnV1 + remarshal(casted, &txn) + return txn, nil + case "0x2": + var txn DeclareTxnV2 + remarshal(casted, &txn) + return txn, nil + default: + return nil, errors.New("Internal error with Declare transaction version and unmarshalTxn()") + } + case TransactionType_Deploy: var txn DeployTxn remarshal(casted, &txn) @@ -245,6 +291,7 @@ type TransactionVersion string const ( TransactionV0 TransactionVersion = "0x0" TransactionV1 TransactionVersion = "0x1" + TransactionV2 TransactionVersion = "0x2" ) func (v *TransactionVersion) BigInt() (*big.Int, error) { From a1219a4955ac955047d754d85a0318c59dc1ffc6 Mon Sep 17 00:00:00 2001 From: rianhughes Date: Tue, 22 Aug 2023 13:59:40 +0300 Subject: [PATCH 2/5] rpcv03_declareTxn --- rpc/block_test.go | 42 +++------------------------------------- rpc/transaction.go | 5 ----- rpc/types_transaction.go | 18 ----------------- 3 files changed, 3 insertions(+), 62 deletions(-) diff --git a/rpc/block_test.go b/rpc/block_test.go index e542c833..ebb20604 100644 --- a/rpc/block_test.go +++ b/rpc/block_test.go @@ -340,34 +340,6 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { }, } - var fullBlockGoerli300114 = Block{ - BlockHeader: BlockHeader{ - BlockHash: utils.TestHexToFelt(t, "0x184268bfbce24766fa53b65c9c8b30b295e145e8281d543a015b46308e27fdf"), - ParentHash: utils.TestHexToFelt(t, "0x7307cb0d7fa65c111e71cdfb6209bdc90d2454d4c0f34d8bf5a3fe477826c3c"), - SequencerAddress: utils.TestHexToFelt(t, "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b"), - BlockNumber: 300114, - NewRoot: utils.TestHexToFelt(t, "0x239a44410e78665f41f7a65ef3b5ed244ce411965498a83f80f904e22df1045"), - Timestamp: 1660701246, - }, - Status: "ACCEPTED_ON_L1", - Transactions: []Transaction{ - DeclareTxnV0{ - CommonTransaction: CommonTransaction{ - TransactionHash: utils.TestHexToFelt(t, "0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), - BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ - Type: TransactionType_Declare, - MaxFee: &felt.Zero, - Version: TransactionV0, - Signature: []*felt.Felt{}, - Nonce: &felt.Zero, - }, - }, - ClassHash: utils.TestHexToFelt(t, "0x6feb117d1c3032b0ae7bd3b50cd8ec4a78c621dca0d63ddc17890b78a6c3b49"), - SenderAddress: utils.TestHexToFelt(t, "0x1"), - }, - }, - } - var fullBlockGoerli848622 = Block{ BlockHeader: BlockHeader{ BlockHash: utils.TestHexToFelt(t, "0x32964e2e407bb9e71b2de8d9d9829b0537df7c4624e1816e6cece80781ab9cc"), @@ -446,13 +418,6 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { LookupTxnPositionInExpected: 0, ExpectedBlockWithTxs: &fullBlockGoerli310843, }, - { - BlockID: WithBlockNumber(300114), - ExpectedError: nil, - LookupTxnPositionInOriginal: 3, - LookupTxnPositionInExpected: 0, - ExpectedBlockWithTxs: &fullBlockGoerli300114, - }, { BlockID: WithBlockNumber(849399), ExpectedError: nil, @@ -566,8 +531,8 @@ func TestCaptureUnsupportedBlockTxn(t *testing.T) { "mock": {}, "testnet": { { - StartBlock: 375919, - EndBlock: 376000, + StartBlock: 381000, + EndBlock: 381001, }, }, "mainnet": {}, @@ -586,12 +551,11 @@ func TestCaptureUnsupportedBlockTxn(t *testing.T) { _, okv1 := v.(InvokeTxnV1) _, okv0 := v.(InvokeTxnV0) _, okl1 := v.(L1HandlerTxn) - _, okdec0 := v.(DeclareTxnV0) _, okdec1 := v.(DeclareTxnV1) _, okdec2 := v.(DeclareTxnV2) _, okdep := v.(DeployTxn) _, okdepac := v.(DeployAccountTxn) - if !okv0 && !okv1 && !okl1 && !okdec0 && !okdec1 && !okdec2 && !okdep && !okdepac { + if !okv0 && !okv1 && !okl1 && !okdec1 && !okdec2 && !okdep && !okdepac { t.Fatalf("New Type Detected %T at Block(%d)/Txn(%d)", v, i, k) } } diff --git a/rpc/transaction.go b/rpc/transaction.go index c8062399..9957f8c0 100644 --- a/rpc/transaction.go +++ b/rpc/transaction.go @@ -21,12 +21,7 @@ func adaptTransaction(t TXN) (Transaction, error) { json.Unmarshal(txMarshalled, &tx) return tx, nil case TransactionType_Declare: - switch t.Version { - case &felt.Zero: - var tx DeclareTxnV0 - json.Unmarshal(txMarshalled, &tx) - return tx, nil case felt.Zero.SetUint64(1): var tx DeclareTxnV1 json.Unmarshal(txMarshalled, &tx) diff --git a/rpc/types_transaction.go b/rpc/types_transaction.go index cc6040b6..7b465d70 100644 --- a/rpc/types_transaction.go +++ b/rpc/types_transaction.go @@ -93,16 +93,6 @@ func (tx L1HandlerTxn) Hash() *felt.Felt { return tx.TransactionHash } -type DeclareTxnV0 struct { - CommonTransaction - - // 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"` -} - type DeclareTxnV1 struct { CommonTransaction @@ -127,10 +117,6 @@ type DeclareTxnV2 struct { ClassHash *felt.Felt `json:"class_hash,omitempty"` } -func (tx DeclareTxnV0) Hash() *felt.Felt { - return tx.TransactionHash -} - func (tx DeclareTxnV1) Hash() *felt.Felt { return tx.TransactionHash } @@ -228,10 +214,6 @@ func unmarshalTxn(t interface{}) (Transaction, error) { case TransactionType_Declare: switch TransactionType(casted["version"].(string)) { - case "0x0": - var txn DeclareTxnV0 - remarshal(casted, &txn) - return txn, nil case "0x1": var txn DeclareTxnV1 remarshal(casted, &txn) From 6ddec9f6ddbeb21260c939e53dc15cac74c6bd95 Mon Sep 17 00:00:00 2001 From: rianhughes Date: Mon, 4 Sep 2023 11:27:40 +0300 Subject: [PATCH 3/5] rpcv03 declare te comments --- rpc/transaction.go | 4 ++-- rpc/types_transaction.go | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/rpc/transaction.go b/rpc/transaction.go index 9957f8c0..9ef31fd0 100644 --- a/rpc/transaction.go +++ b/rpc/transaction.go @@ -22,11 +22,11 @@ func adaptTransaction(t TXN) (Transaction, error) { return tx, nil case TransactionType_Declare: switch t.Version { - case felt.Zero.SetUint64(1): + case new(felt.Felt).SetUint64(1): var tx DeclareTxnV1 json.Unmarshal(txMarshalled, &tx) return tx, nil - case felt.Zero.SetUint64(2): + case new(felt.Felt).SetUint64(2): var tx DeclareTxnV2 json.Unmarshal(txMarshalled, &tx) return tx, nil diff --git a/rpc/types_transaction.go b/rpc/types_transaction.go index 7b465d70..bc37d2cb 100644 --- a/rpc/types_transaction.go +++ b/rpc/types_transaction.go @@ -99,8 +99,6 @@ type DeclareTxnV1 struct { // ClassHash the hash of the declared class ClassHash *felt.Felt `json:"class_hash"` - DeprecatedContractClass `json:"contract_class"` - // SenderAddress the address of the account contract sending the declaration transaction SenderAddress *felt.Felt `json:"sender_address"` } @@ -108,13 +106,12 @@ type DeclareTxnV1 struct { type DeclareTxnV2 struct { CommonTransaction + ClassHash *felt.Felt `json:"class_hash,omitempty"` + // SenderAddress the address of the account contract sending the declaration transaction SenderAddress *felt.Felt `json:"sender_address"` CompiledClassHash *felt.Felt `json:"compiled_class_hash"` - - ContractClassTemp `json:"contract_class,omitempty"` - ClassHash *felt.Felt `json:"class_hash,omitempty"` } func (tx DeclareTxnV1) Hash() *felt.Felt { From 11e72b5b559298d11e388dadf5c3fe6a99114bfb Mon Sep 17 00:00:00 2001 From: rianhughes Date: Mon, 4 Sep 2023 11:30:20 +0300 Subject: [PATCH 4/5] rpcv03 declare tx comments --- rpc/types_contract.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rpc/types_contract.go b/rpc/types_contract.go index 16550cc5..72af7280 100644 --- a/rpc/types_contract.go +++ b/rpc/types_contract.go @@ -36,16 +36,6 @@ type DeprecatedContractClass struct { ABI *ABI `json:"abi,omitempty"` } -type ContractClassTemp struct { - SierraProgram []*felt.Felt `json:"sierra_program"` - - ContractClassVersion string `json:"contract_class_version"` - - EntryPointsByType EntryPointsByType `json:"entry_points_by_type"` - - ABI *ABI `json:"abi,omitempty"` -} - type ContractClass struct { // Program A base64 representation of the compressed program code Program string `json:"program"` From 9e41d54ef3fbe926c6ec430700d856dae5fbec63 Mon Sep 17 00:00:00 2001 From: Carmen Cabrera Date: Tue, 5 Sep 2023 08:12:26 -0400 Subject: [PATCH 5/5] remove deploy transaction --- rpc/block_test.go | 44 +------------------------------- rpc/types_transaction.go | 17 ------------ rpc/types_transaction_receipt.go | 1 - 3 files changed, 1 insertion(+), 61 deletions(-) diff --git a/rpc/block_test.go b/rpc/block_test.go index b71d475e..c85626c1 100644 --- a/rpc/block_test.go +++ b/rpc/block_test.go @@ -338,33 +338,6 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { } // To do : re-add test for deploy account transaction - var fullBlockGoerli310843 = Block{ - BlockHeader: BlockHeader{ - BlockHash: utils.TestHexToFelt(t, "0x424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9"), - ParentHash: utils.TestHexToFelt(t, "0x30e34dedf00bb35a9076b2b0f50a5a74fd2501f62094b6e687277be6ef3d444"), - SequencerAddress: utils.TestHexToFelt(t, "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b"), - BlockNumber: 310843, - NewRoot: utils.TestHexToFelt(t, "0x32bd4ff21288c898d4d3b6a7aea4ebdb3f1c7089cd52bde98316b4ecb8a50be"), - Timestamp: 1661486036, - }, - Status: "ACCEPTED_ON_L1", - Transactions: []Transaction{ - DeployTxn{ - TransactionHash: utils.TestHexToFelt(t, "0x35bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), - ClassHash: utils.TestHexToFelt(t, "0x1ca349f9721a2bf05012bb475b404313c497ca7d6d5f80c03e98ff31e9867f5"), - DeployTransactionProperties: DeployTransactionProperties{ - ConstructorCalldata: []*felt.Felt{ - utils.TestHexToFelt(t, "0x31ad196615d50956d98be085eb1774624106a6936c7c38696e730d2a6df735a"), - utils.TestHexToFelt(t, "0x736affc32af71f8d361c855b38ffef58ec151bd8361a3b160017b90ada1068e"), - }, - ContractAddressSalt: utils.TestHexToFelt(t, "0x4241e90ee6a33a1e2e70b088f7e4acfb3d6630964c1a85e96fa96acd56dcfcf"), - - Type: "DEPLOY", - Version: TransactionV0, - }, - }, - }, - } var fullBlockGoerli848622 = Block{ BlockHeader: BlockHeader{ @@ -430,20 +403,6 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { BlockID: WithBlockTag("latest"), ExpectedError: nil, }, - { - BlockID: WithBlockHash(utils.TestHexToFelt(t, "0x424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9")), - ExpectedError: nil, - LookupTxnPositionInOriginal: 14, - LookupTxnPositionInExpected: 0, - ExpectedBlockWithTxs: &fullBlockGoerli310843, - }, - { - BlockID: WithBlockNumber(310843), - ExpectedError: nil, - LookupTxnPositionInOriginal: 14, - LookupTxnPositionInExpected: 0, - ExpectedBlockWithTxs: &fullBlockGoerli310843, - }, { BlockID: WithBlockNumber(849399), ExpectedError: nil, @@ -579,9 +538,8 @@ func TestCaptureUnsupportedBlockTxn(t *testing.T) { _, okl1 := v.(L1HandlerTxn) _, okdec1 := v.(DeclareTxnV1) _, okdec2 := v.(DeclareTxnV2) - _, okdep := v.(DeployTxn) _, okdepac := v.(DeployAccountTxn) - if !okv0 && !okv1 && !okl1 && !okdec1 && !okdec2 && !okdep && !okdepac { + if !okv0 && !okv1 && !okl1 && !okdec1 && !okdec2 && !okdepac { t.Fatalf("New Type Detected %T at Block(%d)/Txn(%d)", v, i, k) } } diff --git a/rpc/types_transaction.go b/rpc/types_transaction.go index b278a307..5a82695f 100644 --- a/rpc/types_transaction.go +++ b/rpc/types_transaction.go @@ -125,19 +125,6 @@ type Transaction interface { Hash() *felt.Felt } -// DeployTxn The structure of a deploy transaction. Note that this transaction type is deprecated and will no longer be supported in future versions -type DeployTxn struct { - TransactionHash *felt.Felt `json:"transaction_hash,omitempty"` - // ClassHash The hash of the deployed contract's class - ClassHash *felt.Felt `json:"class_hash"` - - DeployTransactionProperties -} - -func (tx DeployTxn) Hash() *felt.Felt { - return tx.TransactionHash -} - type DeployAccountTransactionProperties struct { // ClassHash The hash of the deployed contract's class ClassHash *felt.Felt `json:"class_hash"` @@ -222,10 +209,6 @@ func unmarshalTxn(t interface{}) (Transaction, error) { default: return nil, errors.New("Internal error with Declare transaction version and unmarshalTxn()") } - case TransactionType_Deploy: - var txn DeployTxn - remarshal(casted, &txn) - return txn, nil case TransactionType_DeployAccount: var txn DeployAccountTxn remarshal(casted, &txn) diff --git a/rpc/types_transaction_receipt.go b/rpc/types_transaction_receipt.go index 1a55fe83..110c41b8 100644 --- a/rpc/types_transaction_receipt.go +++ b/rpc/types_transaction_receipt.go @@ -33,7 +33,6 @@ type TransactionType string const ( TransactionType_Declare TransactionType = "DECLARE" - TransactionType_Deploy TransactionType = "DEPLOY" TransactionType_DeployAccount TransactionType = "DEPLOY_ACCOUNT" TransactionType_Invoke TransactionType = "INVOKE" TransactionType_L1Handler TransactionType = "L1_HANDLER"