Skip to content

Commit

Permalink
12 oct update. some more tests added for test_fds_tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviksaikat committed Oct 12, 2023
1 parent 679152b commit a602e07
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fds/fds_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def deployContract(
) -> ContractInstance:
fdscontract = FDSContract(self.account) # type: ignore

return fdscontract.deploy(_contract=contract, *args, publish=publish, **kwargs)
return fdscontract.deploy(contract, *args, publish=publish, **kwargs)

def syncNonce(self) -> int:
"""
Expand Down Expand Up @@ -100,7 +100,7 @@ def pay(

return receipt

def getBalace(self, address: AddressType) -> int:
def getBalance(self, address: AddressType) -> int:
self.web3 = networks.provider._web3

try:
Expand Down
17 changes: 17 additions & 0 deletions src/fds/tests/unit_tests/test_fds_tx.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from ape import networks

from fds.fds_tx import Tx


Expand Down Expand Up @@ -58,3 +60,18 @@ def test_pay(sender, receiver):
assert receipt.data.hex() == "0x"
# assert receipt.to == receiver.address
assert receipt.gas_used > 0


def test_getBalance(owner):
tx_object = Tx(owner)
tx_object.getBalance(owner.address)

assert tx_object


def test_getBlockNumber(owner):
tx_object = Tx(owner)

block_number = tx_object.getBlockNumber()

assert block_number == networks.provider.get_block("latest")

0 comments on commit a602e07

Please sign in to comment.