Skip to content

Commit

Permalink
fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Nov 21, 2024
1 parent 84ddbfb commit f1986fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ def create_relayed_v3_transaction(self,
transaction: ITransaction,
relayer_address: IAddress) -> Transaction:
"""Relayer address must be in the same shard with sender address."""
if transaction.data.decode().startswith("relayed"):
raise Exception("Transaction can't contain another relayed transaction")

gas_limit = transaction.gas_limit + self._config.extra_gas_limit_for_relayed_v3

return Transaction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_relayed_v3(self):
receiver="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u",
gas_limit=1_000_000,
chain_id=self.config.chain_id,
data=b"getContractConfig",
data=b"add@07",
nonce=15,
version=2,
options=0
Expand All @@ -257,32 +257,3 @@ def test_relayed_v3(self):
assert relayed_tx.receiver == "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"
assert relayed_tx.relayer == alice.label
assert relayed_tx.gas_limit == 1_050_000

def test_invalid_data_relayed_v3(self):
alice = self.wallets["alice"]
alice_address = Address.new_from_bech32(alice.label)
bob = self.wallets["bob"]

tx = Transaction(
sender=bob.label,
receiver="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u",
gas_limit=1_000_000,
chain_id=self.config.chain_id,
data=b"relayedTx@abba",
nonce=15,
version=2,
options=0
)

with pytest.raises(Exception):
self.factory.create_relayed_v3_transaction(
transaction=tx,
relayer_address=alice_address
)

tx.data = b"relayedTxV2@abba"
with pytest.raises(Exception):
self.factory.create_relayed_v3_transaction(
transaction=tx,
relayer_address=alice_address
)

0 comments on commit f1986fa

Please sign in to comment.