diff --git a/tests/test_contracts.nim b/tests/test_contracts.nim index d1052d2..2208607 100644 --- a/tests/test_contracts.nim +++ b/tests/test_contracts.nim @@ -213,8 +213,9 @@ suite "Contracts": receipt = await web3.deployContract(MetaCoinCode) cc = receipt.contractAddress.get - let deployedAtBlock = distinctBase(receipt.blockNumber) - echo "Deployed MetaCoin contract: ", cc, " at block ", deployedAtBlock + let deployedAtBlock = receipt.blockNumber + echo "Deployed MetaCoin contract: ", cc, " at block ", + distinctBase(deployedAtBlock) let ns = web3.contractSender(MetaCoin, cc) @@ -225,7 +226,8 @@ suite "Contracts": fromAddr, toAddr: Address, value: UInt256) {.raises: [], gcsafe.}: try: - echo "onTransfer: ", fromAddr, " transferred ", value.toHex, " to ", toAddr + echo "onTransfer: ", fromAddr, " transferred ", value.toHex, + " to ", toAddr inc notificationsReceived assert(fromAddr == web3.defaultAccount) assert((notificationsReceived == 1 and value == 50.u256) or @@ -238,12 +240,15 @@ suite "Contracts": let balNow = await ns.getBalance(web3.defaultAccount).call() echo "getbalance (now): ", balNow.toHex - let balNew = await ns.getBalance(web3.defaultAccount).call(blockNumber = deployedAtBlock) + let balNew = await ns.getBalance(web3.defaultAccount).call( + blockNumber = deployedAtBlock) echo "getbalance (after creation): ", balNew.toHex - # Let's try to get the balance at a point in time where the contract was not deployed yet: + # Let's try to get the balance at a point in time where the contract + # was not deployed yet: try: - let balFirst = await ns.getBalance(web3.defaultAccount).call(blockNumber = 1'u64) + let balFirst = await ns.getBalance(web3.defaultAccount).call( + blockNumber = 1.BlockNumber) echo "getbalance (first block): ", balFirst.toHex except CatchableError as err: echo "getbalance (first block): ", err.msg