-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for providing custom registries #109
Changes from 1 commit
90aba57
1e4a102
2f68d45
8ff02e5
9614f44
ecece6d
abceb18
f939865
d63273c
588a373
49b78b1
8b8b94c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ v2.0.0-beta.1 | |
the parsing API more consistent with the new parsimonious parser. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There were warnings showing up when running |
||
|
||
v2.0.0-alpha.1 | ||
------------- | ||
-------------- | ||
|
||
Released July 19, 2018 | ||
|
||
|
@@ -49,7 +49,7 @@ Released July 19, 2018 | |
- Various documentation updates and type annotations | ||
|
||
v1.2.1 | ||
------------- | ||
------ | ||
|
||
Released October 16, 2018 | ||
|
||
|
@@ -59,7 +59,7 @@ Released October 16, 2018 | |
(backport from v2) | ||
|
||
v1.2.0 | ||
------------- | ||
------ | ||
|
||
Released August 28, 2018 | ||
|
||
|
@@ -69,7 +69,7 @@ Released August 28, 2018 | |
version 2 ABI | ||
|
||
v1.1.1 | ||
------------- | ||
------ | ||
|
||
Released May 10, 2018 | ||
|
||
|
@@ -82,7 +82,7 @@ Released May 10, 2018 | |
:class:`TypeError` when trying to encode a :class:`float` into a ``fixed<M>x<N>`` type. | ||
|
||
v1.1.0 | ||
------------- | ||
------ | ||
|
||
Released May 8, 2018 | ||
|
||
|
@@ -106,7 +106,7 @@ Released May 8, 2018 | |
- Drop Python 2 support cruft | ||
|
||
v1.0.0 | ||
------------- | ||
------ | ||
|
||
Released Feb 28, 2018 | ||
|
||
|
@@ -123,63 +123,63 @@ Released Feb 5, 2018 | |
- Add support for eth-utils v1-beta1 | ||
|
||
v0.5.0 | ||
-------- | ||
------ | ||
|
||
- Rename to ``eth-abi`` for consistency across github/pypi/python-module | ||
|
||
v0.4.4 | ||
----- | ||
------ | ||
|
||
- Better error messages for decoder errors. | ||
|
||
v0.4.3 | ||
----- | ||
------ | ||
|
||
- Bugfix for ``process_type`` to support byte string type arrguments | ||
|
||
v0.4.2 | ||
----- | ||
------ | ||
|
||
- ``process_type`` now auto-expands all types which have omittied their sizes. | ||
|
||
v0.4.1 | ||
----- | ||
------ | ||
|
||
- Support for ``function`` types. | ||
|
||
v0.3.1 | ||
----- | ||
------ | ||
|
||
- Bugfix for small signed integer and real encoding/decoding | ||
|
||
v0.3.1 | ||
----- | ||
------ | ||
|
||
- Bugfix for faulty release. | ||
|
||
v0.3.0 | ||
----- | ||
------ | ||
|
||
- Depart from the original pyethereum encoding/decoding logic. | ||
- Fully rewritten encoder and decoder functionality. | ||
|
||
v0.2.2 | ||
----- | ||
------ | ||
|
||
- Fix a handful of bytes encoding issues. | ||
|
||
v0.2.1 | ||
----- | ||
------ | ||
|
||
- Use pyrlp utility functions for big_endian int operations | ||
|
||
v0.2.0 | ||
----- | ||
------ | ||
|
||
- Bugfixes from upstream pyethereum repository for encoding/decoding | ||
- Python 3 Support | ||
|
||
v0.1.0 | ||
----- | ||
------ | ||
|
||
- Initial release |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,19 @@ | |
|
||
|
||
class BaseABICodecEncoder(): | ||
""" | ||
Base codec used to encode values. | ||
""" | ||
|
||
stefanmendoza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
def __init__(self, registry): | ||
""" | ||
Constructor. | ||
|
||
:param registry: The registry providing the encoders to be used when encoding | ||
values. May not be ``None``. | ||
|
||
:returns: An instance of `~BaseABICodecEncoder`. | ||
""" | ||
if registry is None: | ||
raise ValueError("`registry` may not be None") | ||
|
||
|
@@ -100,7 +112,20 @@ def is_encodable(self, typ: TypeStr, arg: Any) -> bool: | |
|
||
|
||
class ABICodec(BaseABICodecEncoder): | ||
""" | ||
Codec used to encode and decode values. | ||
""" | ||
|
||
def __init__(self, registry: ABIRegistry=None): | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davesque / @carver - I noticed that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we can get the If so, we will probably add it to our project template so that it eventually gets filters to all our other projects. |
||
Constructor. | ||
|
||
:param registry: The registry providing the encoders and decoders | ||
to be used when encoding and decoding values. If no ``registry`` | ||
is provided, `~eth_abi.registry.default_registry` will be used. | ||
|
||
:returns: An instance of `~eth_abi.codec.ABICodec`. | ||
""" | ||
if registry is None: | ||
BaseABICodecEncoder.__init__(self, default_registry) | ||
else: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davesque / @carver - Do we care to have this turned on or just display documented members?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it's good to have it on. If we don't want something public, it should be
_
-prefixed.