Skip to content

Commit

Permalink
Merge pull request #6763 from multiversx/merge-esdt-prefix-into-sover…
Browse files Browse the repository at this point in the history
…eign-31-ian

Merge esdt prefix into sovereign 31 ian
  • Loading branch information
axenteoctavian authored Jan 31, 2025
2 parents b6038d1 + 8fbcfd6 commit ddaa9da
Show file tree
Hide file tree
Showing 159 changed files with 5,438 additions and 1,121 deletions.
8 changes: 7 additions & 1 deletion api/groups/blockGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
urlParamTokensFilter = "tokens"
urlParamWithTxs = "withTxs"
urlParamWithLogs = "withLogs"
urlParamForHyperblock = "forHyperblock"
)

// blockFacadeHandler defines the methods to be implemented by a facade for handling block requests
Expand Down Expand Up @@ -219,7 +220,12 @@ func parseBlockQueryOptions(c *gin.Context) (api.BlockQueryOptions, error) {
return api.BlockQueryOptions{}, err
}

options := api.BlockQueryOptions{WithTransactions: withTxs, WithLogs: withLogs}
forHyperBlock, err := parseBoolUrlParam(c, urlParamForHyperblock)
if err != nil {
return api.BlockQueryOptions{}, err
}

options := api.BlockQueryOptions{WithTransactions: withTxs, WithLogs: withLogs, ForHyperblock: forHyperBlock}
return options, nil
}

Expand Down
4 changes: 2 additions & 2 deletions api/groups/blockGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestBlockGroup_getBlockByNonce(t *testing.T) {
t.Parallel()

providedNonce := uint64(37)
expectedOptions := api.BlockQueryOptions{WithTransactions: true}
expectedOptions := api.BlockQueryOptions{WithTransactions: true, ForHyperblock: true}
expectedBlock := api.Block{
Nonce: 37,
Round: 39,
Expand All @@ -107,7 +107,7 @@ func TestBlockGroup_getBlockByNonce(t *testing.T) {
loadBlockGroupResponse(
t,
facade,
fmt.Sprintf("/block/by-nonce/%d?withTxs=true", providedNonce),
fmt.Sprintf("/block/by-nonce/%d?withTxs=true&forHyperblock=true", providedNonce),
"GET",
nil,
response,
Expand Down
2 changes: 1 addition & 1 deletion api/groups/networkGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func NewNetworkGroup(facade networkFacadeHandler) (*networkGroup, error) {
{
Path: getNFTsPath,
Method: http.MethodGet,
Handler: ng.getHandlerFuncForEsdt(core.NonFungibleESDT),
Handler: ng.getHandlerFuncForEsdt(core.NonFungibleESDTv2),
},
{
Path: directStakedInfoPath,
Expand Down
30 changes: 30 additions & 0 deletions api/groups/networkGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,36 @@ func TestNetworkConfigMetrics_GasLimitGuardedTxShouldWork(t *testing.T) {
assert.True(t, keyAndValueFoundInResponse)
}

func TestNetworkConfigMetrics_GasLimitRelayedTxShouldWork(t *testing.T) {
t.Parallel()

statusMetricsProvider := statusHandler.NewStatusMetrics()
key := common.MetricExtraGasLimitRelayedTx
val := uint64(123)
statusMetricsProvider.SetUInt64Value(key, val)

facade := mock.FacadeStub{}
facade.StatusMetricsHandler = func() external.StatusMetricsHandler {
return statusMetricsProvider
}

networkGroup, err := groups.NewNetworkGroup(&facade)
require.NoError(t, err)

ws := startWebServer(networkGroup, "network", getNetworkRoutesConfig())

req, _ := http.NewRequest("GET", "/network/config", nil)
resp := httptest.NewRecorder()
ws.ServeHTTP(resp, req)

respBytes, _ := io.ReadAll(resp.Body)
respStr := string(respBytes)
assert.Equal(t, resp.Code, http.StatusOK)

keyAndValueFoundInResponse := strings.Contains(respStr, key) && strings.Contains(respStr, fmt.Sprintf("%d", val))
assert.True(t, keyAndValueFoundInResponse)
}

func TestNetworkStatusMetrics_ShouldWork(t *testing.T) {
t.Parallel()

Expand Down
32 changes: 17 additions & 15 deletions api/groups/transactionGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,21 +720,23 @@ func (tg *transactionGroup) getTransactionsPoolNonceGapsForSender(sender string,

func (tg *transactionGroup) createTransaction(receivedTx *transaction.FrontendTransaction) (*transaction.Transaction, []byte, error) {
txArgs := &external.ArgsCreateTransaction{
Nonce: receivedTx.Nonce,
Value: receivedTx.Value,
Receiver: receivedTx.Receiver,
ReceiverUsername: receivedTx.ReceiverUsername,
Sender: receivedTx.Sender,
SenderUsername: receivedTx.SenderUsername,
GasPrice: receivedTx.GasPrice,
GasLimit: receivedTx.GasLimit,
DataField: receivedTx.Data,
SignatureHex: receivedTx.Signature,
ChainID: receivedTx.ChainID,
Version: receivedTx.Version,
Options: receivedTx.Options,
Guardian: receivedTx.GuardianAddr,
GuardianSigHex: receivedTx.GuardianSignature,
Nonce: receivedTx.Nonce,
Value: receivedTx.Value,
Receiver: receivedTx.Receiver,
ReceiverUsername: receivedTx.ReceiverUsername,
Sender: receivedTx.Sender,
SenderUsername: receivedTx.SenderUsername,
GasPrice: receivedTx.GasPrice,
GasLimit: receivedTx.GasLimit,
DataField: receivedTx.Data,
SignatureHex: receivedTx.Signature,
ChainID: receivedTx.ChainID,
Version: receivedTx.Version,
Options: receivedTx.Options,
Guardian: receivedTx.GuardianAddr,
GuardianSigHex: receivedTx.GuardianSignature,
Relayer: receivedTx.RelayerAddr,
RelayerSignatureHex: receivedTx.RelayerSignature,
}
start := time.Now()
tx, txHash, err := tg.getFacade().CreateTransaction(txArgs)
Expand Down
4 changes: 2 additions & 2 deletions cmd/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@
[TxDataPool]
Name = "TxDataPool"
Capacity = 600000
SizePerSender = 20000
SizePerSender = 5001
SizeInBytes = 419430400 #400MB
SizeInBytesPerSender = 12288000
SizeInBytesPerSender = 12288000 #12MB
Type = "TxCache"
Shards = 16

Expand Down
15 changes: 9 additions & 6 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -313,25 +313,28 @@
UseGasBoundedShouldFailExecutionEnableEpoch = 1

# DynamicESDTEnableEpoch represents the epoch when dynamic NFT feature is enabled
DynamicESDTEnableEpoch = 4
DynamicESDTEnableEpoch = 1

# EGLDInMultiTransferEnableEpoch represents the epoch when EGLD in multitransfer is enabled
EGLDInMultiTransferEnableEpoch = 4
EGLDInMultiTransferEnableEpoch = 1

# CryptoOpcodesV2EnableEpoch represents the epoch when BLSMultiSig, Secp256r1 and other opcodes are enabled
CryptoOpcodesV2EnableEpoch = 4
CryptoOpcodesV2EnableEpoch = 1

# UnjailCleanupEnableEpoch represents the epoch when the cleanup of the unjailed nodes is enabled
UnJailCleanupEnableEpoch = 4
UnJailCleanupEnableEpoch = 1

# FixRelayedBaseCostEnableEpoch represents the epoch when the fix for relayed base cost will be enabled
FixRelayedBaseCostEnableEpoch = 4
FixRelayedBaseCostEnableEpoch = 1

# MultiESDTNFTTransferAndExecuteByUserEnableEpoch represents the epoch when enshrined sovereign cross chain opcodes are enabled
MultiESDTNFTTransferAndExecuteByUserEnableEpoch = 9999999

# FixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non payable sc will be enabled
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 4
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 1

# RelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions v3 will be enabled
RelayedTransactionsV3EnableEpoch = 2

# ConsensusModelV2EnableEpoch represents the epoch when the consensus model V2 is enabled
ConsensusModelV2EnableEpoch = 2
Expand Down
1 change: 1 addition & 0 deletions cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func attachFileLogger(log logger.Logger, flagsConfig *config.ContextFlagsConfig)
logger.ToggleCorrelation(flagsConfig.EnableLogCorrelation)
logger.ToggleLoggerName(flagsConfig.EnableLogName)
logLevelFlagValue := flagsConfig.LogLevel

err = logger.SetLogLevel(logLevelFlagValue)
if err != nil {
return nil, err
Expand Down
106 changes: 103 additions & 3 deletions cmd/sovereignnode/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
# ValidatorToDelegationEnableEpoch represents the epoch when the validator-to-delegation feature will be enabled
ValidatorToDelegationEnableEpoch = 0

# WaitingListFixEnableEpoch represents the epoch when the 6 epoch waiting list fix is enabled
WaitingListFixEnableEpoch = 0

# IncrementSCRNonceInMultiTransferEnableEpoch represents the epoch when the fix for preventing the generation of the same SCRs
# is enabled. The fix is done by adding an extra increment.
IncrementSCRNonceInMultiTransferEnableEpoch = 0
Expand Down Expand Up @@ -239,6 +236,109 @@
# RuntimeCodeSizeFixEnableEpoch represents the epoch when the code size fix in the VM is enabled
RuntimeCodeSizeFixEnableEpoch = 0

# RelayedNonceFixEnableEpoch represents the epoch when the nonce fix for relayed txs is enabled
RelayedNonceFixEnableEpoch = 0

# SetGuardianEnableEpoch represents the epoch when the guard account feature is enabled in the protocol
SetGuardianEnableEpoch = 0

# DeterministicSortOnValidatorsInfoEnableEpoch represents the epoch when the deterministic sorting on validators info is enabled
DeterministicSortOnValidatorsInfoEnableEpoch = 0

# SCProcessorV2EnableEpoch represents the epoch when SC processor V2 will be used
SCProcessorV2EnableEpoch = 0

# AutoBalanceDataTriesEnableEpoch represents the epoch when the data tries are automatically balanced by inserting at the hashed key instead of the normal key
AutoBalanceDataTriesEnableEpoch = 0

# MigrateDataTrieEnableEpoch represents the epoch when the data tries migration is enabled
MigrateDataTrieEnableEpoch = 0

# KeepExecOrderOnCreatedSCRsEnableEpoch represents the epoch when the execution order of created SCRs is ensured
KeepExecOrderOnCreatedSCRsEnableEpoch = 0

# MultiClaimOnDelegationEnableEpoch represents the epoch when the multi claim on delegation is enabled
MultiClaimOnDelegationEnableEpoch = 0

# ChangeUsernameEnableEpoch represents the epoch when changing username is enabled
ChangeUsernameEnableEpoch = 0

# ConsistentTokensValuesLengthCheckEnableEpoch represents the epoch when the consistent tokens values length check is enabled
ConsistentTokensValuesLengthCheckEnableEpoch = 0

# FixDelegationChangeOwnerOnAccountEnableEpoch represents the epoch when the fix for the delegation system smart contract is enabled
FixDelegationChangeOwnerOnAccountEnableEpoch = 0

# DynamicGasCostForDataTrieStorageLoadEnableEpoch represents the epoch when dynamic gas cost for data trie storage load will be enabled
DynamicGasCostForDataTrieStorageLoadEnableEpoch = 0

# ScToScLogEventEnableEpoch represents the epoch when the sc to sc log event feature is enabled
ScToScLogEventEnableEpoch = 0

# NFTStopCreateEnableEpoch represents the epoch when NFT stop create feature is enabled
NFTStopCreateEnableEpoch = 0

# ChangeOwnerAddressCrossShardThroughSCEnableEpoch represents the epoch when the change owner address built in function will work also through a smart contract call cross shard
ChangeOwnerAddressCrossShardThroughSCEnableEpoch = 0

# FixGasRemainingForSaveKeyValueBuiltinFunctionEnableEpoch represents the epoch when the fix for the remaining gas in the SaveKeyValue builtin function is enabled
FixGasRemainingForSaveKeyValueBuiltinFunctionEnableEpoch = 0

# CurrentRandomnessOnSortingEnableEpoch represents the epoch when the current randomness on sorting is enabled
CurrentRandomnessOnSortingEnableEpoch = 0

# StakeLimitsEnableEpoch represents the epoch when stake limits on validators are enabled
# Should have the same value as StakingV4Step1EnableEpoch that triggers the automatic unstake operations for the queue nodes
StakeLimitsEnableEpoch = 0

# StakingV4Step1EnableEpoch represents the epoch when staking v4 is initialized. This is the epoch in which
# all nodes from staking queue are moved in the auction list
StakingV4Step1EnableEpoch = 0

# StakingV4Step2EnableEpoch represents the epoch when staking v4 is enabled. Should have a greater value than StakingV4Step1EnableEpoch.
# From this epoch, all shuffled out nodes are moved to auction nodes. No auction nodes selection is done yet.
StakingV4Step2EnableEpoch = 0

# StakingV4Step3EnableEpoch represents the epoch in which selected nodes from auction will be distributed to waiting list
StakingV4Step3EnableEpoch = 0

# CleanupAuctionOnLowWaitingListEnableEpoch represents the epoch when duplicated data cleanup from auction list is enabled in the condition of a low waiting list
# Should have the same value as StakingV4Step1EnableEpoch if the low waiting list has not happened, otherwise should have a greater value
CleanupAuctionOnLowWaitingListEnableEpoch = 0

# AlwaysMergeContextsInEEIEnableEpoch represents the epoch in which the EEI will always merge the contexts
AlwaysMergeContextsInEEIEnableEpoch = 0

# UseGasBoundedShouldFailExecutionEnableEpoch represents the epoch when use bounded gas function should fail execution in case of error
UseGasBoundedShouldFailExecutionEnableEpoch = 0

# DynamicESDTEnableEpoch represents the epoch when dynamic NFT feature is enabled
DynamicESDTEnableEpoch = 0

# EGLDInMultiTransferEnableEpoch represents the epoch when EGLD in multitransfer is enabled
EGLDInMultiTransferEnableEpoch = 0

# CryptoOpcodesV2EnableEpoch represents the epoch when BLSMultiSig, Secp256r1 and other opcodes are enabled
CryptoOpcodesV2EnableEpoch = 0

# UnjailCleanupEnableEpoch represents the epoch when the cleanup of the unjailed nodes is enabled
UnJailCleanupEnableEpoch = 0

# FixRelayedBaseCostEnableEpoch represents the epoch when the fix for relayed base cost will be enabled
FixRelayedBaseCostEnableEpoch = 0

# MultiESDTNFTTransferAndExecuteByUserEnableEpoch represents the epoch when enshrined sovereign cross chain opcodes are enabled
MultiESDTNFTTransferAndExecuteByUserEnableEpoch = 9999999

# FixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non payable sc will be enabled
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 0

# RelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions v3 will be enabled
RelayedTransactionsV3EnableEpoch = 0

# ConsensusModelV2EnableEpoch represents the epoch when the consensus model V2 is enabled
ConsensusModelV2EnableEpoch = 0

# BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers
BLSMultiSignerEnableEpoch = [
{ EnableEpoch = 0, Type = "KOSK"}
Expand Down
6 changes: 3 additions & 3 deletions cmd/sovereignnode/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go 1.20

require (
github.com/google/gops v0.3.18
github.com/multiversx/mx-chain-core-go v1.2.24-0.20241209142414-762196f8dd06
github.com/multiversx/mx-chain-core-go v1.2.25-0.20250131122047-725dd68e256f
github.com/multiversx/mx-chain-go v1.8.4
github.com/multiversx/mx-chain-logger-go v1.0.15
github.com/multiversx/mx-chain-sovereign-bridge-go v0.0.0-20240116102202-4cf6fbbd95a3
Expand Down Expand Up @@ -120,9 +120,9 @@ require (
github.com/multiversx/concurrent-map v0.1.4 // indirect
github.com/multiversx/mx-chain-communication-go v1.1.1 // indirect
github.com/multiversx/mx-chain-crypto-go v1.2.12 // indirect
github.com/multiversx/mx-chain-es-indexer-go v1.7.11-0.20241211094055-23de51462ca4 // indirect
github.com/multiversx/mx-chain-es-indexer-go v1.7.15-0.20250131122054-68d88c13fdac // indirect
github.com/multiversx/mx-chain-scenario-go v1.4.4 // indirect
github.com/multiversx/mx-chain-storage-go v1.0.16 // indirect
github.com/multiversx/mx-chain-storage-go v1.0.19 // indirect
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241119132002-2fa80c5ec516 // indirect
github.com/multiversx/mx-chain-vm-go v1.5.37 // indirect
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 // indirect
Expand Down
12 changes: 6 additions & 6 deletions cmd/sovereignnode/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,12 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY
github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
github.com/multiversx/mx-chain-communication-go v1.1.1 h1:y4DoQeQOJTaSUsRzczQFazf8JYQmInddypApqA3AkwM=
github.com/multiversx/mx-chain-communication-go v1.1.1/go.mod h1:WK6bP4pGEHGDDna/AYRIMtl6G9OA0NByI1Lw8PmOnRM=
github.com/multiversx/mx-chain-core-go v1.2.24-0.20241209142414-762196f8dd06 h1:3Sog/pzWhtQ7UKHTaJhK50EjSqlkxTOD4JKWmJZzr50=
github.com/multiversx/mx-chain-core-go v1.2.24-0.20241209142414-762196f8dd06/go.mod h1:P/YBoFnt25XUaCQ7Q/SD15vhnc9yV5JDhHxyFO9P8Z0=
github.com/multiversx/mx-chain-core-go v1.2.25-0.20250131122047-725dd68e256f h1:iyDk0Zk0n4pHZnrdX30SxevTy+xg9GcEyAmBss45Nfs=
github.com/multiversx/mx-chain-core-go v1.2.25-0.20250131122047-725dd68e256f/go.mod h1:P/YBoFnt25XUaCQ7Q/SD15vhnc9yV5JDhHxyFO9P8Z0=
github.com/multiversx/mx-chain-crypto-go v1.2.12 h1:zWip7rpUS4CGthJxfKn5MZfMfYPjVjIiCID6uX5BSOk=
github.com/multiversx/mx-chain-crypto-go v1.2.12/go.mod h1:HzcPpCm1zanNct/6h2rIh+MFrlXbjA5C8+uMyXj3LI4=
github.com/multiversx/mx-chain-es-indexer-go v1.7.11-0.20241211094055-23de51462ca4 h1:IfjK6IQy65eMWr/FEv3CMUz13ZqH9sWLnKv85/AoayM=
github.com/multiversx/mx-chain-es-indexer-go v1.7.11-0.20241211094055-23de51462ca4/go.mod h1:i5xoCUsrHteffxx3yfR8bj9tmpP/DtastZGOc/KRAoY=
github.com/multiversx/mx-chain-es-indexer-go v1.7.15-0.20250131122054-68d88c13fdac h1:AaD3sEsepJTHeLqp20ZvMzTY1KakWXYK2qcJfqfEdZM=
github.com/multiversx/mx-chain-es-indexer-go v1.7.15-0.20250131122054-68d88c13fdac/go.mod h1:u3P9JM8JWPRcYW3X0Lsw06Nf6a6M7cS42XwT4Au/Ar8=
github.com/multiversx/mx-chain-logger-go v1.0.15 h1:HlNdK8etyJyL9NQ+6mIXyKPEBo+wRqOwi3n+m2QIHXc=
github.com/multiversx/mx-chain-logger-go v1.0.15/go.mod h1:t3PRKaWB1M+i6gUfD27KXgzLJJC+mAQiN+FLlL1yoGQ=
github.com/multiversx/mx-chain-scenario-go v1.4.4 h1:DVE2V+FPeyD/yWoC+KEfPK3jsFzHeruelESfpTlf460=
Expand All @@ -399,8 +399,8 @@ github.com/multiversx/mx-chain-sovereign-bridge-go v0.0.0-20240116102202-4cf6fbb
github.com/multiversx/mx-chain-sovereign-bridge-go v0.0.0-20240116102202-4cf6fbbd95a3/go.mod h1:/U8wy9SMizv5oXD6suxWRkusSx2SvLRARS4R4HuaXAA=
github.com/multiversx/mx-chain-sovereign-notifier-go v0.0.0-20230929085947-df9b345f49ac h1:GtFxKINPiDCsqjKpTWHFN/5qvQGnFClYH4jMHNrJx/M=
github.com/multiversx/mx-chain-sovereign-notifier-go v0.0.0-20230929085947-df9b345f49ac/go.mod h1:syNNd30uEkKsz2V5nXCfv3u+KhkpKVw34+2DsfSuFSE=
github.com/multiversx/mx-chain-storage-go v1.0.16 h1:l2lJq+EAN3YwLbjJrnoKfFd1/1Xmo9DcAUECND2obLs=
github.com/multiversx/mx-chain-storage-go v1.0.16/go.mod h1:uM/z7YyqTOD3wgyH8TfapyEl5sb+7x/Jaxne4cfG4HI=
github.com/multiversx/mx-chain-storage-go v1.0.19 h1:2R35MoSXcuNJOFmV5xEhcXqiEGZw6AYGy9R8J9KH66Q=
github.com/multiversx/mx-chain-storage-go v1.0.19/go.mod h1:Pb/BuVmiFqO66DSZO16KFkSUeom94x3e3Q9IloBvkYI=
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241119132002-2fa80c5ec516 h1:PToP1B7aFkXjQBOF5MDCCvsc+ffWVqqBHtmemfCwVA8=
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241119132002-2fa80c5ec516/go.mod h1:C7KVj6/+TAhxDjgY7oAMO5wSj7WbBYIJ5TCMzmxk2w0=
github.com/multiversx/mx-chain-vm-go v1.5.37 h1:Iy3KCvM+DOq1f9UPA7uYK/rI3ZbBOXc2CVNO2/vm5zw=
Expand Down
26 changes: 26 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package common

import "github.com/multiversx/mx-chain-core-go/data"

// IsValidRelayedTxV3 returns true if the provided transaction is a valid transaction of type relayed v3
func IsValidRelayedTxV3(tx data.TransactionHandler) bool {
relayedTx, isRelayedV3 := tx.(data.RelayedTransactionHandler)
if !isRelayedV3 {
return false
}
hasValidRelayer := len(relayedTx.GetRelayerAddr()) == len(tx.GetSndAddr()) && len(relayedTx.GetRelayerAddr()) > 0
hasValidRelayerSignature := len(relayedTx.GetRelayerSignature()) == len(relayedTx.GetSignature()) && len(relayedTx.GetRelayerSignature()) > 0
return hasValidRelayer && hasValidRelayerSignature
}

// IsRelayedTxV3 returns true if the provided transaction is a transaction of type relayed v3, without any further checks
func IsRelayedTxV3(tx data.TransactionHandler) bool {
relayedTx, isRelayedV3 := tx.(data.RelayedTransactionHandler)
if !isRelayedV3 {
return false
}

hasRelayer := len(relayedTx.GetRelayerAddr()) > 0
hasRelayerSignature := len(relayedTx.GetRelayerSignature()) > 0
return hasRelayer || hasRelayerSignature
}
Loading

0 comments on commit ddaa9da

Please sign in to comment.