You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
2.1 KiB
45 lines
2.1 KiB
![]()
6 years ago
|
from apps.stellar import consts, writers
|
||
|
from apps.stellar.operations import layout, serialize
|
||
![]()
6 years ago
|
|
||
|
|
||
![]()
6 years ago
|
async def process_operation(ctx, w, op):
|
||
![]()
6 years ago
|
if op.source_account:
|
||
![]()
6 years ago
|
await layout.confirm_source_account(ctx, op.source_account)
|
||
![]()
6 years ago
|
serialize.write_account(w, op.source_account)
|
||
![]()
6 years ago
|
writers.write_uint32(w, consts.get_op_code(op))
|
||
|
if isinstance(op, serialize.StellarAccountMergeOp):
|
||
|
await layout.confirm_account_merge_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_account_merge_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarAllowTrustOp):
|
||
|
await layout.confirm_allow_trust_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_allow_trust_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarBumpSequenceOp):
|
||
|
await layout.confirm_bump_sequence_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_bump_sequence_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarChangeTrustOp):
|
||
|
await layout.confirm_change_trust_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_change_trust_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarCreateAccountOp):
|
||
|
await layout.confirm_create_account_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_create_account_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarCreatePassiveOfferOp):
|
||
|
await layout.confirm_create_passive_offer_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_create_passive_offer_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarManageDataOp):
|
||
|
await layout.confirm_manage_data_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_manage_data_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarManageOfferOp):
|
||
|
await layout.confirm_manage_offer_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_manage_offer_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarPathPaymentOp):
|
||
|
await layout.confirm_path_payment_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_path_payment_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarPaymentOp):
|
||
|
await layout.confirm_payment_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_payment_op(w, op)
|
||
![]()
6 years ago
|
elif isinstance(op, serialize.StellarSetOptionsOp):
|
||
|
await layout.confirm_set_options_op(ctx, op)
|
||
![]()
6 years ago
|
serialize.write_set_options_op(w, op)
|
||
![]()
6 years ago
|
else:
|
||
![]()
6 years ago
|
raise ValueError("Unknown operation")
|