-
Notifications
You must be signed in to change notification settings - Fork 36
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
Integrate latest packages #359
Conversation
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.
Very nice 🎉
@@ -78,19 +79,19 @@ def deploy(self, owner: Account, arguments: List[Any], gas_price: int, gas_limit | |||
|
|||
tx = Transaction( | |||
chain_id=chain, | |||
sender=owner.address, | |||
receiver=Address.from_bech32(ADDRESS_ZERO_BECH32), | |||
sender=owner.address.to_bech32(), |
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.
Here can we use the new factory instead? Can be done now or in a next PR.
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.
Same for other features in contracts.py
.
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.
Indeed. Was thinking about it, but I wanted to make sure everything works as expected. Will refactor to use the factory in a next PR.
requirements.txt
Outdated
multiversx-sdk-core>=0.6.0,<0.7.0 | ||
multiversx-sdk-network-providers>=0.11.0,<0.12.0 | ||
multiversx-sdk-wallet>=0.8.0,<0.9.0 | ||
multiversx-sdk-core==0.7.1 |
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.
It's good to use fixed versions, since mxpy
is an end-application (not a library) 👍
Plus the fact that it's always installed within a venv (at least, this is what mxpy-up does, this is what we recommend).
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.
On the other hand, it's also nice to automatically benefit from hotfixes in dependencies (thus >=
with <
would have also worked).
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.
I'm a big fan of fixed versions, but I agree it's nice to benefit from hotfixes. Will indeed change to use <
.
dictionary["chainID"] = base64.b64encode(tx.chainID.encode()).decode() | ||
dictionary["signature"] = base64.b64encode(bytes(bytearray(tx.signature))).decode() | ||
dictionary["value"] = tx.value | ||
dictionary: Dict[str, Any] = {} |
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.
Perhaps we can also rename the function to tx_to_dictionary_as_inner_for_relayed_v1
. Or perhaps can we use the builder from core instead? Can be in a next PR.
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.
Renamed to tx_to_dictionary_as_inner_for_relayed_v1
. Was thinking about using the builder, but since here we simply format the data field of the relayed transaction it's not suitable. We also marked the builders as deprecated, will probably use the factory, when it's ready.
pyproject.toml
Outdated
"multiversx-sdk-network-providers>=0.11.0,<0.12.0", | ||
"multiversx-sdk-wallet>=0.8.0,<0.9.0", | ||
"multiversx-sdk-core>=0.6.0,<0.7.0" | ||
"multiversx-sdk-network-providers==0.12.0", |
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.
0.12.1
.
testdata_path = Path(__file__).parent / "testdata" | ||
|
||
|
||
def test_relayed_v1_transaction(capsys: Any): |
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.
🚀
"--data", "getContractConfig", | ||
"--version", "1", | ||
"--chain", "T", | ||
"--relay" |
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.
In the future, we should add support for relayed V2, as well.
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.
Indeed
Integrated the latest versions of
sdk-core
,sdk-wallet
andsdk-network-providers
into mxpy.