Skip to content

Commit 96b5b6c

Browse files
Remove dead code.
1 parent 1f1ab14 commit 96b5b6c

File tree

2 files changed

+0
-72
lines changed

2 files changed

+0
-72
lines changed

server/services/transactionsFeaturesDetector.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,6 @@ func (detector *transactionsFeaturesDetector) isInvalidTransactionOfTypeMoveBala
7777
return withSendingValueToNonPayableContract || withMetaTransactionIsInvalid
7878
}
7979

80-
func (detector *transactionsFeaturesDetector) isRelayedV1TransactionCompletelyIntrashardWithSignalError(tx *transaction.ApiTransactionResult, innerTx *innerTransactionOfRelayedV1) bool {
81-
innerTxSenderShard := detector.networkProvider.ComputeShardIdOfPubKey(innerTx.SenderPubKey)
82-
innerTxReceiverShard := detector.networkProvider.ComputeShardIdOfPubKey(innerTx.ReceiverPubKey)
83-
84-
isCompletelyIntrashard := tx.SourceShard == tx.DestinationShard &&
85-
innerTxSenderShard == innerTxReceiverShard &&
86-
innerTxSenderShard == tx.SourceShard
87-
if !isCompletelyIntrashard {
88-
return false
89-
}
90-
91-
isWithSignalError := detector.eventsController.hasAnySignalError(tx)
92-
return isWithSignalError
93-
}
94-
9580
func (detector *transactionsFeaturesDetector) isContractDeploymentWithSignalErrorOrIntrashardContractCallWithSignalError(tx *transaction.ApiTransactionResult) bool {
9681
return detector.isContractDeploymentWithSignalError(tx) || (detector.isIntrashard(tx) && detector.isContractCallWithSignalError(tx))
9782
}

server/services/transactionsFeaturesDetector_test.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -75,63 +75,6 @@ func TestTransactionsFeaturesDetector_IsInvalidTransactionOfTypeMoveBalanceThatO
7575
})
7676
}
7777

78-
func TestTransactionsFeaturesDetector_isRelayedV1TransactionCompletelyIntrashardWithSignalError(t *testing.T) {
79-
networkProvider := testscommon.NewNetworkProviderMock()
80-
detector := newTransactionsFeaturesDetector(networkProvider)
81-
82-
t.Run("arbitrary relayed tx", func(t *testing.T) {
83-
tx := &transaction.ApiTransactionResult{
84-
SourceShard: 0,
85-
DestinationShard: 1,
86-
}
87-
88-
innerTx := &innerTransactionOfRelayedV1{
89-
SenderPubKey: testscommon.TestUserShard1.PubKey,
90-
ReceiverPubKey: testscommon.TestUserShard2.PubKey,
91-
}
92-
93-
featureDetected := detector.isRelayedV1TransactionCompletelyIntrashardWithSignalError(tx, innerTx)
94-
require.False(t, featureDetected)
95-
})
96-
97-
t.Run("completely intrashard relayed tx, but no signal error", func(t *testing.T) {
98-
tx := &transaction.ApiTransactionResult{
99-
SourceShard: 0,
100-
DestinationShard: 0,
101-
}
102-
103-
innerTx := &innerTransactionOfRelayedV1{
104-
SenderPubKey: testscommon.TestUserAShard0.PubKey,
105-
ReceiverPubKey: testscommon.TestUserBShard0.PubKey,
106-
}
107-
108-
featureDetected := detector.isRelayedV1TransactionCompletelyIntrashardWithSignalError(tx, innerTx)
109-
require.False(t, featureDetected)
110-
})
111-
112-
t.Run("completely intrashard relayed tx, with signal error", func(t *testing.T) {
113-
tx := &transaction.ApiTransactionResult{
114-
SourceShard: 0,
115-
DestinationShard: 0,
116-
Logs: &transaction.ApiLogs{
117-
Events: []*transaction.Events{
118-
{
119-
Identifier: transactionEventSignalError,
120-
},
121-
},
122-
},
123-
}
124-
125-
innerTx := &innerTransactionOfRelayedV1{
126-
SenderPubKey: testscommon.TestUserAShard0.PubKey,
127-
ReceiverPubKey: testscommon.TestUserBShard0.PubKey,
128-
}
129-
130-
featureDetected := detector.isRelayedV1TransactionCompletelyIntrashardWithSignalError(tx, innerTx)
131-
require.True(t, featureDetected)
132-
})
133-
}
134-
13578
func TestTransactionsFeatureDetector_isContractDeploymentWithSignalErrorOrIntrashardContractCallWithSignalError(t *testing.T) {
13679
networkProvider := testscommon.NewNetworkProviderMock()
13780
detector := newTransactionsFeaturesDetector(networkProvider)

0 commit comments

Comments
 (0)