Skip to content
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

Merged
merged 6 commits into from
Nov 9, 2023
Merged

Integrate latest packages #359

merged 6 commits into from
Nov 9, 2023

Conversation

popenta
Copy link
Contributor

@popenta popenta commented Nov 6, 2023

Integrated the latest versions of sdk-core, sdk-wallet and sdk-network-providers into mxpy.

@popenta popenta marked this pull request as draft November 6, 2023 15:34
@popenta popenta self-assigned this Nov 6, 2023
@popenta popenta marked this pull request as ready for review November 8, 2023 12:06
Copy link
Contributor

@andreibancioiu andreibancioiu left a 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(),
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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).

Copy link
Contributor

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).

Copy link
Contributor Author

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] = {}
Copy link
Contributor

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.

Copy link
Contributor Author

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",
Copy link
Contributor

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):
Copy link
Contributor

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"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

@ssd04 ssd04 self-requested a review November 8, 2023 14:59
@popenta popenta merged commit c63f0d8 into feat/next Nov 9, 2023
9 checks passed
@popenta popenta deleted the integrate-latest-packages branch November 9, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants