diff --git a/server/services/constants.go b/server/services/constants.go index 1366a33a..f7aec9bf 100644 --- a/server/services/constants.go +++ b/server/services/constants.go @@ -10,8 +10,6 @@ import ( var ( transactionVersion = 1 transactionProcessingTypeRelayedV1 = "RelayedTx" - transactionProcessingTypeRelayedV2 = "RelayedTxV2" - transactionProcessingTypeRelayedV3 = "RelayedTxV3" transactionProcessingTypeBuiltInFunctionCall = "BuiltInFunctionCall" transactionProcessingTypeMoveBalance = "MoveBalance" transactionProcessingTypeContractInvoking = "SCInvoking" diff --git a/server/services/errors.go b/server/services/errors.go index 3f9c76b8..76f3bab8 100644 --- a/server/services/errors.go +++ b/server/services/errors.go @@ -202,4 +202,3 @@ func (factory *errFactory) getPrototypeByCode(code errCode) errPrototype { var errEventNotFound = errors.New("transaction event not found") var errCannotRecognizeEvent = errors.New("cannot recognize transaction event") var errCannotParseRelayedV1 = errors.New("cannot parse relayed V1 transaction") -var errCannotParseRelayedV2 = errors.New("cannot parse relayed V2 transaction") diff --git a/server/services/relayedTransactions.go b/server/services/relayedTransactions.go index 62917eb1..3f530d9f 100644 --- a/server/services/relayedTransactions.go +++ b/server/services/relayedTransactions.go @@ -16,23 +16,12 @@ type innerTransactionOfRelayedV1 struct { SenderPubKey []byte `json:"sender"` } -// innerTransactionOfRelayedV2 is used to parse the inner transaction of a relayed V2 transaction, and holds only the fields handled by Rosetta. -type innerTransactionOfRelayedV2 struct { - ReceiverPubKey []byte `json:"receiver"` -} - func isRelayedV1Transaction(tx *transaction.ApiTransactionResult) bool { return (tx.Type == string(transaction.TxTypeNormal)) && (tx.ProcessingTypeOnSource == transactionProcessingTypeRelayedV1) && (tx.ProcessingTypeOnDestination == transactionProcessingTypeRelayedV1) } -func isRelayedV2Transaction(tx *transaction.ApiTransactionResult) bool { - return (tx.Type == string(transaction.TxTypeNormal)) && - (tx.ProcessingTypeOnSource == transactionProcessingTypeRelayedV2) && - (tx.ProcessingTypeOnDestination == transactionProcessingTypeRelayedV2) -} - func parseInnerTxOfRelayedV1(tx *transaction.ApiTransactionResult) (*innerTransactionOfRelayedV1, error) { subparts := strings.Split(string(tx.Data), argumentsSeparator) if len(subparts) != 2 { @@ -53,19 +42,3 @@ func parseInnerTxOfRelayedV1(tx *transaction.ApiTransactionResult) (*innerTransa return &innerTx, nil } - -func parseInnerTxOfRelayedV2(tx *transaction.ApiTransactionResult) (*innerTransactionOfRelayedV2, error) { - subparts := strings.Split(string(tx.Data), argumentsSeparator) - if len(subparts) != 5 { - return nil, errCannotParseRelayedV2 - } - - receiverPubKey, err := hex.DecodeString(subparts[1]) - if err != nil { - return nil, err - } - - return &innerTransactionOfRelayedV2{ - ReceiverPubKey: receiverPubKey, - }, nil -}