-
Notifications
You must be signed in to change notification settings - Fork 39
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
[Improve Existing SDK: Python] - Milestone 1 & 2 #80
Conversation
update: |
update: |
@barekati great progress!
current sdk does not allow reversing the order of calling .with_payload_signature() and .with_envelope_signature(). For example: tx = (
create_account_template(
keys = [account_key],
reference_block_id = latest_block.id,
payer = payer_addr,
proposal_key = ProposalKey(
key_address = ctx.service_account_address,
key_id = ctx.service_account_key_id,
key_sequence_number = proposer.keys[
ctx.service_account_key_id
].sequence_number,
),
)
.add_authorizers(ctx.service_account_address)
.with_payload_signature(
ctx.service_account_address, 0, ctx.service_account_signer
)
.with_envelope_signature(
payer_addr, 0, gen_signer(payer_private_key.hex()),
)
)
result = await client.execute_transaction(tx) works, but the following does not: tx = (
create_account_template(
keys = [account_key],
reference_block_id = latest_block.id,
payer = payer_addr,
proposal_key = ProposalKey(
key_address = ctx.service_account_address,
key_id = ctx.service_account_key_id,
key_sequence_number = proposer.keys[
ctx.service_account_key_id
].sequence_number,
),
)
.add_authorizers(ctx.service_account_address)
.with_envelope_signature(
payer_addr, 0, gen_signer(payer_private_key.hex()),
)
.with_payload_signature(
ctx.service_account_address, 0, ctx.service_account_signer
)
)
result = await client.execute_transaction(tx) ^ this will result in error: Other than these, it's super promising to nail it 👍 In case you did not know: we extended the deadline by one week to Nov 7 to give participants and us enough time to continue tweaking the submissions! See more details in the announcement in our Discord channel (you are super welcome to join there in case you haven't!) -- https://discord.com/channels/613813861610684416/885732226086633483/903516288796721193 |
@kerrywei thanks
|
@barekati So basically you give the Tx object the stamps (signers) and once everything is ready the Tx object gets everything in place and wacks it with the stamps just before sending it away. Does that make sense? |
Yes, i get what you say |
I fixed the issue. now payload ,envelope and authorizer order is not important. |
I left some minor comments, but the solution looks good. |
update: I'll give another look soooon today. |
@barekati I don't have further comments on that PR. My teammate @janezpodhostnik will merge in the Python SDK PR tmr, then merge in this PR. |
Nice work! Thank you very much! 🎉 🚀 |
[Improve Existing SDK: Python] - Milestone 1 & 2
Description
This PR is for issue #46.
All user stories are completed, examples and usage documentations are available at: https://github.com/janezpodhostnik/flow-py-sdk
Features:
Blocks:
Collections:
Events:
Scripts:
Accounts:
Transactions:
Milestones
examples, test and documents files are send as PR to flow python sdk
Other Details
Authers
@amhossaini
@barekati