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

Refactored python scripts #82

Merged
merged 3 commits into from
Sep 18, 2024
Merged

Refactored python scripts #82

merged 3 commits into from
Sep 18, 2024

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented Sep 18, 2024

  • included the latest multiversx-sdk python lib
  • used the generate-blocks-until-epoch-reached and generate-blocks-until-transaction-processed endpoint routes wherever possible
  • removed the single wallet.pem file and, instead, used generated keys for each test
  • code adjustments & optimizations after the new lib integration
  • resolved all warns/weak warns python linter issues

andreibancioiu
andreibancioiu previously approved these changes Sep 18, 2024
popenta
popenta previously approved these changes Sep 18, 2024
for event in tx.logs.events:
if event.identifier != "SCDeploy":
continue

return factory.create_from_hex(event.topics[0].hex())
return Address.from_hex(event.topics[0].hex(), "erd")
Copy link

Choose a reason for hiding this comment

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

this could have been new_from_hex(...) but it's ok as it is.

for event in tx.logs.events:
if event.identifier != "SCDeploy":
continue

return factory.create_from_hex(event.topics[0].hex())
return Address.from_hex(event.topics[0].hex(), "erd")
Copy link

Choose a reason for hiding this comment

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

same comment as above

@@ -34,11 +35,12 @@ def main():

provider.do_post(f"{SIMULATOR_URL}/simulator/set-state", json_data)

factory = AddressFactory("erd")
wrapp_contract_address = factory.create_from_bech32("erd1qqqqqqqqqqqqqpgqhe8t5jewej70zupmh44jurgn29psua5l2jps3ntjj3")
wrapp_contract_address = Address.from_bech32(
Copy link

Choose a reason for hiding this comment

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

here could have been new_from_bech32(...).

amount_egld = 1000000000000000000 # 1 egld
receiver = AddressFactory("erd").create_from_bech32("erd13kp9r5fx4tf8da4ex37sd48pc4xhkmtteq6hcyt4y36pstte0tjqxjf3ns")
receiver = Address.from_bech32(
Copy link

Choose a reason for hiding this comment

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

same as above

miiu96
miiu96 previously approved these changes Sep 18, 2024
@iulianpascalau iulianpascalau merged commit 37f2ae4 into main Sep 18, 2024
6 checks passed
@iulianpascalau iulianpascalau deleted the refactor-python-scripts branch September 18, 2024 08:45
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.

4 participants