Skip to content

Commit

Permalink
fix test and type checker issue
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Dec 12, 2024
1 parent 88843cb commit c70090b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions multiversx_sdk/delegation/delegation_transactions_factory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from multiversx_sdk.delegation import DelegationTransactionsFactory
from multiversx_sdk.wallet import ValidatorSecretKey, ValidatorSigner

from multiversx_sdk.wallet.validator_keys import ValidatorPublicKey


class TestDelegationTransactionsFactory:
config = TransactionsFactoryConfig("D")
Expand Down Expand Up @@ -54,7 +56,7 @@ def test_create_transaction_for_removing_nodes(self):
sender = Address.new_from_bech32("erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2")
delegation_contract = Address.new_from_bech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc")

public_keys = ["notavalidblskeyhexencoded".encode()]
public_keys = [ValidatorPublicKey(bytes([0] * 96))]

transaction = self.factory.create_transaction_for_removing_nodes(
sender=sender,
Expand All @@ -65,14 +67,14 @@ def test_create_transaction_for_removing_nodes(self):
assert transaction.sender.to_bech32() == "erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2"
assert transaction.receiver.to_bech32() == "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc"
assert transaction.data
assert transaction.data.decode() == "removeNodes@6e6f746176616c6964626c736b6579686578656e636f646564"
assert transaction.data.decode() == "removeNodes@000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
assert transaction.value == 0

def test_create_transaction_for_staking_nodes(self):
sender = Address.new_from_bech32("erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2")
delegation_contract = Address.new_from_bech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc")

public_keys = ["notavalidblskeyhexencoded".encode()]
public_keys = [ValidatorPublicKey(bytes([0] * 96))]

transaction = self.factory.create_transaction_for_staking_nodes(
sender=sender,
Expand All @@ -83,14 +85,14 @@ def test_create_transaction_for_staking_nodes(self):
assert transaction.sender.to_bech32() == "erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2"
assert transaction.receiver.to_bech32() == "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc"
assert transaction.data
assert transaction.data.decode() == "stakeNodes@6e6f746176616c6964626c736b6579686578656e636f646564"
assert transaction.data.decode() == "stakeNodes@000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
assert transaction.value == 0

def test_create_transaction_for_unbonding_nodes(self):
sender = Address.new_from_bech32("erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2")
delegation_contract = Address.new_from_bech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc")

public_keys = ["notavalidblskeyhexencoded".encode()]
public_keys = [ValidatorPublicKey(bytes([0] * 96))]

transaction = self.factory.create_transaction_for_unbonding_nodes(
sender=sender,
Expand All @@ -101,14 +103,14 @@ def test_create_transaction_for_unbonding_nodes(self):
assert transaction.sender.to_bech32() == "erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2"
assert transaction.receiver.to_bech32() == "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc"
assert transaction.data
assert transaction.data.decode() == "unBondNodes@6e6f746176616c6964626c736b6579686578656e636f646564"
assert transaction.data.decode() == "unBondNodes@000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
assert transaction.value == 0

def test_create_transaction_for_unstaking_nodes(self):
sender = Address.new_from_bech32("erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2")
delegation_contract = Address.new_from_bech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc")

public_keys = ["notavalidblskeyhexencoded".encode()]
public_keys = [ValidatorPublicKey(bytes([0] * 96))]

transaction = self.factory.create_transaction_for_unstaking_nodes(
sender=sender,
Expand All @@ -119,14 +121,14 @@ def test_create_transaction_for_unstaking_nodes(self):
assert transaction.sender.to_bech32() == "erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2"
assert transaction.receiver.to_bech32() == "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc"
assert transaction.data
assert transaction.data.decode() == "unStakeNodes@6e6f746176616c6964626c736b6579686578656e636f646564"
assert transaction.data.decode() == "unStakeNodes@000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
assert transaction.value == 0

def test_create_transaction_for_unjailing_nodes(self):
sender = Address.new_from_bech32("erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2")
delegation_contract = Address.new_from_bech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc")

public_keys = ["notavalidblskeyhexencoded".encode()]
public_keys = [ValidatorPublicKey(bytes([0] * 96))]

transaction = self.factory.create_transaction_for_unjailing_nodes(
sender=sender,
Expand All @@ -138,7 +140,7 @@ def test_create_transaction_for_unjailing_nodes(self):
assert transaction.sender.to_bech32() == "erd18s6a06ktr2v6fgxv4ffhauxvptssnaqlds45qgsrucemlwc8rawq553rt2"
assert transaction.receiver.to_bech32() == "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqtllllls002zgc"
assert transaction.data
assert transaction.data.decode() == "unJailNodes@6e6f746176616c6964626c736b6579686578656e636f646564"
assert transaction.data.decode() == "unJailNodes@000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
assert transaction.value == 25000000000000000000

def test_create_transaction_for_changing_service_fee(self):
Expand Down

0 comments on commit c70090b

Please sign in to comment.