Skip to content

Commit

Permalink
Merge pull request #225 from iamdefinitelyahuman/v1.0.0
Browse files Browse the repository at this point in the history
V1.0.0 - woohoo!!
  • Loading branch information
iamdefinitelyahuman committed Sep 24, 2019
2 parents 0231ca0 + 053081e commit 38fefdc
Show file tree
Hide file tree
Showing 18 changed files with 235 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ repos:
- id: isort

default_language_version:
python: python3.7
python: python3.7
13 changes: 13 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
1.0.0
-----

- Integration with MythX via "brownie analyze" CLI command
- Support for ENS domains
- Finalize public API, many minor edits!
- replace broadcast_reverting_tx with reverting_tx_gas_limit in config
- Allow environment variables in config network.hosts
- Add PEP484 annotations to codebase
- Linting: Black, MyPy, Isort

Thanks to @crawfordleeds and @dmuhs for their contributions on this release!

1.0.0b12
--------

Expand Down
2 changes: 1 addition & 1 deletion brownie/_cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from brownie.exceptions import ProjectNotFound
from brownie.utils import color, notify

__version__ = "1.0.0b12" # did you change this in docs/conf.py as well?
__version__ = "1.0.0"

__doc__ = """Usage: brownie <command> [<args>...] [options <args>]
Expand Down
4 changes: 4 additions & 0 deletions brownie/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class EventLookupError(LookupError):
pass


class NamespaceCollision(AttributeError):
pass


# project/


Expand Down
14 changes: 13 additions & 1 deletion brownie/network/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,20 @@ def balance(self) -> Wei:

class Contract(_DeployedContractBase):
def __init__(
self, address: Any, name: str, abi: List, owner: Optional[AccountsType] = None
self,
name: str,
address: Optional[str] = None,
abi: Optional[List] = None,
manifest_uri: Optional[str] = None,
owner: Optional[AccountsType] = None,
) -> None:
if manifest_uri and abi:
raise ValueError("Contract requires either abi or manifest_uri, but not both")
if manifest_uri is not None:
raise NotImplementedError("ethPM manifests are not yet supported")
elif not address:
raise TypeError("Address cannot be None unless creating object from manifest")

_ContractBase.__init__(self, None, None, name, abi) # type: ignore
_DeployedContractBase.__init__(self, address, owner, None)
contract = _find_contract(address)
Expand Down
7 changes: 4 additions & 3 deletions brownie/network/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import json
from collections import OrderedDict
from typing import Any, Dict, Iterator, List, Tuple, Union, ValuesView
from pathlib import Path
from typing import Dict, Iterator, List, Sequence, Tuple, Union, ValuesView

import eth_event

Expand Down Expand Up @@ -157,7 +158,7 @@ def values(self) -> List:
return list(self._ordered[0].values())


def __get_path() -> Any:
def __get_path() -> Path:
return CONFIG["brownie_folder"].joinpath("data/topics.json")


Expand All @@ -179,7 +180,7 @@ def _decode_logs(logs: List) -> Union["EventDict", List[None]]:
return EventDict(events)


def _decode_trace(trace: List) -> Union["EventDict", List[None]]:
def _decode_trace(trace: Sequence) -> Union["EventDict", List[None]]:
if not trace:
return []
events = eth_event.decode_trace(trace, _topics)
Expand Down
6 changes: 3 additions & 3 deletions brownie/network/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def copy(self) -> List:
"""Returns a shallow copy of the object as a list"""
return self._list.copy()

def from_sender(self, account: Any) -> List:
def from_sender(self, account: str) -> List:
"""Returns a list of transactions where the sender is account"""
return [i for i in self._list if i.sender == account]

def to_receiver(self, account: Any) -> List:
def to_receiver(self, account: str) -> List:
"""Returns a list of transactions where the receiver is account"""
return [i for i in self._list if i.receiver == account]

def of_address(self, account: Any) -> List:
def of_address(self, account: str) -> List:
"""Returns a list of transactions where account is the sender or receiver"""
return [i for i in self._list if i.receiver == account or i.sender == account]

Expand Down

0 comments on commit 38fefdc

Please sign in to comment.