diff --git a/src/stellar_api.h b/src/stellar_api.h index 29c1fb5e..535eb8bc 100644 --- a/src/stellar_api.h +++ b/src/stellar_api.h @@ -112,6 +112,12 @@ void encode_hash_x_key(const uint8_t *in, char *out); /** raw public key to base32 encoded (summarized) address */ void print_public_key(const uint8_t *in, char *out, uint8_t numCharsL, uint8_t numCharsR); +/** base32 encode muxed account */ +void encode_muxed_account(const MuxedAccount *in, char *out); + +/** raw muxed account to base32 encoded muxed address */ +void print_muxed_account(const MuxedAccount *in, char *out, uint8_t numCharsL, uint8_t numCharsR); + /** output first numCharsL of input + last numCharsR of input separated by ".." */ void print_summary(const char *in, char *out, uint8_t numCharsL, uint8_t numCharsR); @@ -145,6 +151,9 @@ void print_native_asset_code(uint8_t network, char *out, size_t out_len); /** string representation of flags present */ void print_flags(uint32_t flags, char *out, size_t out_len); +/** string representation of trust line flags present */ +void print_trust_line_flags(uint32_t flags, char *out, size_t out_len); + /** integer to string for display of sequence number */ int print_int(int64_t l, char *out, size_t out_len); @@ -154,4 +163,6 @@ int print_uint(uint64_t l, char *out, size_t out_len); /** base64 encoding function used to display managed data values */ void base64_encode(const uint8_t *data, int inLen, char *out); +/** hex representation of flags claimable balance id */ +void print_claimable_balance_id(const ClaimableBalanceID *claimableBalanceID, char *out); #endif diff --git a/src/stellar_format.c b/src/stellar_format.c index 2f0c417a..14772fd2 100644 --- a/src/stellar_format.c +++ b/src/stellar_format.c @@ -18,10 +18,45 @@ static void push_to_formatter_stack(format_function_t formatter) { formatter_stack[formatter_index + 1] = formatter; } +static void format_next_step(tx_context_t *txCtx) { + (void) txCtx; + formatter_stack[formatter_index] = NULL; + set_state_data(true); +} + +static void format_network(tx_context_t *txCtx) { + strcpy(detailCaption, "Network"); + strlcpy(detailValue, (char *) PIC(NETWORK_NAMES[txCtx->network]), DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_next_step); +} + +static void format_fee_bump_transaction_fee(tx_context_t *txCtx) { + strcpy(detailCaption, "Fee"); + Asset asset = {.type = ASSET_TYPE_NATIVE}; + print_amount(txCtx->feeBumpTxDetails.fee, + &asset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_next_step); +} + +static void format_fee_bump_transaction_source(tx_context_t *txCtx) { + strcpy(detailCaption, "Fee Source"); + print_muxed_account(&txCtx->feeBumpTxDetails.feeSource, detailValue, 0, 0); + push_to_formatter_stack(&format_fee_bump_transaction_fee); +} + +static void format_fee_bump_transaction_details(tx_context_t *txCtx) { + strcpy(detailCaption, "Fee Bump"); + strcpy(detailValue, "Transaction Details"); + push_to_formatter_stack(&format_fee_bump_transaction_source); +} + static void format_transaction_source(tx_context_t *txCtx) { strcpy(detailCaption, "Tx Source"); - print_public_key(txCtx->txDetails.sourceAccount, detailValue, 0, 0); - push_to_formatter_stack(NULL); + print_muxed_account(&txCtx->txDetails.sourceAccount, detailValue, 0, 0); + push_to_formatter_stack(format_next_step); } static void format_time_bounds_max_time(tx_context_t *txCtx) { @@ -44,9 +79,9 @@ static void format_time_bounds(tx_context_t *txCtx) { } } -static void format_network(tx_context_t *txCtx) { - strcpy(detailCaption, "Network"); - strlcpy(detailValue, (char *) PIC(NETWORK_NAMES[txCtx->network]), DETAIL_VALUE_MAX_SIZE); +static void format_sequence(tx_context_t *txCtx) { + strcpy(detailCaption, "Sequence Number"); + print_uint(txCtx->txDetails.sequenceNumber, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_time_bounds); } @@ -54,7 +89,7 @@ static void format_fee(tx_context_t *txCtx) { strcpy(detailCaption, "Fee"); Asset asset = {.type = ASSET_TYPE_NATIVE}; print_amount(txCtx->txDetails.fee, &asset, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); - push_to_formatter_stack(&format_network); + push_to_formatter_stack(&format_sequence); } static void format_memo(tx_context_t *txCtx) { @@ -88,67 +123,91 @@ static void format_memo(tx_context_t *txCtx) { push_to_formatter_stack(&format_fee); } -static void format_confirm_transaction_details(tx_context_t *txCtx) { - format_memo(txCtx); +static void format_transaction_details(tx_context_t *txCtx) { + switch (txCtx->envelopeType) { + case ENVELOPE_TYPE_TX_FEE_BUMP: + strcpy(detailCaption, "InnerTx"); + break; + case ENVELOPE_TYPE_TX: + strcpy(detailCaption, "Transaction"); + break; + } + strcpy(detailValue, "Details"); + push_to_formatter_stack(&format_memo); } static void format_operation_source(tx_context_t *txCtx) { - if (txCtx->opDetails.sourceAccountPresent) { - strcpy(detailCaption, "Op Source"); - print_public_key(txCtx->opDetails.sourceAccount, detailValue, 0, 0); - push_to_formatter_stack(&format_confirm_transaction_details); + strcpy(detailCaption, "Op Source"); + if (txCtx->txDetails.opDetails.sourceAccountPresent) { + print_muxed_account(&txCtx->txDetails.opDetails.sourceAccount, detailValue, 0, 0); } else { - if (txCtx->opIdx == txCtx->opCount) { - // last operation: show transaction details - format_confirm_transaction_details(txCtx); - } else { - // more operations: show next operation - formatter_stack[formatter_index] = NULL; - set_state_data(true); - } + strcpy(detailValue, "Not set, use Tx Source as Op Source"); + } + + if (txCtx->txDetails.opIdx == txCtx->txDetails.opCount) { + // last operation + push_to_formatter_stack(NULL); + } else { + // more operations + push_to_formatter_stack(&format_next_step); } } -static void format_bump_sequence(tx_context_t *txCtx) { - strcpy(detailCaption, "Bump Sequence"); - print_int(txCtx->opDetails.bumpSequenceOp.bumpTo, detailValue, DETAIL_VALUE_MAX_SIZE); +static void format_bump_sequence_bump_to(tx_context_t *txCtx) { + strcpy(detailCaption, "Bump To"); + print_int(txCtx->txDetails.opDetails.bumpSequenceOp.bumpTo, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_operation_source); } +static void format_bump_sequence(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Bump Sequence"); + push_to_formatter_stack(&format_bump_sequence_bump_to); +} + static void format_inflation(tx_context_t *txCtx) { (void) txCtx; - strcpy(opCaption, "Run Inflation"); + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Inflation"); push_to_formatter_stack(&format_operation_source); } static void format_account_merge_destination(tx_context_t *txCtx) { strcpy(detailCaption, "Destination"); - print_public_key(txCtx->opDetails.destination, detailValue, 0, 0); + print_muxed_account(&txCtx->txDetails.opDetails.destination, detailValue, 0, 0); push_to_formatter_stack(&format_operation_source); } -static void format_account_merge(tx_context_t *txCtx) { +static void format_account_merge_detail(tx_context_t *txCtx) { strcpy(detailCaption, "Merge Account"); - if (txCtx->opDetails.sourceAccountPresent) { - print_public_key(txCtx->opDetails.sourceAccount, detailValue, 0, 0); + if (txCtx->txDetails.opDetails.sourceAccountPresent) { + print_muxed_account(&txCtx->txDetails.opDetails.sourceAccount, detailValue, 0, 0); } else { - print_public_key(txCtx->txDetails.sourceAccount, detailValue, 0, 0); + print_muxed_account(&txCtx->txDetails.sourceAccount, detailValue, 0, 0); } push_to_formatter_stack(&format_account_merge_destination); } +static void format_account_merge(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Account Merge"); + push_to_formatter_stack(&format_account_merge_detail); +} + static void format_manage_data_value(tx_context_t *txCtx) { strcpy(detailCaption, "Data Value"); char tmp[89]; - base64_encode(txCtx->opDetails.manageDataOp.dataValue, - txCtx->opDetails.manageDataOp.dataValueSize, + base64_encode(txCtx->txDetails.opDetails.manageDataOp.dataValue, + txCtx->txDetails.opDetails.manageDataOp.dataValueSize, tmp); print_summary(tmp, detailValue, 12, 12); push_to_formatter_stack(&format_operation_source); } -static void format_manage_data(tx_context_t *txCtx) { - if (txCtx->opDetails.manageDataOp.dataValueSize) { +static void format_manage_data_detail(tx_context_t *txCtx) { + if (txCtx->txDetails.opDetails.manageDataOp.dataValueSize) { strcpy(detailCaption, "Set Data"); push_to_formatter_stack(&format_manage_data_value); } else { @@ -156,40 +215,63 @@ static void format_manage_data(tx_context_t *txCtx) { push_to_formatter_stack(&format_operation_source); } char tmp[65]; - memcpy(tmp, txCtx->opDetails.manageDataOp.dataName, txCtx->opDetails.manageDataOp.dataNameSize); - tmp[txCtx->opDetails.manageDataOp.dataNameSize] = '\0'; + memcpy(tmp, + txCtx->txDetails.opDetails.manageDataOp.dataName, + txCtx->txDetails.opDetails.manageDataOp.dataNameSize); + tmp[txCtx->txDetails.opDetails.manageDataOp.dataNameSize] = '\0'; print_summary(tmp, detailValue, 12, 12); } -static void format_allow_trust_trustor(tx_context_t *txCtx) { - strcpy(detailCaption, "Account ID"); - print_public_key(txCtx->opDetails.allowTrustOp.trustor, detailValue, 0, 0); - push_to_formatter_stack(&format_operation_source); +static void format_manage_data(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Manage Data"); + push_to_formatter_stack(&format_manage_data_detail); } -static void format_allow_trust(tx_context_t *txCtx) { - if (txCtx->opDetails.allowTrustOp.authorize) { - strcpy(detailCaption, "Allow Trust"); +static void format_allow_trust_authorize(tx_context_t *txCtx) { + strcpy(detailCaption, "Authorize Flag"); + if (txCtx->txDetails.opDetails.allowTrustOp.authorize == AUTHORIZED_FLAG) { + strlcpy(detailValue, "AUTHORIZED_FLAG", DETAIL_VALUE_MAX_SIZE); + } else if (txCtx->txDetails.opDetails.allowTrustOp.authorize == + AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG) { + strlcpy(detailValue, "AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG", DETAIL_VALUE_MAX_SIZE); } else { - strcpy(detailCaption, "Revoke Trust"); + strlcpy(detailValue, "UNAUTHORIZED_FLAG", DETAIL_VALUE_MAX_SIZE); } - strlcpy(detailValue, txCtx->opDetails.allowTrustOp.assetCode, DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_operation_source); +} + +static void format_allow_trust_asset_code(tx_context_t *txCtx) { + strcpy(detailCaption, "Asset Code"); + strlcpy(detailValue, txCtx->txDetails.opDetails.allowTrustOp.assetCode, DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_allow_trust_authorize); +} + +static void format_allow_trust_trustor(tx_context_t *txCtx) { + strcpy(detailCaption, "Trustor"); + print_public_key(txCtx->txDetails.opDetails.allowTrustOp.trustor, detailValue, 0, 0); + push_to_formatter_stack(&format_allow_trust_asset_code); +} + +static void format_allow_trust(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Allow Trust"); push_to_formatter_stack(&format_allow_trust_trustor); } static void format_set_option_signer_weight(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.signer.weight) { - strcpy(detailCaption, "Weight"); - print_uint(txCtx->opDetails.setOptionsOp.signer.weight, detailValue, DETAIL_VALUE_MAX_SIZE); - push_to_formatter_stack(&format_operation_source); - } else { - format_operation_source(txCtx); - } + strcpy(detailCaption, "Weight"); + print_uint(txCtx->txDetails.opDetails.setOptionsOp.signer.weight, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_operation_source); } static void format_set_option_signer_detail(tx_context_t *txCtx) { strcpy(detailCaption, "Signer Key"); - SignerKey *key = &txCtx->opDetails.setOptionsOp.signer.key; + SignerKey *key = &txCtx->txDetails.opDetails.setOptionsOp.signer.key; switch (key->type) { case SIGNER_KEY_TYPE_ED25519: { @@ -214,8 +296,8 @@ static void format_set_option_signer_detail(tx_context_t *txCtx) { } static void format_set_option_signer(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.signerPresent) { - signer_t *signer = &txCtx->opDetails.setOptionsOp.signer; + if (txCtx->txDetails.opDetails.setOptionsOp.signerPresent) { + signer_t *signer = &txCtx->txDetails.opDetails.setOptionsOp.signer; if (signer->weight) { strcpy(detailCaption, "Add Signer"); } else { @@ -242,12 +324,12 @@ static void format_set_option_signer(tx_context_t *txCtx) { } static void format_set_option_home_domain(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.homeDomainSize) { + if (txCtx->txDetails.opDetails.setOptionsOp.homeDomainSize) { strcpy(detailCaption, "Home Domain"); memcpy(detailValue, - txCtx->opDetails.setOptionsOp.homeDomain, - txCtx->opDetails.setOptionsOp.homeDomainSize); - detailValue[txCtx->opDetails.setOptionsOp.homeDomainSize] = '\0'; + txCtx->txDetails.opDetails.setOptionsOp.homeDomain, + txCtx->txDetails.opDetails.setOptionsOp.homeDomainSize); + detailValue[txCtx->txDetails.opDetails.setOptionsOp.homeDomainSize] = '\0'; push_to_formatter_stack(&format_set_option_signer); } else { format_set_option_signer(txCtx); @@ -255,9 +337,11 @@ static void format_set_option_home_domain(tx_context_t *txCtx) { } static void format_set_option_high_threshold(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.highThresholdPresent) { + if (txCtx->txDetails.opDetails.setOptionsOp.highThresholdPresent) { strcpy(detailCaption, "High Threshold"); - print_uint(txCtx->opDetails.setOptionsOp.highThreshold, detailValue, DETAIL_VALUE_MAX_SIZE); + print_uint(txCtx->txDetails.opDetails.setOptionsOp.highThreshold, + detailValue, + DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_set_option_home_domain); } else { format_set_option_home_domain(txCtx); @@ -265,9 +349,9 @@ static void format_set_option_high_threshold(tx_context_t *txCtx) { } static void format_set_option_medium_threshold(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.mediumThresholdPresent) { + if (txCtx->txDetails.opDetails.setOptionsOp.mediumThresholdPresent) { strcpy(detailCaption, "Medium Threshold"); - print_uint(txCtx->opDetails.setOptionsOp.mediumThreshold, + print_uint(txCtx->txDetails.opDetails.setOptionsOp.mediumThreshold, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_set_option_high_threshold); @@ -277,9 +361,11 @@ static void format_set_option_medium_threshold(tx_context_t *txCtx) { } static void format_set_option_low_threshold(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.lowThresholdPresent) { + if (txCtx->txDetails.opDetails.setOptionsOp.lowThresholdPresent) { strcpy(detailCaption, "Low Threshold"); - print_uint(txCtx->opDetails.setOptionsOp.lowThreshold, detailValue, DETAIL_VALUE_MAX_SIZE); + print_uint(txCtx->txDetails.opDetails.setOptionsOp.lowThreshold, + detailValue, + DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_set_option_medium_threshold); } else { format_set_option_medium_threshold(txCtx); @@ -287,9 +373,11 @@ static void format_set_option_low_threshold(tx_context_t *txCtx) { } static void format_set_option_master_weight(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.masterWeightPresent) { + if (txCtx->txDetails.opDetails.setOptionsOp.masterWeightPresent) { strcpy(detailCaption, "Master Weight"); - print_uint(txCtx->opDetails.setOptionsOp.masterWeight, detailValue, DETAIL_VALUE_MAX_SIZE); + print_uint(txCtx->txDetails.opDetails.setOptionsOp.masterWeight, + detailValue, + DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_set_option_low_threshold); } else { format_set_option_low_threshold(txCtx); @@ -297,9 +385,11 @@ static void format_set_option_master_weight(tx_context_t *txCtx) { } static void format_set_option_set_flags(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.setFlags) { + if (txCtx->txDetails.opDetails.setOptionsOp.setFlags) { strcpy(detailCaption, "Set Flags"); - print_flags(txCtx->opDetails.setOptionsOp.setFlags, detailValue, DETAIL_VALUE_MAX_SIZE); + print_flags(txCtx->txDetails.opDetails.setOptionsOp.setFlags, + detailValue, + DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_set_option_master_weight); } else { format_set_option_master_weight(txCtx); @@ -307,9 +397,11 @@ static void format_set_option_set_flags(tx_context_t *txCtx) { } static void format_set_option_clear_flags(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.clearFlags) { + if (txCtx->txDetails.opDetails.setOptionsOp.clearFlags) { strcpy(detailCaption, "Clear Flags"); - print_flags(txCtx->opDetails.setOptionsOp.clearFlags, detailValue, DETAIL_VALUE_MAX_SIZE); + print_flags(txCtx->txDetails.opDetails.setOptionsOp.clearFlags, + detailValue, + DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_set_option_set_flags); } else { format_set_option_set_flags(txCtx); @@ -317,9 +409,12 @@ static void format_set_option_clear_flags(tx_context_t *txCtx) { } static void format_set_option_inflation_destination(tx_context_t *txCtx) { - if (txCtx->opDetails.setOptionsOp.inflationDestinationPresent) { + if (txCtx->txDetails.opDetails.setOptionsOp.inflationDestinationPresent) { strcpy(detailCaption, "Inflation Dest"); - print_public_key(txCtx->opDetails.setOptionsOp.inflationDestination, detailValue, 0, 0); + print_public_key(txCtx->txDetails.opDetails.setOptionsOp.inflationDestination, + detailValue, + 0, + 0); push_to_formatter_stack(&format_set_option_clear_flags); } else { format_set_option_clear_flags(txCtx); @@ -327,15 +422,18 @@ static void format_set_option_inflation_destination(tx_context_t *txCtx) { } static void format_set_options(tx_context_t *txCtx) { - format_set_option_inflation_destination(txCtx); + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Set Options"); + push_to_formatter_stack(&format_set_option_inflation_destination); } static void format_change_trust_limit(tx_context_t *txCtx) { strcpy(detailCaption, "Trust Limit"); - if (txCtx->opDetails.changeTrustOp.limit == INT64_MAX) { + if (txCtx->txDetails.opDetails.changeTrustOp.limit == INT64_MAX) { strcpy(detailValue, "[maximum]"); } else { - print_amount(txCtx->opDetails.changeTrustOp.limit, + print_amount(txCtx->txDetails.opDetails.changeTrustOp.limit, NULL, txCtx->network, detailValue, @@ -344,80 +442,96 @@ static void format_change_trust_limit(tx_context_t *txCtx) { push_to_formatter_stack(&format_operation_source); } -static void format_change_trust(tx_context_t *txCtx) { - if (txCtx->opDetails.changeTrustOp.limit) { +static void format_change_trust_detail(tx_context_t *txCtx) { + if (txCtx->txDetails.opDetails.changeTrustOp.limit) { strcpy(detailCaption, "Change Trust"); push_to_formatter_stack(&format_change_trust_limit); } else { strcpy(detailCaption, "Remove Trust"); push_to_formatter_stack(&format_operation_source); } - uint8_t asset_type = txCtx->opDetails.changeTrustOp.line.type; + uint8_t asset_type = txCtx->txDetails.opDetails.changeTrustOp.line.type; if (asset_type != ASSET_TYPE_CREDIT_ALPHANUM4 && asset_type != ASSET_TYPE_CREDIT_ALPHANUM12) { return; } - print_asset_t(&txCtx->opDetails.changeTrustOp.line, + print_asset_t(&txCtx->txDetails.opDetails.changeTrustOp.line, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); } -static void format_manage_offer_sell(tx_context_t *txCtx) { +static void format_change_trust(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Change Trust"); + push_to_formatter_stack(&format_change_trust_detail); +} + +static void format_manage_sell_offer_sell(tx_context_t *txCtx) { strcpy(detailCaption, "Sell"); - print_amount(txCtx->opDetails.manageSellOfferOp.amount, - &txCtx->opDetails.manageSellOfferOp.selling, + print_amount(txCtx->txDetails.opDetails.manageSellOfferOp.amount, + &txCtx->txDetails.opDetails.manageSellOfferOp.selling, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_operation_source); } -static void format_manage_offer_price(tx_context_t *txCtx) { +static void format_manage_sell_offer_price(tx_context_t *txCtx) { strcpy(detailCaption, "Price"); - uint64_t price = ((uint64_t) txCtx->opDetails.manageSellOfferOp.price.n * 10000000) / - txCtx->opDetails.manageSellOfferOp.price.d; + uint64_t price = ((uint64_t) txCtx->txDetails.opDetails.manageSellOfferOp.price.n * 10000000) / + txCtx->txDetails.opDetails.manageSellOfferOp.price.d; print_amount(price, - &txCtx->opDetails.manageSellOfferOp.buying, + &txCtx->txDetails.opDetails.manageSellOfferOp.buying, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); - push_to_formatter_stack(&format_manage_offer_sell); + push_to_formatter_stack(&format_manage_sell_offer_sell); } -static void format_manage_offer_buy(tx_context_t *txCtx) { +static void format_manage_sell_offer_buy(tx_context_t *txCtx) { strcpy(detailCaption, "Buy"); - if (txCtx->opDetails.manageSellOfferOp.buying.type == ASSET_TYPE_NATIVE) { + if (txCtx->txDetails.opDetails.manageSellOfferOp.buying.type == ASSET_TYPE_NATIVE) { print_native_asset_code(txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); } else { - print_asset_t(&txCtx->opDetails.manageSellOfferOp.buying, + print_asset_t(&txCtx->txDetails.opDetails.manageSellOfferOp.buying, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); } - push_to_formatter_stack(&format_manage_offer_price); + push_to_formatter_stack(&format_manage_sell_offer_price); } -static void format_manage_offer(tx_context_t *txCtx) { - if (!txCtx->opDetails.manageSellOfferOp.amount) { +static void format_manage_sell_offer_detail(tx_context_t *txCtx) { + if (!txCtx->txDetails.opDetails.manageSellOfferOp.amount) { strcpy(detailCaption, "Remove Offer"); - print_uint(txCtx->opDetails.manageSellOfferOp.offerID, detailValue, DETAIL_VALUE_MAX_SIZE); + print_uint(txCtx->txDetails.opDetails.manageSellOfferOp.offerID, + detailValue, + DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_operation_source); } else { - if (txCtx->opDetails.manageSellOfferOp.offerID) { + if (txCtx->txDetails.opDetails.manageSellOfferOp.offerID) { strcpy(detailCaption, "Change Offer"); - print_uint(txCtx->opDetails.manageSellOfferOp.offerID, + print_uint(txCtx->txDetails.opDetails.manageSellOfferOp.offerID, detailValue, DETAIL_VALUE_MAX_SIZE); } else { strcpy(detailCaption, "Create Offer"); strcpy(detailValue, "Type Active"); } - push_to_formatter_stack(&format_manage_offer_buy); + push_to_formatter_stack(&format_manage_sell_offer_buy); } } +static void format_manage_sell_offer(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Manage Sell Offer"); + push_to_formatter_stack(&format_manage_sell_offer_detail); +} + static void format_manage_buy_offer_buy(tx_context_t *txCtx) { - ManageBuyOfferOp *op = &txCtx->opDetails.manageBuyOfferOp; + ManageBuyOfferOp *op = &txCtx->txDetails.opDetails.manageBuyOfferOp; strcpy(detailCaption, "Buy"); print_amount(op->buyAmount, &op->buying, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); @@ -425,7 +539,7 @@ static void format_manage_buy_offer_buy(tx_context_t *txCtx) { } static void format_manage_buy_offer_price(tx_context_t *txCtx) { - ManageBuyOfferOp *op = &txCtx->opDetails.manageBuyOfferOp; + ManageBuyOfferOp *op = &txCtx->txDetails.opDetails.manageBuyOfferOp; strcpy(detailCaption, "Price"); uint64_t price = ((uint64_t) op->price.n * 10000000) / op->price.d; @@ -434,7 +548,7 @@ static void format_manage_buy_offer_price(tx_context_t *txCtx) { } static void format_manage_buy_offer_sell(tx_context_t *txCtx) { - ManageBuyOfferOp *op = &txCtx->opDetails.manageBuyOfferOp; + ManageBuyOfferOp *op = &txCtx->txDetails.opDetails.manageBuyOfferOp; strcpy(detailCaption, "Sell"); if (op->selling.type == ASSET_TYPE_NATIVE) { @@ -445,8 +559,8 @@ static void format_manage_buy_offer_sell(tx_context_t *txCtx) { push_to_formatter_stack(&format_manage_buy_offer_price); } -static void format_manage_buy_offer(tx_context_t *txCtx) { - ManageBuyOfferOp *op = &txCtx->opDetails.manageBuyOfferOp; +static void format_manage_buy_offer_detail(tx_context_t *txCtx) { + ManageBuyOfferOp *op = &txCtx->txDetails.opDetails.manageBuyOfferOp; if (op->buyAmount == 0) { strcpy(detailCaption, "Remove Offer"); @@ -464,10 +578,17 @@ static void format_manage_buy_offer(tx_context_t *txCtx) { } } +static void format_manage_buy_offer(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Manage Buy Offer"); + push_to_formatter_stack(&format_manage_buy_offer_detail); +} + static void format_create_passive_sell_offer_sell(tx_context_t *txCtx) { strcpy(detailCaption, "Sell"); - print_amount(txCtx->opDetails.createPassiveSellOfferOp.amount, - &txCtx->opDetails.createPassiveSellOfferOp.selling, + print_amount(txCtx->txDetails.opDetails.createPassiveSellOfferOp.amount, + &txCtx->txDetails.opDetails.createPassiveSellOfferOp.selling, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); @@ -477,7 +598,7 @@ static void format_create_passive_sell_offer_sell(tx_context_t *txCtx) { static void format_create_passive_sell_offer_price(tx_context_t *txCtx) { strcpy(detailCaption, "Price"); - CreatePassiveSellOfferOp *op = &txCtx->opDetails.createPassiveSellOfferOp; + CreatePassiveSellOfferOp *op = &txCtx->txDetails.opDetails.createPassiveSellOfferOp; uint64_t price = ((uint64_t) op->price.n * 10000000) / op->price.d; print_amount(price, &op->buying, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_create_passive_sell_offer_sell); @@ -485,10 +606,10 @@ static void format_create_passive_sell_offer_price(tx_context_t *txCtx) { static void format_create_passive_sell_offer_buy(tx_context_t *txCtx) { strcpy(detailCaption, "Buy"); - if (txCtx->opDetails.createPassiveSellOfferOp.buying.type == ASSET_TYPE_NATIVE) { + if (txCtx->txDetails.opDetails.createPassiveSellOfferOp.buying.type == ASSET_TYPE_NATIVE) { print_native_asset_code(txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); } else { - print_asset_t(&txCtx->opDetails.createPassiveSellOfferOp.buying, + print_asset_t(&txCtx->txDetails.opDetails.createPassiveSellOfferOp.buying, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); @@ -498,18 +619,18 @@ static void format_create_passive_sell_offer_buy(tx_context_t *txCtx) { static void format_create_passive_sell_offer(tx_context_t *txCtx) { (void) txCtx; - strcpy(detailCaption, "Create Offer"); - strcpy(detailValue, "Type Passive"); + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Create Passive Sell Offer"); push_to_formatter_stack(&format_create_passive_sell_offer_buy); } static void format_path_via(tx_context_t *txCtx) { - if (txCtx->opDetails.pathPaymentStrictReceiveOp.pathLen) { + if (txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.pathLen) { strcpy(detailCaption, "Via"); uint8_t i; - for (i = 0; i < txCtx->opDetails.pathPaymentStrictReceiveOp.pathLen; i++) { + for (i = 0; i < txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.pathLen; i++) { char asset_name[12 + 1]; - Asset *asset = &txCtx->opDetails.pathPaymentStrictReceiveOp.path[i]; + Asset *asset = &txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.path[i]; if (strlen(detailValue) != 0) { strlcat(detailValue, ", ", DETAIL_VALUE_MAX_SIZE); } @@ -522,52 +643,98 @@ static void format_path_via(tx_context_t *txCtx) { } } -static void format_path_receive(tx_context_t *txCtx) { +static void format_path_payment_strict_receive_receive(tx_context_t *txCtx) { strcpy(detailCaption, "Receive"); - print_amount(txCtx->opDetails.pathPaymentStrictReceiveOp.destAmount, - &txCtx->opDetails.pathPaymentStrictReceiveOp.destAsset, + print_amount(txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.destAmount, + &txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.destAsset, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_path_via); } -static void format_path_destination(tx_context_t *txCtx) { +static void format_path_payment_strict_receive_destination(tx_context_t *txCtx) { strcpy(detailCaption, "Destination"); - print_public_key(txCtx->opDetails.pathPaymentStrictReceiveOp.destination, detailValue, 0, 0); - push_to_formatter_stack(&format_path_receive); + print_muxed_account(&txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.destination, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_path_payment_strict_receive_receive); } -static void format_path_payment(tx_context_t *txCtx) { +static void format_path_payment_strict_receive_send(tx_context_t *txCtx) { strcpy(detailCaption, "Send Max"); - print_amount(txCtx->opDetails.pathPaymentStrictReceiveOp.sendMax, - &txCtx->opDetails.pathPaymentStrictReceiveOp.sendAsset, + print_amount(txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.sendMax, + &txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.sendAsset, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); - push_to_formatter_stack(&format_path_destination); + push_to_formatter_stack(&format_path_payment_strict_receive_destination); +} + +static void format_path_payment_strict_receive(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Path Payment Strict Receive"); + push_to_formatter_stack(&format_path_payment_strict_receive_send); +} + +static void format_path_payment_strict_send_receive(tx_context_t *txCtx) { + strcpy(detailCaption, "Receive Min"); + print_amount(txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.destAmount, + &txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.destAsset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_path_via); +} + +static void format_path_payment_strict_send_destination(tx_context_t *txCtx) { + strcpy(detailCaption, "Destination"); + print_muxed_account(&txCtx->txDetails.opDetails.pathPaymentStrictReceiveOp.destination, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_path_payment_strict_send_receive); +} + +static void format_path_payment_strict_send(tx_context_t *txCtx) { + strcpy(detailCaption, "Send"); + print_amount(txCtx->txDetails.opDetails.pathPaymentStrictSendOp.sendAmount, + &txCtx->txDetails.opDetails.pathPaymentStrictSendOp.sendAsset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_path_payment_strict_send_destination); } static void format_payment_destination(tx_context_t *txCtx) { strcpy(detailCaption, "Destination"); - print_public_key(txCtx->opDetails.payment.destination, detailValue, 0, 0); + print_muxed_account(&txCtx->txDetails.opDetails.payment.destination, detailValue, 0, 0); push_to_formatter_stack(&format_operation_source); } -static void format_payment(tx_context_t *txCtx) { +static void format_payment_send(tx_context_t *txCtx) { strcpy(detailCaption, "Send"); - print_amount(txCtx->opDetails.payment.amount, - &txCtx->opDetails.payment.asset, + print_amount(txCtx->txDetails.opDetails.payment.amount, + &txCtx->txDetails.opDetails.payment.asset, txCtx->network, detailValue, DETAIL_VALUE_MAX_SIZE); push_to_formatter_stack(&format_payment_destination); } +static void format_payment(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Payment"); + push_to_formatter_stack(&format_payment_send); +} + static void format_create_account_amount(tx_context_t *txCtx) { strcpy(detailCaption, "Starting Balance"); Asset asset = {.type = ASSET_TYPE_NATIVE}; - print_amount(txCtx->opDetails.createAccount.startingBalance, + print_amount(txCtx->txDetails.opDetails.createAccount.startingBalance, &asset, txCtx->network, detailValue, @@ -575,38 +742,361 @@ static void format_create_account_amount(tx_context_t *txCtx) { push_to_formatter_stack(&format_operation_source); } -static void format_create_account(tx_context_t *txCtx) { - strcpy(detailCaption, "Create Account"); - print_public_key(txCtx->opDetails.createAccount.destination, detailValue, 0, 0); +static void format_create_account_destination(tx_context_t *txCtx) { + strcpy(detailCaption, "Destination"); + print_public_key(txCtx->txDetails.opDetails.createAccount.destination, detailValue, 0, 0); push_to_formatter_stack(&format_create_account_amount); } -static const format_function_t formatters[13] = {&format_create_account, - &format_payment, - &format_path_payment, - &format_manage_offer, - &format_create_passive_sell_offer, - &format_set_options, - &format_change_trust, - &format_allow_trust, - &format_account_merge, - &format_inflation, - &format_manage_data, - &format_bump_sequence, - &format_manage_buy_offer}; +static void format_create_account(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Create Account"); + push_to_formatter_stack(&format_create_account_destination); +} + +void format_create_claimable_balance_warning(tx_context_t *txCtx) { + (void) txCtx; + // TODO: The claimant can be very complicated. I haven't figured out how to + // display it for the time being, so let's display an WARNING here first. + strcpy(detailCaption, "WARNING"); + strcpy(detailValue, "Currently does not support displaying claimant details"); + push_to_formatter_stack(&format_operation_source); +} + +static void format_create_claimable_balance_balance(tx_context_t *txCtx) { + strcpy(detailCaption, "Balance"); + print_amount(txCtx->txDetails.opDetails.createClaimableBalanceOp.amount, + &txCtx->txDetails.opDetails.createClaimableBalanceOp.asset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_create_claimable_balance_warning); +} + +static void format_create_claimable_balance(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Create Claimable Balance"); + push_to_formatter_stack(&format_create_claimable_balance_balance); +} + +static void format_claim_claimable_balance_balance_id(tx_context_t *txCtx) { + strcpy(detailCaption, "Balance ID"); + print_claimable_balance_id(&txCtx->txDetails.opDetails.claimClaimableBalanceOp.balanceID, + detailValue); + push_to_formatter_stack(&format_operation_source); +} + +static void format_claim_claimable_balance(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Claim Claimable Balance"); + push_to_formatter_stack(&format_claim_claimable_balance_balance_id); +} + +static void format_claim_claimable_balance_sponsored_id(tx_context_t *txCtx) { + strcpy(detailCaption, "Sponsored ID"); + print_public_key(txCtx->txDetails.opDetails.beginSponsoringFutureReservesOp.sponsoredID, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_operation_source); +} + +static void format_begin_sponsoring_future_reserves(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Begin Sponsoring Future Reserves"); + push_to_formatter_stack(&format_claim_claimable_balance_sponsored_id); +} + +static void format_end_sponsoring_future_reserves(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "End Sponsoring Future Reserves"); + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_account(tx_context_t *txCtx) { + strcpy(detailCaption, "Account ID"); + print_public_key(txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.account.accountID, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_trust_line_asset(tx_context_t *txCtx) { + strcpy(detailCaption, "Asset"); + print_asset_t(&txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.trustLine.asset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_trust_line_account(tx_context_t *txCtx) { + strcpy(detailCaption, "Account ID"); + print_public_key(txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.trustLine.accountID, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_revoke_sponsorship_trust_line_asset); +} +static void format_revoke_sponsorship_offer_offer_id(tx_context_t *txCtx) { + strcpy(detailCaption, "Offer ID"); + print_uint(txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.offer.offerID, + detailValue, + DETAIL_VALUE_MAX_SIZE); + + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_offer_seller_id(tx_context_t *txCtx) { + strcpy(detailCaption, "Seller ID"); + print_public_key(txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.offer.sellerID, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_revoke_sponsorship_offer_offer_id); +} + +static void format_revoke_sponsorship_data_data_name(tx_context_t *txCtx) { + strcpy(detailCaption, "Data Name"); + char tmp[65]; + memcpy(tmp, + txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.data.dataName, + txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.data.dataNameSize); + tmp[txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.data.dataNameSize] = '\0'; + strcpy(detailValue, tmp); + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_data_account(tx_context_t *txCtx) { + strcpy(detailCaption, "Account ID"); + print_public_key(txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.data.accountID, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_revoke_sponsorship_data_data_name); +} + +static void format_revoke_sponsorship_claimable_balance(tx_context_t *txCtx) { + strcpy(detailCaption, "Balance ID"); + print_claimable_balance_id( + &txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.claimableBalance.balanceId, + detailValue); + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_claimable_signer_signer_key_detail(tx_context_t *txCtx) { + strcpy(detailCaption, "Signer Key"); + SignerKey *key = &txCtx->txDetails.opDetails.revokeSponsorshipOp.signer.signerKey; + + switch (key->type) { + case SIGNER_KEY_TYPE_ED25519: { + print_public_key(key->data, detailValue, 0, 0); + break; + } + case SIGNER_KEY_TYPE_HASH_X: { + char tmp[57]; + encode_hash_x_key(key->data, tmp); + print_summary(tmp, detailValue, 12, 12); + break; + } + + case SIGNER_KEY_TYPE_PRE_AUTH_TX: { + char tmp[57]; + encode_pre_auth_key(key->data, tmp); + print_summary(tmp, detailValue, 12, 12); + break; + } + } + push_to_formatter_stack(&format_operation_source); +} + +static void format_revoke_sponsorship_claimable_signer_signer_key_type(tx_context_t *txCtx) { + strcpy(detailCaption, "Signer Key Type"); + switch (txCtx->txDetails.opDetails.revokeSponsorshipOp.signer.signerKey.type) { + case SIGNER_KEY_TYPE_ED25519: { + strcpy(detailValue, "Public Key"); + break; + } + case SIGNER_KEY_TYPE_HASH_X: { + strcpy(detailValue, "Hash(x)"); + break; + } + case SIGNER_KEY_TYPE_PRE_AUTH_TX: { + strcpy(detailValue, "Pre-Auth"); + break; + } + } + + push_to_formatter_stack(&format_revoke_sponsorship_claimable_signer_signer_key_detail); +} + +static void format_revoke_sponsorship_claimable_signer_account(tx_context_t *txCtx) { + strcpy(detailCaption, "Account ID"); + print_public_key(txCtx->txDetails.opDetails.revokeSponsorshipOp.signer.accountID, + detailValue, + 0, + 0); + push_to_formatter_stack(&format_revoke_sponsorship_claimable_signer_signer_key_type); +} + +static void format_revoke_sponsorship(tx_context_t *txCtx) { + strcpy(detailCaption, "Operation Type"); + if (txCtx->txDetails.opDetails.revokeSponsorshipOp.type == REVOKE_SPONSORSHIP_SIGNER) { + strcpy(detailValue, "Revoke Sponsorship (SIGNER_KEY)"); + push_to_formatter_stack(&format_revoke_sponsorship_claimable_signer_account); + } else { + switch (txCtx->txDetails.opDetails.revokeSponsorshipOp.ledgerKey.type) { + case ACCOUNT: + strcpy(detailValue, "Revoke Sponsorship (ACCOUNT)"); + push_to_formatter_stack(&format_revoke_sponsorship_account); + break; + case OFFER: + strcpy(detailValue, "Revoke Sponsorship (OFFER)"); + push_to_formatter_stack(&format_revoke_sponsorship_offer_seller_id); + break; + case TRUSTLINE: + strcpy(detailValue, "Revoke Sponsorship (TRUSTLINE)"); + push_to_formatter_stack(&format_revoke_sponsorship_trust_line_account); + break; + case DATA: + strcpy(detailValue, "Revoke Sponsorship (DATA)"); + push_to_formatter_stack(&format_revoke_sponsorship_data_account); + break; + case CLAIMABLE_BALANCE: + strcpy(detailValue, "Revoke Sponsorship (CLAIMABLE_BALANCE)"); + push_to_formatter_stack(&format_revoke_sponsorship_claimable_balance); + break; + } + } +} + +static void format_clawback_from(tx_context_t *txCtx) { + strcpy(detailCaption, "From"); + print_muxed_account(&txCtx->txDetails.opDetails.clawbackOp.from, detailValue, 0, 0); + push_to_formatter_stack(&format_operation_source); +} + +static void format_clawback_amount(tx_context_t *txCtx) { + strcpy(detailCaption, "Clawback Balance"); + print_amount(txCtx->txDetails.opDetails.clawbackOp.amount, + &txCtx->txDetails.opDetails.clawbackOp.asset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_clawback_from); +} + +static void format_clawback(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Clawback"); + push_to_formatter_stack(&format_clawback_amount); +} + +static void format_clawback_claimable_balance_balance_id(tx_context_t *txCtx) { + strcpy(detailCaption, "Balance ID"); + print_claimable_balance_id(&txCtx->txDetails.opDetails.clawbackClaimableBalanceOp.balanceID, + detailValue); + push_to_formatter_stack(&format_operation_source); +} + +static void format_clawback_claimable_balance(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Clawback Claimable Balance"); + push_to_formatter_stack(&format_clawback_claimable_balance_balance_id); +} + +static void format_set_trust_line_set_flags(tx_context_t *txCtx) { + strcpy(detailCaption, "Set Flags"); + if (txCtx->txDetails.opDetails.setTrustLineFlagsOp.setFlags) { + print_trust_line_flags(txCtx->txDetails.opDetails.setTrustLineFlagsOp.setFlags, + detailValue, + DETAIL_VALUE_MAX_SIZE); + } else { + strcpy(detailValue, "[none]"); + } + push_to_formatter_stack(&format_operation_source); +} + +static void format_set_trust_line_clear_flags(tx_context_t *txCtx) { + strcpy(detailCaption, "Clear Flags"); + if (txCtx->txDetails.opDetails.setTrustLineFlagsOp.clearFlags) { + print_trust_line_flags(txCtx->txDetails.opDetails.setTrustLineFlagsOp.clearFlags, + detailValue, + DETAIL_VALUE_MAX_SIZE); + } else { + strcpy(detailValue, "[none]"); + } + push_to_formatter_stack(&format_set_trust_line_set_flags); +} + +static void format_set_trust_line_asset(tx_context_t *txCtx) { + strcpy(detailCaption, "Asset"); + print_asset_t(&txCtx->txDetails.opDetails.setTrustLineFlagsOp.asset, + txCtx->network, + detailValue, + DETAIL_VALUE_MAX_SIZE); + push_to_formatter_stack(&format_set_trust_line_clear_flags); +} + +static void format_set_trust_line_trustor(tx_context_t *txCtx) { + strcpy(detailCaption, "Trustor"); + print_public_key(txCtx->txDetails.opDetails.setTrustLineFlagsOp.trustor, detailValue, 0, 0); + push_to_formatter_stack(&format_set_trust_line_asset); +} + +static void format_set_trust_line_flags(tx_context_t *txCtx) { + (void) txCtx; + strcpy(detailCaption, "Operation Type"); + strcpy(detailValue, "Set Trust Line Flags"); + push_to_formatter_stack(&format_set_trust_line_trustor); +} + +static const format_function_t formatters[] = { + &format_create_account, + &format_payment, + &format_path_payment_strict_receive, + &format_manage_sell_offer, + &format_create_passive_sell_offer, + &format_set_options, + &format_change_trust, + &format_allow_trust, + &format_account_merge, + &format_inflation, + &format_manage_data, + &format_bump_sequence, + &format_manage_buy_offer, + &format_path_payment_strict_send, + &format_create_claimable_balance, + &format_claim_claimable_balance, + &format_begin_sponsoring_future_reserves, + &format_end_sponsoring_future_reserves, + &format_revoke_sponsorship, + &format_clawback, + &format_clawback_claimable_balance, + &format_set_trust_line_flags, +}; void format_confirm_operation(tx_context_t *txCtx) { - if (txCtx->opCount > 1) { + if (txCtx->txDetails.opCount > 1) { size_t len; strcpy(opCaption, "Operation "); len = strlen(opCaption); - print_uint(txCtx->opIdx, opCaption + len, OPERATION_CAPTION_MAX_SIZE - len); + print_uint(txCtx->txDetails.opIdx, opCaption + len, OPERATION_CAPTION_MAX_SIZE - len); strlcat(opCaption, " of ", sizeof(opCaption)); len = strlen(opCaption); - print_uint(txCtx->opCount, opCaption + len, OPERATION_CAPTION_MAX_SIZE - len); - push_to_formatter_stack(((format_function_t) PIC(formatters[txCtx->opDetails.type]))); + print_uint(txCtx->txDetails.opCount, opCaption + len, OPERATION_CAPTION_MAX_SIZE - len); + push_to_formatter_stack( + ((format_function_t) PIC(formatters[txCtx->txDetails.opDetails.type]))); } else { - ((format_function_t) PIC(formatters[txCtx->opDetails.type]))(txCtx); + ((format_function_t) PIC(formatters[txCtx->txDetails.opDetails.type]))(txCtx); } } @@ -635,10 +1125,37 @@ format_function_t get_formatter(tx_context_t *txCtx, bool forward) { } // rewind to tx beginning if we're requesting a previous operation txCtx->offset = 0; - txCtx->opIdx = 0; + txCtx->txDetails.opIdx = 0; + } + + uint8_t data_count_before_ops; + if (txCtx->envelopeType == ENVELOPE_TYPE_TX_FEE_BUMP) { + data_count_before_ops = 3; + switch (current_data_index) { + case 1: + return &format_network; + case 2: + return &format_fee_bump_transaction_details; + case 3: + return &format_transaction_details; + default: + break; + } + } else if (txCtx->envelopeType == ENVELOPE_TYPE_TX) { + data_count_before_ops = 2; + switch (current_data_index) { + case 1: + return &format_network; + case 2: + return &format_transaction_details; + default: + break; + } + } else { + THROW(0x6125); } - while (current_data_index > txCtx->opIdx) { + while (current_data_index - data_count_before_ops > txCtx->txDetails.opIdx) { if (!parse_tx_xdr(txCtx->raw, txCtx->rawLength, txCtx)) { return NULL; } diff --git a/src/stellar_parser.c b/src/stellar_parser.c index 7b02935f..84dcc53c 100644 --- a/src/stellar_parser.c +++ b/src/stellar_parser.c @@ -124,6 +124,28 @@ bool parse_account_id(buffer_t *buffer, const uint8_t **account_id) { return true; } +static bool parse_muxed_account(buffer_t *buffer, MuxedAccount *muxed_account) { + uint32_t cryptoKeyType; + PARSER_CHECK(buffer_read32(buffer, &cryptoKeyType)) + muxed_account->type = cryptoKeyType; + + switch (muxed_account->type) { + case KEY_TYPE_ED25519: + PARSER_CHECK(buffer_can_read(buffer, 32)); + muxed_account->ed25519 = buffer->ptr + buffer->offset; + buffer_advance(buffer, 32); + return true; + case KEY_TYPE_MUXED_ED25519: + PARSER_CHECK(buffer_read64(buffer, &muxed_account->med25519.id)); + PARSER_CHECK(buffer_can_read(buffer, 32)); + muxed_account->med25519.ed25519 = buffer->ptr + buffer->offset; + buffer_advance(buffer, 32); + return true; + default: + return false; + } +} + static bool parse_network(buffer_t *buffer, uint8_t *network) { if (!buffer_can_read(buffer, HASH_SIZE)) { return false; @@ -171,26 +193,26 @@ static bool parse_string_ptr(buffer_t *buffer, return true; } -static bool parse_memo(buffer_t *buffer, tx_details_t *txDetails) { +static bool parse_memo(buffer_t *buffer, Memo *memo) { uint32_t type; if (!buffer_read32(buffer, &type)) { return 0; } - txDetails->memo.type = type; - switch (txDetails->memo.type) { + memo->type = type; + switch (memo->type) { case MEMO_NONE: return true; case MEMO_ID: - return buffer_read64(buffer, &txDetails->memo.id); + return buffer_read64(buffer, &memo->id); case MEMO_TEXT: - return parse_string_ptr(buffer, &txDetails->memo.text, NULL, MEMO_TEXT_MAX_SIZE); + return parse_string_ptr(buffer, &memo->text, NULL, MEMO_TEXT_MAX_SIZE); case MEMO_HASH: case MEMO_RETURN: if (buffer->size - buffer->offset < HASH_SIZE) { return false; } - txDetails->memo.hash = buffer->ptr + buffer->offset; + memo->hash = buffer->ptr + buffer->offset; buffer->offset += HASH_SIZE; return true; default: @@ -238,7 +260,7 @@ static bool parse_create_account(buffer_t *buffer, CreateAccountOp *createAccoun } static bool parse_payment(buffer_t *buffer, PaymentOp *payment) { - if (!parse_account_id(buffer, &payment->destination)) { + if (!parse_muxed_account(buffer, &payment->destination)) { return false; } @@ -249,12 +271,12 @@ static bool parse_payment(buffer_t *buffer, PaymentOp *payment) { return buffer_read64(buffer, (uint64_t *) &payment->amount); } -static bool parse_path_payment(buffer_t *buffer, PathPaymentStrictReceiveOp *op) { +static bool parse_path_payment_strict_receive(buffer_t *buffer, PathPaymentStrictReceiveOp *op) { uint32_t pathLen; PARSER_CHECK(parse_asset(buffer, &op->sendAsset)); - PARSER_CHECK(buffer_read64(buffer, &op->sendMax)); - PARSER_CHECK(parse_account_id(buffer, &op->destination)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->sendMax)); + PARSER_CHECK(parse_muxed_account(buffer, &op->destination)); PARSER_CHECK(parse_asset(buffer, &op->destAsset)); PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->destAmount)); @@ -303,7 +325,7 @@ static bool parse_allow_trust(buffer_t *buffer, AllowTrustOp *op) { } static bool parse_account_merge(buffer_t *buffer, MuxedAccount *destination) { - return parse_account_id(buffer, destination); + return parse_muxed_account(buffer, destination); } static bool parse_manage_data(buffer_t *buffer, ManageDataOp *op) { @@ -349,7 +371,7 @@ static bool parse_manage_sell_offer(buffer_t *buffer, ManageSellOfferOp *op) { return true; } -static bool parse_manage_buy_offer_op(buffer_t *buffer, ManageBuyOfferOp *op) { +static bool parse_manage_buy_offer(buffer_t *buffer, ManageBuyOfferOp *op) { PARSER_CHECK(parse_asset(buffer, &op->selling)); PARSER_CHECK(parse_asset(buffer, &op->buying)); PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->buyAmount)); @@ -399,6 +421,7 @@ static bool parse_signer_key(buffer_t *buffer, SignerKey *key) { uint32_t signerType; PARSER_CHECK(buffer_read32(buffer, &signerType)); + key->type = signerType; if (signerType != SIGNER_KEY_TYPE_ED25519 && signerType != SIGNER_KEY_TYPE_PRE_AUTH_TX && signerType != SIGNER_KEY_TYPE_HASH_X) { return false; @@ -497,11 +520,206 @@ static bool parse_bump_sequence(buffer_t *buffer, BumpSequenceOp *op) { return buffer_read64(buffer, (uint64_t *) &op->bumpTo); } +static bool parse_path_payment_strict_send(buffer_t *buffer, PathPaymentStrictSendOp *op) { + uint32_t pathLen; + + PARSER_CHECK(parse_asset(buffer, &op->sendAsset)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->sendAmount)); + PARSER_CHECK(parse_muxed_account(buffer, &op->destination)); + PARSER_CHECK(parse_asset(buffer, &op->destAsset)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->destMin)); + PARSER_CHECK(buffer_read32(buffer, (uint32_t *) &pathLen)); + op->pathLen = pathLen; + if (op->pathLen > 5) { + return false; + } + for (int i = 0; i < op->pathLen; i++) { + PARSER_CHECK(parse_asset(buffer, &op->path[i])); + } + return true; +} + +static bool parse_claimant_predicate(buffer_t *buffer, ClaimPredicate *claimPredicate) { + uint32_t claimPredicateType; + uint32_t predicatesLen; + + PARSER_CHECK(buffer_read32(buffer, &claimPredicateType)); + claimPredicate->type = claimPredicateType; + switch (claimPredicate->type) { + case CLAIM_PREDICATE_UNCONDITIONAL: + return true; + case CLAIM_PREDICATE_AND: + PARSER_CHECK(buffer_read32(buffer, &predicatesLen)); + if (predicatesLen != 2) { + return false; + } + ClaimPredicate andPredicatesLeft, andPredicatesRight; + claimPredicate->andPredicates[0] = &andPredicatesLeft; + claimPredicate->andPredicates[1] = &andPredicatesRight; + PARSER_CHECK(parse_claimant_predicate(buffer, claimPredicate->andPredicates[0])); + PARSER_CHECK(parse_claimant_predicate(buffer, claimPredicate->andPredicates[1])); + return true; + case CLAIM_PREDICATE_OR: + PARSER_CHECK(buffer_read32(buffer, &predicatesLen)); + if (predicatesLen != 2) { + return false; + } + ClaimPredicate orPredicatesLeft, orPredicatesRight; + claimPredicate->orPredicates[0] = &orPredicatesLeft; + claimPredicate->orPredicates[1] = &orPredicatesRight; + PARSER_CHECK(parse_claimant_predicate(buffer, claimPredicate->orPredicates[0])); + PARSER_CHECK(parse_claimant_predicate(buffer, claimPredicate->orPredicates[1])); + return true; + case CLAIM_PREDICATE_NOT: + PARSER_CHECK( + buffer_read_bool(buffer, &claimPredicate->notPredicate.notPredicatePresent)); + if (claimPredicate->notPredicate.notPredicatePresent) { + ClaimPredicate notPredicate; + claimPredicate->notPredicate.notPredicate = ¬Predicate; + PARSER_CHECK( + parse_claimant_predicate(buffer, claimPredicate->notPredicate.notPredicate)); + } + return true; + case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME: + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &claimPredicate->absBefore)); + return true; + case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME: + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &claimPredicate->relBefore)); + return true; + default: + return false; + } +} + +static bool parse_claimant(buffer_t *buffer, Claimant *claimant) { + uint32_t claimantType; + PARSER_CHECK(buffer_read32(buffer, &claimantType)); + claimant->type = claimantType; + + switch (claimant->type) { + case CLAIMANT_TYPE_V0: + PARSER_CHECK(parse_account_id(buffer, &claimant->v0.destination)); + PARSER_CHECK(parse_claimant_predicate(buffer, &claimant->v0.predicate)); + return true; + default: + return false; + } +} + +static bool parse_create_claimable_balance(buffer_t *buffer, CreateClaimableBalanceOp *op) { + uint32_t claimantLen; + PARSER_CHECK(parse_asset(buffer, &op->asset)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->amount)); + PARSER_CHECK(buffer_read32(buffer, (uint32_t *) &claimantLen)); + if (claimantLen > 10) { + return false; + } + op->claimantLen = claimantLen; + for (int i = 0; i < op->claimantLen; i++) { + PARSER_CHECK(parse_claimant(buffer, &op->claimants[i])); + } + return true; +} +static bool parse_claimable_balance_id(buffer_t *buffer, ClaimableBalanceID *claimableBalanceID) { + uint32_t claimableBalanceIDType; + PARSER_CHECK(buffer_read32(buffer, &claimableBalanceIDType)); + claimableBalanceID->type = claimableBalanceIDType; + + switch (claimableBalanceID->type) { + case CLAIMABLE_BALANCE_ID_TYPE_V0: + PARSER_CHECK(buffer_read_bytes(buffer, claimableBalanceID->v0, 32)); + return true; + default: + return false; + } +} + +static bool parse_claim_claimable_balance(buffer_t *buffer, ClaimClaimableBalanceOp *op) { + PARSER_CHECK(parse_claimable_balance_id(buffer, &op->balanceID)); + return true; +} + +static bool parse_begin_sponsoring_future_reserves(buffer_t *buffer, + BeginSponsoringFutureReservesOp *op) { + PARSER_CHECK(parse_account_id(buffer, &op->sponsoredID)); + return true; +} + +static bool parse_ledger_key(buffer_t *buffer, LedgerKey *ledgerKey) { + uint32_t ledgerEntryType; + PARSER_CHECK(buffer_read32(buffer, &ledgerEntryType)); + ledgerKey->type = ledgerEntryType; + switch (ledgerKey->type) { + case ACCOUNT: + PARSER_CHECK(parse_account_id(buffer, &ledgerKey->account.accountID)); + return true; + case TRUSTLINE: + PARSER_CHECK(parse_account_id(buffer, &ledgerKey->trustLine.accountID)); + PARSER_CHECK(parse_asset(buffer, &ledgerKey->trustLine.asset)); + return true; + case OFFER: + PARSER_CHECK(parse_account_id(buffer, &ledgerKey->offer.sellerID)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &ledgerKey->offer.offerID)); + return true; + case DATA: + PARSER_CHECK(parse_account_id(buffer, &ledgerKey->data.accountID)); + PARSER_CHECK(parse_string_ptr(buffer, + (const char **) &ledgerKey->data.dataName, + (size_t *) &ledgerKey->data.dataNameSize, + DATA_VALUE_MAX_SIZE)); + return true; + case CLAIMABLE_BALANCE: + PARSER_CHECK( + parse_claimable_balance_id(buffer, &ledgerKey->claimableBalance.balanceId)); + return true; + default: + return false; + } +} + +static bool parse_revoke_sponsorship(buffer_t *buffer, RevokeSponsorshipOp *op) { + uint32_t revokeSponsorshipType; + PARSER_CHECK(buffer_read32(buffer, &revokeSponsorshipType)) + op->type = revokeSponsorshipType; + + switch (op->type) { + case REVOKE_SPONSORSHIP_LEDGER_ENTRY: + PARSER_CHECK(parse_ledger_key(buffer, &op->ledgerKey)); + return true; + case REVOKE_SPONSORSHIP_SIGNER: + PARSER_CHECK(parse_account_id(buffer, &op->signer.accountID)); + PARSER_CHECK(parse_signer_key(buffer, &op->signer.signerKey)); + return true; + default: + return false; + } +} + +static bool parse_clawback(buffer_t *buffer, ClawbackOp *op) { + PARSER_CHECK(parse_asset(buffer, &op->asset)); + PARSER_CHECK(parse_muxed_account(buffer, &op->from)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &op->amount)); + return true; +} + +static bool parse_clawback_claimable_balance(buffer_t *buffer, ClawbackClaimableBalanceOp *op) { + PARSER_CHECK(parse_claimable_balance_id(buffer, &op->balanceID)); + return true; +} + +static bool parse_set_trust_line_flags(buffer_t *buffer, SetTrustLineFlagsOp *op) { + PARSER_CHECK(parse_account_id(buffer, &op->trustor)); + PARSER_CHECK(parse_asset(buffer, &op->asset)); + PARSER_CHECK(buffer_read32(buffer, &op->clearFlags)); + PARSER_CHECK(buffer_read32(buffer, &op->setFlags)); + return true; +} + static bool parse_operation(buffer_t *buffer, Operation *opDetails) { uint32_t opType; if (!parse_optional_type(buffer, - (xdr_type_parser) parse_account_id, + (xdr_type_parser) parse_muxed_account, &opDetails->sourceAccount, &opDetails->sourceAccountPresent)) { return false; @@ -519,7 +737,8 @@ static bool parse_operation(buffer_t *buffer, Operation *opDetails) { return parse_payment(buffer, &opDetails->payment); } case XDR_OPERATION_TYPE_PATH_PAYMENT_STRICT_RECEIVE: { - return parse_path_payment(buffer, &opDetails->pathPaymentStrictReceiveOp); + return parse_path_payment_strict_receive(buffer, + &opDetails->pathPaymentStrictReceiveOp); } case XDR_OPERATION_TYPE_CREATE_PASSIVE_SELL_OFFER: { return parse_create_passive_sell_offer(buffer, &opDetails->createPassiveSellOfferOp); @@ -549,14 +768,75 @@ static bool parse_operation(buffer_t *buffer, Operation *opDetails) { return parse_bump_sequence(buffer, &opDetails->bumpSequenceOp); } case XDR_OPERATION_TYPE_MANAGE_BUY_OFFER: { - return parse_manage_buy_offer_op(buffer, &opDetails->manageBuyOfferOp); + return parse_manage_buy_offer(buffer, &opDetails->manageBuyOfferOp); + } + case XDR_OPERATION_TYPE_PATH_PAYMENT_STRICT_SEND: { + return parse_path_payment_strict_send(buffer, &opDetails->pathPaymentStrictSendOp); + } + case XDR_OPERATION_TYPE_CREATE_CLAIMABLE_BALANCE: { + return parse_create_claimable_balance(buffer, &opDetails->createClaimableBalanceOp); + } + case XDR_OPERATION_TYPE_CLAIM_CLAIMABLE_BALANCE: { + return parse_claim_claimable_balance(buffer, &opDetails->claimClaimableBalanceOp); + } + case XDR_OPERATION_TYPE_BEGIN_SPONSORING_FUTURE_RESERVES: { + return parse_begin_sponsoring_future_reserves( + buffer, + &opDetails->beginSponsoringFutureReservesOp); + } + case XDR_OPERATION_TYPE_END_SPONSORING_FUTURE_RESERVES: { + return true; + } + case XDR_OPERATION_TYPE_REVOKE_SPONSORSHIP: { + return parse_revoke_sponsorship(buffer, &opDetails->revokeSponsorshipOp); + } + case XDR_OPERATION_TYPE_CLAWBACK: { + return parse_clawback(buffer, &opDetails->clawbackOp); + } + case XDR_OPERATION_TYPE_CLAWBACK_CLAIMABLE_BALANCE: { + return parse_clawback_claimable_balance(buffer, &opDetails->clawbackClaimableBalanceOp); + } + case XDR_OPERATION_TYPE_SET_TRUST_LINE_FLAGS: { + return parse_set_trust_line_flags(buffer, &opDetails->setTrustLineFlagsOp); } default: return false; // Unknown operation } } -#define ENVELOPE_TYPE_TX 2 +static bool parse_tx_details(buffer_t *buffer, TransactionDetails *transaction) { + // account used to run the (inner)transaction + PARSER_CHECK(parse_muxed_account(buffer, &transaction->sourceAccount)); + + // the fee the sourceAccount will pay + PARSER_CHECK(buffer_read32(buffer, &transaction->fee)); + + // sequence number to consume in the account + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &transaction->sequenceNumber)); + + // validity range (inclusive) for the last ledger close time + PARSER_CHECK(parse_optional_type(buffer, + (xdr_type_parser) parse_time_bounds, + &transaction->timeBounds, + &transaction->hasTimeBounds)); + + PARSER_CHECK(parse_memo(buffer, &transaction->memo)); + uint32_t opCount; + PARSER_CHECK(buffer_read32(buffer, &opCount)); + transaction->opCount = opCount; + if (transaction->opCount > MAX_OPS) { + return false; + } + transaction->opIdx = 0; + return true; +} + +static bool parse_fee_bump_tx_details(buffer_t *buffer, + FeeBumpTransactionDetails *feeBumpTransaction) { + PARSER_CHECK(parse_muxed_account(buffer, &feeBumpTransaction->feeSource)); + PARSER_CHECK(buffer_read64(buffer, (uint64_t *) &feeBumpTransaction->fee)); + return true; +} bool parse_tx_xdr(const uint8_t *data, size_t size, tx_context_t *txCtx) { buffer_t buffer = {data, size, 0}; @@ -567,60 +847,33 @@ bool parse_tx_xdr(const uint8_t *data, size_t size, tx_context_t *txCtx) { if (offset == 0) { MEMCLEAR(txCtx->txDetails); - - if (!parse_network(&buffer, &txCtx->network)) { - return false; - } - if (!buffer_read32(&buffer, &envelopeType) || envelopeType != ENVELOPE_TYPE_TX) { - return false; - } - - // account used to run the transaction - if (!parse_account_id(&buffer, &txCtx->txDetails.sourceAccount)) { - return false; - } - - // the fee the sourceAccount will pay - uint32_t fees; - if (!buffer_read32(&buffer, &fees)) { - return false; - } - txCtx->txDetails.fee = fees; - - // sequence number to consume in the account - if (!buffer_read64(&buffer, (uint64_t *) &txCtx->txDetails.sequenceNumber)) { - return false; - } - - // validity range (inclusive) for the last ledger close time - if (!parse_optional_type(&buffer, - (xdr_type_parser) parse_time_bounds, - &txCtx->txDetails.timeBounds, - &txCtx->txDetails.hasTimeBounds)) { - return false; - } - - if (!parse_memo(&buffer, &txCtx->txDetails)) { - return false; - } - - uint32_t opCount; - if (!buffer_read32(&buffer, &opCount)) { - return false; - } - txCtx->opCount = opCount; - if (txCtx->opCount > MAX_OPS) { - return false; + MEMCLEAR(txCtx->feeBumpTxDetails); + PARSER_CHECK(parse_network(&buffer, &txCtx->network)); + PARSER_CHECK(buffer_read32(&buffer, &envelopeType)); + txCtx->envelopeType = envelopeType; + switch (envelopeType) { + case ENVELOPE_TYPE_TX: + PARSER_CHECK(parse_tx_details(&buffer, &txCtx->txDetails)); + break; + case ENVELOPE_TYPE_TX_FEE_BUMP: + PARSER_CHECK(parse_fee_bump_tx_details(&buffer, &txCtx->feeBumpTxDetails)); + uint32_t innerEnvelopeType; + PARSER_CHECK(buffer_read32(&buffer, &innerEnvelopeType)); + if (innerEnvelopeType != ENVELOPE_TYPE_TX) { + return false; + } + PARSER_CHECK(parse_tx_details(&buffer, &txCtx->txDetails)); + break; + default: + return false; } - txCtx->opIdx = 0; } - if (!parse_operation(&buffer, &txCtx->opDetails)) { + if (!parse_operation(&buffer, &txCtx->txDetails.opDetails)) { return false; } offset = buffer.offset; - - txCtx->opIdx += 1; + txCtx->txDetails.opIdx += 1; txCtx->offset = offset; return true; } diff --git a/src/stellar_types.h b/src/stellar_types.h index b5f35458..f4df12d3 100644 --- a/src/stellar_types.h +++ b/src/stellar_types.h @@ -82,6 +82,11 @@ typedef enum { MEMO_RETURN = 4, } MemoType; +typedef enum { + ENVELOPE_TYPE_TX = 2, + ENVELOPE_TYPE_TX_FEE_BUMP = 5, +} EnvelopeType; + #define NETWORK_TYPE_PUBLIC 0 #define NETWORK_TYPE_TEST 1 #define NETWORK_TYPE_UNKNOWN 2 @@ -101,6 +106,14 @@ typedef enum { XDR_OPERATION_TYPE_BUMP_SEQUENCE = 11, XDR_OPERATION_TYPE_MANAGE_BUY_OFFER = 12, XDR_OPERATION_TYPE_PATH_PAYMENT_STRICT_SEND = 13, + XDR_OPERATION_TYPE_CREATE_CLAIMABLE_BALANCE = 14, + XDR_OPERATION_TYPE_CLAIM_CLAIMABLE_BALANCE = 15, + XDR_OPERATION_TYPE_BEGIN_SPONSORING_FUTURE_RESERVES = 16, + XDR_OPERATION_TYPE_END_SPONSORING_FUTURE_RESERVES = 17, + XDR_OPERATION_TYPE_REVOKE_SPONSORSHIP = 18, + XDR_OPERATION_TYPE_CLAWBACK = 19, + XDR_OPERATION_TYPE_CLAWBACK_CLAIMABLE_BALANCE = 20, + XDR_OPERATION_TYPE_SET_TRUST_LINE_FLAGS = 21, } xdr_operation_type_e; #define PUBLIC_KEY_TYPE_ED25519 0 @@ -170,7 +183,42 @@ typedef const uint8_t *AccountID; typedef int64_t SequenceNumber; typedef uint64_t TimePoint; -typedef const uint8_t *MuxedAccount; +typedef enum { + KEY_TYPE_ED25519 = 0, + KEY_TYPE_PRE_AUTH_TX = 1, + KEY_TYPE_HASH_X = 2, + KEY_TYPE_MUXED_ED25519 = 0x100 +} CryptoKeyType; + +typedef enum { + SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519, + SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX, + SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X +} SignerKeyType; + +typedef enum { + // issuer has authorized account to perform transactions with its credit + AUTHORIZED_FLAG = 1, + // issuer has authorized account to maintain and reduce liabilities for its + // credit + AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2, + // issuer has specified that it may clawback its credit, and that claimable + // balances created with its credit may also be clawed back + TRUSTLINE_CLAWBACK_ENABLED_FLAG = 4 +} TrustLineFlags; + +typedef struct { + uint64_t id; + const uint8_t *ed25519; +} MuxedAccountMed25519; + +typedef struct { + CryptoKeyType type; + union { + const uint8_t *ed25519; + MuxedAccountMed25519 med25519; + }; +} MuxedAccount; typedef struct { AssetType type; @@ -195,9 +243,9 @@ typedef struct { } PaymentOp; typedef struct { - Asset sendAsset; // asset we pay with - uint64_t sendMax; // the maximum amount of sendAsset to send (excluding fees). - // The operation will fail if can't be met + Asset sendAsset; // asset we pay with + int64_t sendMax; // the maximum amount of sendAsset to send (excluding fees). + // The operation will fail if can't be met MuxedAccount destination; // recipient of the payment Asset destAsset; // what they end up with @@ -235,6 +283,20 @@ typedef struct { int64_t offerID; } ManageBuyOfferOp; +typedef struct { + Asset sendAsset; // asset we pay with + int64_t sendAmount; // amount of sendAsset to send (excluding fees) + // The operation will fail if can't be met + + MuxedAccount destination; // recipient of the payment + Asset destAsset; // what they end up with + int64_t destMin; // the minimum amount of dest asset to + // be received + // The operation will fail if it can't be met + uint8_t pathLen; + Asset path[5]; // additional hops it must go through to get there +} PathPaymentStrictSendOp; + typedef struct { Asset line; @@ -244,6 +306,7 @@ typedef struct { typedef struct { AccountID trustor; char assetCode[13]; + // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG. uint32_t authorize; } AllowTrustOp; @@ -253,12 +316,6 @@ typedef struct { SequenceNumber bumpTo; } BumpSequenceOp; -typedef enum { - SIGNER_KEY_TYPE_ED25519 = 0, - SIGNER_KEY_TYPE_PRE_AUTH_TX = 1, - SIGNER_KEY_TYPE_HASH_X = 2, -} SignerKeyType; - typedef struct { SignerKeyType type; const uint8_t *data; @@ -295,6 +352,140 @@ typedef struct { const uint8_t *dataValue; } ManageDataOp; +typedef enum { + CLAIM_PREDICATE_UNCONDITIONAL = 0, + CLAIM_PREDICATE_AND = 1, + CLAIM_PREDICATE_OR = 2, + CLAIM_PREDICATE_NOT = 3, + CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME = 4, + CLAIM_PREDICATE_BEFORE_RELATIVE_TIME = 5 +} ClaimPredicateType; + +typedef struct ClaimPredicate { + ClaimPredicateType type; + union { + struct ClaimPredicate *andPredicates[2]; + struct ClaimPredicate *orPredicates[2]; + struct { + bool notPredicatePresent; + struct ClaimPredicate *notPredicate; + } notPredicate; + int64_t absBefore; + int64_t relBefore; + }; +} ClaimPredicate; + +typedef enum { + CLAIMANT_TYPE_V0 = 0, +} ClaimantType; + +typedef struct { + ClaimantType type; + union { + struct { + AccountID destination; // The account that can use this condition + ClaimPredicate predicate; // Claimable if predicate is true + } v0; + }; + +} Claimant; + +typedef struct { + Asset asset; + int64_t amount; + uint8_t claimantLen; + Claimant claimants[10]; +} CreateClaimableBalanceOp; + +typedef enum { + CLAIMABLE_BALANCE_ID_TYPE_V0 = 0, +} ClaimableBalanceIDType; + +typedef struct { + ClaimableBalanceIDType type; + uint8_t v0[32]; +} ClaimableBalanceID; + +typedef struct { + ClaimableBalanceID balanceID; +} ClaimClaimableBalanceOp; + +typedef struct { + AccountID sponsoredID; +} BeginSponsoringFutureReservesOp; + +typedef enum { + ACCOUNT = 0, + TRUSTLINE = 1, + OFFER = 2, + DATA = 3, + CLAIMABLE_BALANCE = 4 +} LedgerEntryType; + +typedef struct { + LedgerEntryType type; + union { + struct { + AccountID accountID; + } account; + + struct { + AccountID accountID; + Asset asset; + } trustLine; + + struct { + AccountID sellerID; + int64_t offerID; + } offer; + + struct { + AccountID accountID; + uint8_t dataNameSize; + const uint8_t *dataName; + } data; + + struct { + ClaimableBalanceID balanceId; + } claimableBalance; + }; + +} LedgerKey; + +typedef enum { + REVOKE_SPONSORSHIP_LEDGER_ENTRY = 0, + REVOKE_SPONSORSHIP_SIGNER = 1 +} RevokeSponsorshipType; + +typedef struct { + RevokeSponsorshipType type; + union { + LedgerKey ledgerKey; + struct { + AccountID accountID; + SignerKey signerKey; + } signer; + }; + +} RevokeSponsorshipOp; + +typedef struct { + Asset asset; + MuxedAccount from; + int64_t amount; +} ClawbackOp; + +typedef struct { + ClaimableBalanceID balanceID; +} ClawbackClaimableBalanceOp; + +typedef struct { + AccountID trustor; + Asset asset; + uint32_t clearFlags; // which flags to clear + uint32_t setFlags; // which flags to set +} SetTrustLineFlagsOp; + typedef struct { bool sourceAccountPresent; MuxedAccount sourceAccount; @@ -312,6 +503,14 @@ typedef struct { ManageDataOp manageDataOp; BumpSequenceOp bumpSequenceOp; ManageBuyOfferOp manageBuyOfferOp; + PathPaymentStrictSendOp pathPaymentStrictSendOp; + CreateClaimableBalanceOp createClaimableBalanceOp; + ClaimClaimableBalanceOp claimClaimableBalanceOp; + BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; + RevokeSponsorshipOp revokeSponsorshipOp; + ClawbackOp clawbackOp; + ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; + SetTrustLineFlagsOp setTrustLineFlagsOp; }; } Operation; @@ -336,7 +535,16 @@ typedef struct { bool hasTimeBounds; TimeBounds timeBounds; // validity range (inclusive) for the last ledger close time Memo memo; -} tx_details_t; + Operation opDetails; + uint8_t opCount; + uint8_t opIdx; +} TransactionDetails; + +typedef struct { + MuxedAccount feeSource; + int64_t fee; + TransactionDetails innerTx; +} FeeBumpTransactionDetails; typedef struct { uint8_t publicKey[32]; @@ -352,12 +560,11 @@ typedef struct { uint32_t rawLength; uint8_t hash[HASH_SIZE]; uint16_t offset; - uint8_t network; - Operation opDetails; - tx_details_t txDetails; - uint8_t opCount; - uint8_t opIdx; uint32_t tx; + uint8_t network; + EnvelopeType envelopeType; + FeeBumpTransactionDetails feeBumpTxDetails; + TransactionDetails txDetails; } tx_context_t; enum request_type_t { CONFIRM_ADDRESS, CONFIRM_TRANSACTION }; @@ -382,7 +589,7 @@ typedef struct { typedef struct { uint64_t amount; uint64_t fees; - char destination[57]; + char destination[57]; // ed25519 address only char memo[20]; } swap_values_t; diff --git a/src/stellar_utils.c b/src/stellar_utils.c index 1a04bcb5..bb97a97d 100644 --- a/src/stellar_utils.c +++ b/src/stellar_utils.c @@ -218,7 +218,7 @@ void print_binary_summary(const uint8_t *in, char *out, uint8_t len) { } } -void print_public_key(MuxedAccount in, char *out, uint8_t numCharsL, uint8_t numCharsR) { +void print_public_key(AccountID in, char *out, uint8_t numCharsL, uint8_t numCharsR) { if (numCharsL > 0) { char buffer[57]; encode_public_key(in, buffer); @@ -228,6 +228,37 @@ void print_public_key(MuxedAccount in, char *out, uint8_t numCharsL, uint8_t num } } +void encode_muxed_account(const MuxedAccount *in, char *out) { + if (in->type == KEY_TYPE_ED25519) { + encode_public_key(in->ed25519, out); + } else { + uint8_t buffer[43]; + buffer[0] = 12 << 3; + int i; + for (i = 0; i < 32; i++) { + buffer[i + 1] = in->med25519.ed25519[i]; + } + for (i = 0; i < 8; i++) { + buffer[33 + i] = in->med25519.id >> 8 * (7 - i); + } + short crc = crc16((char *) buffer, 41); // checksum + buffer[41] = crc; + buffer[42] = crc >> 8; + base32_encode(buffer, 43, out, 69); + out[69] = '\0'; + } +} + +void print_muxed_account(const MuxedAccount *in, char *out, uint8_t numCharsL, uint8_t numCharsR) { + if (numCharsL > 0) { + char buffer[70]; + encode_muxed_account(in, buffer); + print_summary(buffer, out, numCharsL, numCharsR); + } else { + encode_muxed_account(in, out); + } +} + int print_asset_name(const Asset *asset, uint8_t network_id, char *out, size_t out_len) { switch (asset->type) { case ASSET_TYPE_NATIVE: @@ -384,6 +415,18 @@ void print_flags(uint32_t flags, char *out, size_t out_len) { } } +void print_trust_line_flags(uint32_t flags, char *out, size_t out_len) { + if (flags & AUTHORIZED_FLAG) { + print_flag("AUTHORIZED", out, out_len); + } + if (flags & AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG) { + print_flag("AUTHORIZED_TO_MAINTAIN_LIABILITIES", out, out_len); + } + if (flags & TRUSTLINE_CLAWBACK_ENABLED_FLAG) { + print_flag("TRUSTLINE_CLAWBACK_ENABLED", out, out_len); + } +} + void print_native_asset_code(uint8_t network, char *out, size_t out_len) { if (network == NETWORK_TYPE_UNKNOWN) { strlcpy(out, "native", out_len); @@ -391,3 +434,11 @@ void print_native_asset_code(uint8_t network, char *out, size_t out_len) { strlcpy(out, "XLM", out_len); } } + +void print_claimable_balance_id(const ClaimableBalanceID *claimableBalanceID, char *out) { + size_t data_len = 36; + uint8_t data[data_len]; + memcpy(data, &claimableBalanceID->type, 4); + memcpy(data + 4, claimableBalanceID->v0, 32); + print_binary(data, out, data_len); +} \ No newline at end of file diff --git a/src/stellar_ux_nanox.c b/src/stellar_ux_nanox.c index e88f19bc..5f68926e 100644 --- a/src/stellar_ux_nanox.c +++ b/src/stellar_ux_nanox.c @@ -302,12 +302,11 @@ void display_next_state(bool is_upper_border) { set_state_data(false); ux_flow_prev(); } else { - formatter_index += 1; if ((num_data != 0 && current_data_index < num_data - 1) || - formatter_stack[formatter_index] != + formatter_stack[formatter_index + 1] != NULL) { // -> from middle, more screens available + formatter_index += 1; set_state_data(true); - /*dirty hack to have coherent behavior on bnnn_paging when there are multiple * screens*/ G_ux.flow_stack[G_ux.stack_count - 1].prev_index = @@ -327,7 +326,7 @@ void ui_approve_tx_init(void) { ctx.req.tx.offset = 0; formatter_index = 0; MEMCLEAR(formatter_stack); - num_data = ctx.req.tx.opCount; + num_data = ctx.req.tx.txDetails.opCount; current_data_index = 0; current_state = OUT_OF_BORDERS; ux_flow_init(0, ux_confirm_flow, NULL); @@ -336,7 +335,7 @@ void ui_approve_tx_init(void) { void ui_approve_tx_hash_init(void) { formatter_index = 0; MEMCLEAR(formatter_stack); - num_data = ctx.req.tx.opCount; + num_data = ctx.req.tx.txDetails.opCount; current_data_index = 0; current_state = OUT_OF_BORDERS; ux_flow_init(0, ux_confirm_flow, NULL); diff --git a/src/swap/swap_check.c b/src/swap/swap_check.c index c06fc37a..055c6a63 100644 --- a/src/swap/swap_check.c +++ b/src/swap/swap_check.c @@ -8,29 +8,34 @@ void swap_check() { tx_context_t *txCtx = &ctx.req.tx; + // tx type + if (txCtx->envelopeType != ENVELOPE_TYPE_TX) { + io_seproxyhal_touch_tx_cancel(NULL); + } + // A XLM swap consist of only one "send" operation - if (txCtx->opCount > 1) { + if (txCtx->txDetails.opCount > 1) { io_seproxyhal_touch_tx_cancel(NULL); } - // tx type - if (txCtx->opDetails.type != XDR_OPERATION_TYPE_PAYMENT) { + // op type + if (txCtx->txDetails.opDetails.type != XDR_OPERATION_TYPE_PAYMENT) { io_seproxyhal_touch_tx_cancel(NULL); } // amount - if (txCtx->opDetails.payment.asset.type != ASSET_TYPE_NATIVE || - txCtx->opDetails.payment.amount != (int64_t) swap_values.amount) { + if (txCtx->txDetails.opDetails.payment.asset.type != ASSET_TYPE_NATIVE || + txCtx->txDetails.opDetails.payment.amount != (int64_t) swap_values.amount) { io_seproxyhal_touch_tx_cancel(NULL); } // destination addr - print_public_key(txCtx->opDetails.payment.destination, tmp_buf, 0, 0); + print_muxed_account(&txCtx->txDetails.opDetails.payment.destination, tmp_buf, 0, 0); if (strcmp(tmp_buf, swap_values.destination) != 0) { io_seproxyhal_touch_tx_cancel(NULL); } - if (txCtx->opDetails.sourceAccountPresent) { + if (txCtx->txDetails.opDetails.sourceAccountPresent) { io_seproxyhal_touch_tx_cancel(NULL); } diff --git a/tests/automation.json b/tests/automation.json index cdc5bb5f..9d16fd2c 100644 --- a/tests/automation.json +++ b/tests/automation.json @@ -2,7 +2,43 @@ "version": 1, "rules": [ { - "regexp": "Review|Send|Destination|Memo( ID| Text){0,1}|Fee|Network|Time Bounds (To|From)|Tx Source.*|Receive|Via|Remove.*|Create.*|Buy|Price|Sell|(Allow|Change|Revoke) Trust|Run Inflation|Operation.*|Trust Limit|Bump Sequence|Change Offer|Starting Balance|Set (Flags|Data)|Clear Flags|Master Weight|(Low|Medium|High) Threshold|Home Domain|Add Signer|Weight|Data Value|Account ID.*|Op Source.*|Merge Account.*|Inflation Dest.*|Signer Key.*", + "regexp": "Review|Send|Destination|Memo( ID| Text){0,1}|Fee|Network|Time Bounds (To|From)|Tx Source.*|Receive|Via|Remove.*|Buy|Price|Sell|Operation.*|Trust Limit|Bump To|Create Offer|Change Offer|Starting Balance|Set (Flags|Data)|Clear Flags|Master Weight|(Low|Medium|High) Threshold|Home Domain|Add Signer|Weight|Data Value|Account ID.*|Op Source.*|Merge Account.*|Inflation Dest.*|Signer Key.*|Sponsored ID.*|Balance ID.*|Clawback Balance|From.*|WARNING.*|Balance|Data Name.*|Offer ID|Asset|Trustor|Authorize Flag|Sequence Number", + "actions": [ + ["button", 2, true], + ["button", 2, false] + ] + }, + { + "regexp": "(Change|Remove) Trust", + "x": 30, + "y": 3, + "actions": [ + ["button", 2, true], + ["button", 2, false] + ] + }, + { + "text": "Transaction", + "x": 34, + "y": 3, + "actions": [ + ["button", 2, true], + ["button", 2, false] + ] + }, + { + "text": "Fee Bump", + "x": 38, + "y": 3, + "actions": [ + ["button", 2, true], + ["button", 2, false] + ] + }, + { + "text": "InnerTx", + "x": 44, + "y": 3, "actions": [ ["button", 2, true], ["button", 2, false] diff --git a/tests/src/test_printers.c b/tests/src/test_printers.c index 5f313681..8fa4655e 100644 --- a/tests/src/test_printers.c +++ b/tests/src/test_printers.c @@ -113,6 +113,59 @@ void test_base64_encode(void **state) { assert_string_equal(base64, "c3RhcmxpZ2h0"); } +void test_print_muxed_account(void **state) { + // https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0023.md#valid-test-cases + (void) state; + + char printed[89]; + // GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ + const uint8_t ed25519[] = { + 0x3f, 0x0c, 0x34, 0xbf, 0x93, 0xad, 0x0d, 0x99, 0x71, 0xd0, 0x4c, + 0xcc, 0x90, 0xf7, 0x05, 0x51, 0x1c, 0x83, 0x8a, 0xad, 0x97, 0x34, + 0xa4, 0xa2, 0xfb, 0x0d, 0x7a, 0x03, 0xfc, 0x7f, 0xe8, 0x9a, + }; + // Valid non-multiplexed account + MuxedAccount account1 = {.type = KEY_TYPE_ED25519, .ed25519 = ed25519}; + print_muxed_account(&account1, printed, 0, 0); + assert_string_equal(printed, "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ"); + print_muxed_account(&account1, printed, 12, 12); + assert_string_equal(printed, "GA7QYNF7SOWQ..UA74P7UJVSGZ"); + + // Valid multiplexed account + MuxedAccount account2 = {.type = KEY_TYPE_MUXED_ED25519, + .med25519 = {.id = 0, .ed25519 = ed25519}}; + print_muxed_account(&account2, printed, 0, 0); + assert_string_equal(printed, + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ"); + print_muxed_account(&account2, printed, 12, 12); + assert_string_equal(printed, "MA7QYNF7SOWQ..AAAAAAAACJUQ"); + + // Valid multiplexed account in which unsigned id exceeds maximum signed 64-bit integer + MuxedAccount account3 = {.type = KEY_TYPE_MUXED_ED25519, + .med25519 = {.id = 9223372036854775808, .ed25519 = ed25519}}; + print_muxed_account(&account3, printed, 0, 0); + assert_string_equal(printed, + "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK"); + print_muxed_account(&account3, printed, 12, 12); + assert_string_equal(printed, "MA7QYNF7SOWQ..AAAAAAAAAJLK"); +} + +void test_print_claimable_balance_id(void **state) { + (void) state; + + ClaimableBalanceID claimableBalanceID = { + .type = CLAIMABLE_BALANCE_ID_TYPE_V0, + .v0 = {0xc9, 0xc4, 0xa9, 0xe3, 0xa4, 0x68, 0x91, 0xa3, 0x60, 0x15, 0xc3, + 0x17, 0xb3, 0xdf, 0x17, 0xb4, 0x2b, 0xf, 0x2a, 0xd8, 0xa2, 0xee, + 0xa6, 0xc9, 0x34, 0xc9, 0xf7, 0xc8, 0x42, 0x5d, 0xa7, 0xad}}; + + char printed[89]; + print_claimable_balance_id(&claimableBalanceID, printed); + assert_string_equal( + printed, + "0x00000000C9C4A9E3A46891A36015C317B3DF17B42B0F2AD8A2EEA6C934C9F7C8425DA7AD"); +} + int main() { const struct CMUnitTest tests[] = { cmocka_unit_test(test_print_amount), @@ -121,6 +174,8 @@ int main() { cmocka_unit_test(test_print_summary), cmocka_unit_test(test_print_binary), cmocka_unit_test(test_base64_encode), + cmocka_unit_test(test_print_muxed_account), + cmocka_unit_test(test_print_claimable_balance_id), }; return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/tests/src/test_tx.c b/tests/src/test_tx.c index ddc6aa77..ad548c0d 100644 --- a/tests/src/test_tx.c +++ b/tests/src/test_tx.c @@ -13,34 +13,70 @@ stellar_context_t ctx; tx_context_t tx_ctx; static const char *testcases[] = { - "../testcases/txMultiOp.raw", - "../testcases/txSimple.raw", + "../testcases/feeBumpTxSimple.raw", + "../testcases/feeBumpTxSimpleMuxedFeeSource.raw", + "../testcases/txAccountMergeMuxedDestination.raw", + "../testcases/txAccountMerge.raw", + "../testcases/txAllowTrustAuthorized.raw", + "../testcases/txAllowTrustAuthorizedToMaintainLiabilities.raw", + "../testcases/txAllowTrustUnauthorized.raw", + "../testcases/txBeginSponsoringFutureReserves.raw", + "../testcases/txBumpSequence.raw", + "../testcases/txChangeOffer.raw", + "../testcases/txChangeTrust.raw", + "../testcases/txClaimClaimableBalance.raw", + "../testcases/txClawbackClaimableBalance.raw", + "../testcases/txClawbackMuxedFrom.raw", + "../testcases/txClawback.raw", + "../testcases/txCreateAccount.raw", + "../testcases/txCreateClaimableBalancePredicateAnd.raw", + "../testcases/txCreateClaimableBalancePredicateBeforeAbs.raw", + "../testcases/txCreateClaimableBalancePredicateBeforeRel.raw", + "../testcases/txCreateClaimableBalancePredicateMultiClaimant.raw", + "../testcases/txCreateClaimableBalancePredicateNot.raw", + "../testcases/txCreateClaimableBalancePredicateOr.raw", + "../testcases/txCreateClaimableBalancePredicateUnconditional.raw", + "../testcases/txCreateOffer2.raw", + "../testcases/txCreateOffer.raw", + "../testcases/txCustomAsset12.raw", + "../testcases/txCustomAsset4.raw", + "../testcases/txEndSponsoringFutureReserves.raw", + "../testcases/txInflation.raw", + "../testcases/txManageBuyOffer.raw", + "../testcases/txMemoHash.raw", "../testcases/txMemoId.raw", "../testcases/txMemoText.raw", - "../testcases/txMemoHash.raw", - "../testcases/txCustomAsset4.raw", - "../testcases/txCustomAsset12.raw", - "../testcases/txTimeBounds.raw", + "../testcases/txMultiOp.raw", + "../testcases/txMultiOpWithSource.raw", + "../testcases/txOpSourceMuxedDestination.raw", "../testcases/txOpSource.raw", - "../testcases/txCreateAccount.raw", - "../testcases/txAccountMerge.raw", - "../testcases/txPathPayment.raw", - "../testcases/txSetData.raw", + "../testcases/txPassiveOffer.raw", + "../testcases/txPathPaymentStrictReceiveMuxedDestination.raw", + "../testcases/txPathPaymentStrictReceiveEmptyPath.raw", + "../testcases/txPathPaymentStrictReceive.raw", + "../testcases/txPathPaymentStrictSendMuxedDestination.raw", + "../testcases/txPathPaymentStrictSendEmptyPath.raw", + "../testcases/txPathPaymentStrictSend.raw", + "../testcases/txPaymentMuxedDestination.raw", "../testcases/txRemoveData.raw", - "../testcases/txChangeTrust.raw", - "../testcases/txRemoveTrust.raw", - "../testcases/txAllowTrust.raw", - "../testcases/txRevokeTrust.raw", - "../testcases/txCreateOffer.raw", - "../testcases/txCreateOffer2.raw", - "../testcases/txChangeOffer.raw", "../testcases/txRemoveOffer.raw", - "../testcases/txPassiveOffer.raw", + "../testcases/txRemoveTrust.raw", + "../testcases/txRevokeSponsorshipAccount.raw", + "../testcases/txRevokeSponsorshipClaimableBalance.raw", + "../testcases/txRevokeSponsorshipData.raw", + "../testcases/txRevokeSponsorshipOffer.raw", + "../testcases/txRevokeSponsorshipSignerEd25519PublicKey.raw", + "../testcases/txRevokeSponsorshipSignerHashX.raw", + "../testcases/txRevokeSponsorshipSignerPreAuth.raw", + "../testcases/txRevokeSponsorshipTrustLine.raw", "../testcases/txSetAllOptions.raw", + "../testcases/txSetData.raw", + "../testcases/txSetOptionsNoSigner.raw", "../testcases/txSetSomeOptions.raw", - "../testcases/txInflation.raw", - "../testcases/txBumpSequence.raw", - "../testcases/txManageBuyOffer.raw", + "../testcases/txSetTrustLineFlags.raw", + "../testcases/txSimpleMuxedSource.raw", + "../testcases/txSimple.raw", + "../testcases/txTimeBounds.raw", NULL, }; @@ -64,7 +100,7 @@ static void get_result_filename(const char *filename, char *path, size_t size) { static void check_transaction_results(const char *filename) { char path[1024]; char line[4096]; - uint8_t opCount = ctx.req.tx.opCount; + uint8_t opCount = ctx.req.tx.txDetails.opCount; current_data_index = 0; get_result_filename(filename, path, sizeof(path)); diff --git a/tests/testcases/feeBumpTxSimple.raw b/tests/testcases/feeBumpTxSimple.raw new file mode 100644 index 00000000..5c982229 Binary files /dev/null and b/tests/testcases/feeBumpTxSimple.raw differ diff --git a/tests/testcases/feeBumpTxSimple.txt b/tests/testcases/feeBumpTxSimple.txt new file mode 100644 index 00000000..976038ad --- /dev/null +++ b/tests/testcases/feeBumpTxSimple.txt @@ -0,0 +1,13 @@ +Network; Test +Fee Bump; Transaction Details +Fee Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Fee; 0.00004 XLM +InnerTx; Details +Memo Text; fee-bump-tx-simple +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI +Operation Type; Payment +Send; 100 XLM +Destination; GBVKI23OQZCANDUZ2SI7XU7W6ICYKYT74JBXDD2CYRDAFZHZNRPASSQK +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/feeBumpTxSimpleMuxedFeeSource.raw b/tests/testcases/feeBumpTxSimpleMuxedFeeSource.raw new file mode 100644 index 00000000..936d41df Binary files /dev/null and b/tests/testcases/feeBumpTxSimpleMuxedFeeSource.raw differ diff --git a/tests/testcases/feeBumpTxSimpleMuxedFeeSource.txt b/tests/testcases/feeBumpTxSimpleMuxedFeeSource.txt new file mode 100644 index 00000000..fd89b312 --- /dev/null +++ b/tests/testcases/feeBumpTxSimpleMuxedFeeSource.txt @@ -0,0 +1,13 @@ +Network; Test +Fee Bump; Transaction Details +Fee Source; MAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRGAAAAAAAAAPCIDE24 +Fee; 0.00004 XLM +InnerTx; Details +Memo Text; fee-bump-tx-simple-muxed +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI +Operation Type; Payment +Send; 100 XLM +Destination; GBVKI23OQZCANDUZ2SI7XU7W6ICYKYT74JBXDD2CYRDAFZHZNRPASSQK +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txAccountMerge.txt b/tests/testcases/txAccountMerge.txt index e1ff0c9d..7ba30aa5 100644 --- a/tests/testcases/txAccountMerge.txt +++ b/tests/testcases/txAccountMerge.txt @@ -1,6 +1,10 @@ -Merge Account; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH -Destination; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Network; Test +Transaction; Details Memo Text; merge account Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Account Merge +Merge Account; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Destination; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txAccountMergeMuxedDestination.raw b/tests/testcases/txAccountMergeMuxedDestination.raw new file mode 100644 index 00000000..6cee9b85 Binary files /dev/null and b/tests/testcases/txAccountMergeMuxedDestination.raw differ diff --git a/tests/testcases/txAccountMergeMuxedDestination.txt b/tests/testcases/txAccountMergeMuxedDestination.txt new file mode 100644 index 00000000..1786c3eb --- /dev/null +++ b/tests/testcases/txAccountMergeMuxedDestination.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo Text; merge account +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Account Merge +Merge Account; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Destination; MBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KAAAAAAAAAPCIDSOW +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txAllowTrust.txt b/tests/testcases/txAllowTrust.txt deleted file mode 100644 index 4eb8d844..00000000 --- a/tests/testcases/txAllowTrust.txt +++ /dev/null @@ -1,6 +0,0 @@ -Allow Trust; JPY -Account ID; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD -Memo Text; allow trust -Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file diff --git a/tests/testcases/txAllowTrust.raw b/tests/testcases/txAllowTrustAuthorized.raw similarity index 100% rename from tests/testcases/txAllowTrust.raw rename to tests/testcases/txAllowTrustAuthorized.raw diff --git a/tests/testcases/txAllowTrustAuthorized.txt b/tests/testcases/txAllowTrustAuthorized.txt new file mode 100644 index 00000000..ccbcc95e --- /dev/null +++ b/tests/testcases/txAllowTrustAuthorized.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo Text; allow trust +Fee; 0.00001 XLM +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Allow Trust +Trustor; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Asset Code; JPY +Authorize Flag; AUTHORIZED_FLAG +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txAllowTrustAuthorizedToMaintainLiabilities.raw b/tests/testcases/txAllowTrustAuthorizedToMaintainLiabilities.raw new file mode 100644 index 00000000..532b9a31 Binary files /dev/null and b/tests/testcases/txAllowTrustAuthorizedToMaintainLiabilities.raw differ diff --git a/tests/testcases/txAllowTrustAuthorizedToMaintainLiabilities.txt b/tests/testcases/txAllowTrustAuthorizedToMaintainLiabilities.txt new file mode 100644 index 00000000..4d41da2b --- /dev/null +++ b/tests/testcases/txAllowTrustAuthorizedToMaintainLiabilities.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo Text; maintain liabilities +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Allow Trust +Trustor; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Asset Code; JPY +Authorize Flag; AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeTrust.raw b/tests/testcases/txAllowTrustUnauthorized.raw similarity index 100% rename from tests/testcases/txRevokeTrust.raw rename to tests/testcases/txAllowTrustUnauthorized.raw diff --git a/tests/testcases/txAllowTrustUnauthorized.txt b/tests/testcases/txAllowTrustUnauthorized.txt new file mode 100644 index 00000000..54a35b71 --- /dev/null +++ b/tests/testcases/txAllowTrustUnauthorized.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo Text; revoke trust +Fee; 0.00001 XLM +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Allow Trust +Trustor; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Asset Code; JPY +Authorize Flag; UNAUTHORIZED_FLAG +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txBeginSponsoringFutureReserves.raw b/tests/testcases/txBeginSponsoringFutureReserves.raw new file mode 100644 index 00000000..f7939bf7 Binary files /dev/null and b/tests/testcases/txBeginSponsoringFutureReserves.raw differ diff --git a/tests/testcases/txBeginSponsoringFutureReserves.txt b/tests/testcases/txBeginSponsoringFutureReserves.txt new file mode 100644 index 00000000..3232e120 --- /dev/null +++ b/tests/testcases/txBeginSponsoringFutureReserves.txt @@ -0,0 +1,9 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Begin Sponsoring Future Reserves +Sponsored ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txBumpSequence.txt b/tests/testcases/txBumpSequence.txt index df434a9b..9be21ca9 100644 --- a/tests/testcases/txBumpSequence.txt +++ b/tests/testcases/txBumpSequence.txt @@ -1,5 +1,9 @@ -Bump Sequence; 2 +Network; Test +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Test -Tx Source; GCGNXZ5G6FWCNDB7H7G27WYSQDWYW3IBKMZOUXM7K6UPNMDAQDMONKJ2 \ No newline at end of file +Sequence Number; 1234567891 +Tx Source; GCGNXZ5G6FWCNDB7H7G27WYSQDWYW3IBKMZOUXM7K6UPNMDAQDMONKJ2 +Operation Type; Bump Sequence +Bump To; 2 +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txChangeOffer.txt b/tests/testcases/txChangeOffer.txt index f6a902cc..db0ffc10 100644 --- a/tests/testcases/txChangeOffer.txt +++ b/tests/testcases/txChangeOffer.txt @@ -1,8 +1,12 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Manage Sell Offer Change Offer; 6849038322 Buy; SLT@GAD..QN2I Price; 1.6666666 SLT Sell; 200 XLM -Memo; [none] -Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txChangeTrust.txt b/tests/testcases/txChangeTrust.txt index cef5e932..33084e7f 100644 --- a/tests/testcases/txChangeTrust.txt +++ b/tests/testcases/txChangeTrust.txt @@ -1,6 +1,10 @@ -Change Trust; DUPE@GBG..XESH -Trust Limit; [maximum] +Network; Test +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Change Trust +Change Trust; DUPE@GBG..XESH +Trust Limit; [maximum] +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txClaimClaimableBalance.raw b/tests/testcases/txClaimClaimableBalance.raw new file mode 100644 index 00000000..1e751233 Binary files /dev/null and b/tests/testcases/txClaimClaimableBalance.raw differ diff --git a/tests/testcases/txClaimClaimableBalance.txt b/tests/testcases/txClaimClaimableBalance.txt new file mode 100644 index 00000000..eb39ac9e --- /dev/null +++ b/tests/testcases/txClaimClaimableBalance.txt @@ -0,0 +1,9 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Claim Claimable Balance +Balance ID; 0x00000000C9C4A9E3A46891A36015C317B3DF17B42B0F2AD8A2EEA6C934C9F7C8425DA7AD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txClawback.raw b/tests/testcases/txClawback.raw new file mode 100644 index 00000000..cc6d33f0 Binary files /dev/null and b/tests/testcases/txClawback.raw differ diff --git a/tests/testcases/txClawback.txt b/tests/testcases/txClawback.txt new file mode 100644 index 00000000..e9d8ab82 --- /dev/null +++ b/tests/testcases/txClawback.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Clawback +Clawback Balance; 123.456 Hello +From; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txClawbackClaimableBalance.raw b/tests/testcases/txClawbackClaimableBalance.raw new file mode 100644 index 00000000..39b09417 Binary files /dev/null and b/tests/testcases/txClawbackClaimableBalance.raw differ diff --git a/tests/testcases/txClawbackClaimableBalance.txt b/tests/testcases/txClawbackClaimableBalance.txt new file mode 100644 index 00000000..913e5dd4 --- /dev/null +++ b/tests/testcases/txClawbackClaimableBalance.txt @@ -0,0 +1,9 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Clawback Claimable Balance +Balance ID; 0x00000000C9C4A9E3A46891A36015C317B3DF17B42B0F2AD8A2EEA6C934C9F7C8425DA7AD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txClawbackMuxedFrom.raw b/tests/testcases/txClawbackMuxedFrom.raw new file mode 100644 index 00000000..d04f485b Binary files /dev/null and b/tests/testcases/txClawbackMuxedFrom.raw differ diff --git a/tests/testcases/txClawbackMuxedFrom.txt b/tests/testcases/txClawbackMuxedFrom.txt new file mode 100644 index 00000000..ce064643 --- /dev/null +++ b/tests/testcases/txClawbackMuxedFrom.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Clawback +Clawback Balance; 123.456 Hello +From; MDUGCRQWFXZM4MJ2VOEDNG5WZDJQKOP6CNMFHNL4Z4WFT2JMXOGLWAAAAAAAAAAAAFNJI +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateAccount.txt b/tests/testcases/txCreateAccount.txt index 1cf0750c..7d9d3870 100644 --- a/tests/testcases/txCreateAccount.txt +++ b/tests/testcases/txCreateAccount.txt @@ -1,6 +1,10 @@ -Create Account; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD -Starting Balance; 100 XLM +Network; Test +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Create Account +Destination; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Starting Balance; 100 XLM +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateAnd.raw b/tests/testcases/txCreateClaimableBalancePredicateAnd.raw new file mode 100644 index 00000000..237b24b4 Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateAnd.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateAnd.txt b/tests/testcases/txCreateClaimableBalancePredicateAnd.txt new file mode 100644 index 00000000..8e47fa9d --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateAnd.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 100 XLM +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateBeforeAbs.raw b/tests/testcases/txCreateClaimableBalancePredicateBeforeAbs.raw new file mode 100644 index 00000000..aa956f6c Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateBeforeAbs.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateBeforeAbs.txt b/tests/testcases/txCreateClaimableBalancePredicateBeforeAbs.txt new file mode 100644 index 00000000..78db75c8 --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateBeforeAbs.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 1000 XCN +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateBeforeRel.raw b/tests/testcases/txCreateClaimableBalancePredicateBeforeRel.raw new file mode 100644 index 00000000..4c344607 Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateBeforeRel.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateBeforeRel.txt b/tests/testcases/txCreateClaimableBalancePredicateBeforeRel.txt new file mode 100644 index 00000000..8e47fa9d --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateBeforeRel.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 100 XLM +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateMultiClaimant.raw b/tests/testcases/txCreateClaimableBalancePredicateMultiClaimant.raw new file mode 100644 index 00000000..2d13eecc Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateMultiClaimant.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateMultiClaimant.txt b/tests/testcases/txCreateClaimableBalancePredicateMultiClaimant.txt new file mode 100644 index 00000000..8e47fa9d --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateMultiClaimant.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 100 XLM +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateNot.raw b/tests/testcases/txCreateClaimableBalancePredicateNot.raw new file mode 100644 index 00000000..de1f95b9 Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateNot.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateNot.txt b/tests/testcases/txCreateClaimableBalancePredicateNot.txt new file mode 100644 index 00000000..8e47fa9d --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateNot.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 100 XLM +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateOr.raw b/tests/testcases/txCreateClaimableBalancePredicateOr.raw new file mode 100644 index 00000000..3c4a94df Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateOr.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateOr.txt b/tests/testcases/txCreateClaimableBalancePredicateOr.txt new file mode 100644 index 00000000..8e47fa9d --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateOr.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 100 XLM +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateClaimableBalancePredicateUnconditional.raw b/tests/testcases/txCreateClaimableBalancePredicateUnconditional.raw new file mode 100644 index 00000000..67fa5f40 Binary files /dev/null and b/tests/testcases/txCreateClaimableBalancePredicateUnconditional.raw differ diff --git a/tests/testcases/txCreateClaimableBalancePredicateUnconditional.txt b/tests/testcases/txCreateClaimableBalancePredicateUnconditional.txt new file mode 100644 index 00000000..8e47fa9d --- /dev/null +++ b/tests/testcases/txCreateClaimableBalancePredicateUnconditional.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Create Claimable Balance +Balance; 100 XLM +WARNING; Currently does not support displaying claimant details +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateOffer.txt b/tests/testcases/txCreateOffer.txt index df1b78e0..3965617f 100644 --- a/tests/testcases/txCreateOffer.txt +++ b/tests/testcases/txCreateOffer.txt @@ -1,8 +1,12 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Manage Sell Offer Create Offer; Type Active Buy; DUPE@GBG..XESH Price; 0.3333333 DUPE Sell; 300 XLM -Memo; [none] -Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCreateOffer2.txt b/tests/testcases/txCreateOffer2.txt index a3a029ff..fc1655ab 100644 --- a/tests/testcases/txCreateOffer2.txt +++ b/tests/testcases/txCreateOffer2.txt @@ -1,8 +1,12 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 1234567891 +Tx Source; GCGNXZ5G6FWCNDB7H7G27WYSQDWYW3IBKMZOUXM7K6UPNMDAQDMONKJ2 +Operation Type; Manage Sell Offer Create Offer; Type Active Buy; XLM Price; 1.5644199 XLM Sell; 1000 RMT -Memo; [none] -Fee; 0.00001 XLM -Network; Test -Tx Source; GCGNXZ5G6FWCNDB7H7G27WYSQDWYW3IBKMZOUXM7K6UPNMDAQDMONKJ2 \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCustomAsset12.txt b/tests/testcases/txCustomAsset12.txt index e55e5d9d..30a8db38 100644 --- a/tests/testcases/txCustomAsset12.txt +++ b/tests/testcases/txCustomAsset12.txt @@ -1,6 +1,10 @@ -Send; 30 LENONDUPE -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Public -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Sequence Number; 55649191174602781 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 LENONDUPE +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txCustomAsset4.txt b/tests/testcases/txCustomAsset4.txt index 0c8d23bb..777160ee 100644 --- a/tests/testcases/txCustomAsset4.txt +++ b/tests/testcases/txCustomAsset4.txt @@ -1,6 +1,10 @@ -Send; 30 DUPE -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Public -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Sequence Number; 55649191174602781 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 DUPE +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txEndSponsoringFutureReserves.raw b/tests/testcases/txEndSponsoringFutureReserves.raw new file mode 100644 index 00000000..2207e9a5 Binary files /dev/null and b/tests/testcases/txEndSponsoringFutureReserves.raw differ diff --git a/tests/testcases/txEndSponsoringFutureReserves.txt b/tests/testcases/txEndSponsoringFutureReserves.txt new file mode 100644 index 00000000..e8f31ac7 --- /dev/null +++ b/tests/testcases/txEndSponsoringFutureReserves.txt @@ -0,0 +1,8 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; End Sponsoring Future Reserves +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txInflation.txt b/tests/testcases/txInflation.txt index 54dadac0..8aaaf047 100644 --- a/tests/testcases/txInflation.txt +++ b/tests/testcases/txInflation.txt @@ -1,5 +1,8 @@ -Run Inflation; +Network; Test +Transaction; Details Memo Text; maximum memo length 28 chars Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Inflation +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txManageBuyOffer.txt b/tests/testcases/txManageBuyOffer.txt index 7c5fee78..63e71a15 100644 --- a/tests/testcases/txManageBuyOffer.txt +++ b/tests/testcases/txManageBuyOffer.txt @@ -1,10 +1,14 @@ -Change Offer; 987654 -Sell; SLT@GAD..QN2I -Price; 200 SLT -Buy; 300 XLM +Network; Test +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Test +Sequence Number; 123456 Time Bounds From; 0 Time Bounds To; 0 Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Manage Buy Offer +Change Offer; 987654 +Sell; SLT@GAD..QN2I +Price; 200 SLT +Buy; 300 XLM +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txMemoHash.txt b/tests/testcases/txMemoHash.txt index 9a31f6b1..080f6c5e 100644 --- a/tests/testcases/txMemoHash.txt +++ b/tests/testcases/txMemoHash.txt @@ -1,6 +1,10 @@ -Send; 30 XLM -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo Hash; 0x42A084..204D3B Fee; 0.00001 XLM -Network; Public -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Sequence Number; 55649191174602782 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txMemoId.txt b/tests/testcases/txMemoId.txt index 9ef70564..b4f01563 100644 --- a/tests/testcases/txMemoId.txt +++ b/tests/testcases/txMemoId.txt @@ -1,6 +1,10 @@ -Send; 30 XLM -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo ID; 16 Fee; 0.00001 XLM -Network; Public -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Sequence Number; 55649191174602781 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txMemoText.txt b/tests/testcases/txMemoText.txt index 7c7509a1..8a5cd296 100644 --- a/tests/testcases/txMemoText.txt +++ b/tests/testcases/txMemoText.txt @@ -1,6 +1,10 @@ -Send; 30 XLM -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo Text; starlight Fee; 0.00001 XLM -Network; Public -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Sequence Number; 55649191174602781 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txMultiOp.txt b/tests/testcases/txMultiOp.txt index 49ae4bef..813dfd86 100644 --- a/tests/testcases/txMultiOp.txt +++ b/tests/testcases/txMultiOp.txt @@ -1,10 +1,17 @@ +Network; Test +Transaction; Details +Memo Text; multi-op +Fee; 0.00002 XLM +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I Operation 1 of 2; +Operation Type; Account Merge Merge Account; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I Destination; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Op Source; Not set, use Tx Source as Op Source Operation 2 of 2; -Allow Trust; JPY -Account ID; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD -Memo Text; multi-op -Fee; 0.00002 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Operation Type; Allow Trust +Trustor; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Asset Code; JPY +Authorize Flag; AUTHORIZED_FLAG +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txMultiOpWithSource.raw b/tests/testcases/txMultiOpWithSource.raw new file mode 100644 index 00000000..de042c95 Binary files /dev/null and b/tests/testcases/txMultiOpWithSource.raw differ diff --git a/tests/testcases/txMultiOpWithSource.txt b/tests/testcases/txMultiOpWithSource.txt new file mode 100644 index 00000000..3cdb02f2 --- /dev/null +++ b/tests/testcases/txMultiOpWithSource.txt @@ -0,0 +1,17 @@ +Network; Test +Transaction; Details +Memo Text; multi-op-with-source +Fee; 0.00002 XLM +Sequence Number; 2 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation 1 of 2; +Operation Type; Account Merge +Merge Account; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Destination; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Op Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation 2 of 2; +Operation Type; Allow Trust +Trustor; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD +Asset Code; JPY +Authorize Flag; AUTHORIZED_FLAG +Op Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file diff --git a/tests/testcases/txOpSource.txt b/tests/testcases/txOpSource.txt index ad33c087..3922f0e1 100644 --- a/tests/testcases/txOpSource.txt +++ b/tests/testcases/txOpSource.txt @@ -1,7 +1,10 @@ -Send; 30 XLM -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV -Op Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Network; Public +Transaction; Details Memo ID; 16 Fee; 0.00001 XLM -Network; Public -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Sequence Number; 55649191174602781 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file diff --git a/tests/testcases/txOpSourceMuxedDestination.raw b/tests/testcases/txOpSourceMuxedDestination.raw new file mode 100644 index 00000000..d5710d8f Binary files /dev/null and b/tests/testcases/txOpSourceMuxedDestination.raw differ diff --git a/tests/testcases/txOpSourceMuxedDestination.txt b/tests/testcases/txOpSourceMuxedDestination.txt new file mode 100644 index 00000000..d2a45d8c --- /dev/null +++ b/tests/testcases/txOpSourceMuxedDestination.txt @@ -0,0 +1,10 @@ +Network; Public +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; MB4UX7DP3YGPYQGCEHAY6UNUMZCD5DGCPNT6GZCCCXJONSOOH2JROAAAAAAAAAAAMTMJQ \ No newline at end of file diff --git a/tests/testcases/txPassiveOffer.txt b/tests/testcases/txPassiveOffer.txt index a1798be7..893c1c62 100644 --- a/tests/testcases/txPassiveOffer.txt +++ b/tests/testcases/txPassiveOffer.txt @@ -1,8 +1,11 @@ -Create Offer; Type Passive +Network; Test +Transaction; Details +Memo Text; create offer +Fee; 0.00001 XLM +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Create Passive Sell Offer Buy; SLT@GAD..QN2I Price; 0.25 SLT Sell; 1000 XLM -Memo Text; create offer -Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPathPayment.raw b/tests/testcases/txPathPaymentStrictReceive.raw similarity index 100% rename from tests/testcases/txPathPayment.raw rename to tests/testcases/txPathPaymentStrictReceive.raw diff --git a/tests/testcases/txPathPayment.txt b/tests/testcases/txPathPaymentStrictReceive.txt similarity index 61% rename from tests/testcases/txPathPayment.txt rename to tests/testcases/txPathPaymentStrictReceive.txt index 6766a28e..3e8f05d1 100644 --- a/tests/testcases/txPathPayment.txt +++ b/tests/testcases/txPathPaymentStrictReceive.txt @@ -1,8 +1,12 @@ +Network; Test +Transaction; Details +Memo Text; dollar to naira +Fee; 0.00001 XLM +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Path Payment Strict Receive Send Max; 50 USD Destination; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD Receive; 18000 NGN Via; YEN, CAD -Memo Text; dollar to naira -Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPathPaymentStrictReceiveEmptyPath.raw b/tests/testcases/txPathPaymentStrictReceiveEmptyPath.raw new file mode 100644 index 00000000..3aba1eb9 Binary files /dev/null and b/tests/testcases/txPathPaymentStrictReceiveEmptyPath.raw differ diff --git a/tests/testcases/txPathPaymentStrictReceiveEmptyPath.txt b/tests/testcases/txPathPaymentStrictReceiveEmptyPath.txt new file mode 100644 index 00000000..26f1e427 --- /dev/null +++ b/tests/testcases/txPathPaymentStrictReceiveEmptyPath.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo Text; dollar to naira +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Path Payment Strict Receive +Send Max; 50 USD +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Receive; 18000 NGN +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPathPaymentStrictReceiveMuxedDestination.raw b/tests/testcases/txPathPaymentStrictReceiveMuxedDestination.raw new file mode 100644 index 00000000..b9b5dbcd Binary files /dev/null and b/tests/testcases/txPathPaymentStrictReceiveMuxedDestination.raw differ diff --git a/tests/testcases/txPathPaymentStrictReceiveMuxedDestination.txt b/tests/testcases/txPathPaymentStrictReceiveMuxedDestination.txt new file mode 100644 index 00000000..7880e129 --- /dev/null +++ b/tests/testcases/txPathPaymentStrictReceiveMuxedDestination.txt @@ -0,0 +1,12 @@ +Network; Test +Transaction; Details +Memo Text; dollar to naira +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Path Payment Strict Receive +Send Max; 50 USD +Destination; MCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEAAAAAAAAAPCIBQZY +Receive; 18000 NGN +Via; YEN, CAD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPathPaymentStrictSend.raw b/tests/testcases/txPathPaymentStrictSend.raw new file mode 100644 index 00000000..7442ddf1 Binary files /dev/null and b/tests/testcases/txPathPaymentStrictSend.raw differ diff --git a/tests/testcases/txPathPaymentStrictSend.txt b/tests/testcases/txPathPaymentStrictSend.txt new file mode 100644 index 00000000..3c9a21e3 --- /dev/null +++ b/tests/testcases/txPathPaymentStrictSend.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo Text; dollar to naira +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Send; 60 USD +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Receive Min; 20000 NGN +Via; YEN, CAD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPathPaymentStrictSendEmptyPath.raw b/tests/testcases/txPathPaymentStrictSendEmptyPath.raw new file mode 100644 index 00000000..163d12db Binary files /dev/null and b/tests/testcases/txPathPaymentStrictSendEmptyPath.raw differ diff --git a/tests/testcases/txPathPaymentStrictSendEmptyPath.txt b/tests/testcases/txPathPaymentStrictSendEmptyPath.txt new file mode 100644 index 00000000..e98061e7 --- /dev/null +++ b/tests/testcases/txPathPaymentStrictSendEmptyPath.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo Text; dollar to naira +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Send; 60 USD +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Receive Min; 20000 NGN +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPathPaymentStrictSendMuxedDestination.raw b/tests/testcases/txPathPaymentStrictSendMuxedDestination.raw new file mode 100644 index 00000000..babff2ec Binary files /dev/null and b/tests/testcases/txPathPaymentStrictSendMuxedDestination.raw differ diff --git a/tests/testcases/txPathPaymentStrictSendMuxedDestination.txt b/tests/testcases/txPathPaymentStrictSendMuxedDestination.txt new file mode 100644 index 00000000..e2f0aba3 --- /dev/null +++ b/tests/testcases/txPathPaymentStrictSendMuxedDestination.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo Text; dollar to naira +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Send; 60 USD +Destination; MCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEAAAAAAAAAPCIBQZY +Receive Min; 20000 NGN +Via; YEN, CAD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txPaymentMuxedDestination.raw b/tests/testcases/txPaymentMuxedDestination.raw new file mode 100644 index 00000000..09a751d9 Binary files /dev/null and b/tests/testcases/txPaymentMuxedDestination.raw differ diff --git a/tests/testcases/txPaymentMuxedDestination.txt b/tests/testcases/txPaymentMuxedDestination.txt new file mode 100644 index 00000000..1ec9a4fa --- /dev/null +++ b/tests/testcases/txPaymentMuxedDestination.txt @@ -0,0 +1,10 @@ +Network; Public +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 30 DUPE +Destination; MCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEAAAAAAAAAPCIBQZY +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRemoveData.txt b/tests/testcases/txRemoveData.txt index c4256262..9a780414 100644 --- a/tests/testcases/txRemoveData.txt +++ b/tests/testcases/txRemoveData.txt @@ -1,5 +1,9 @@ -Remove Data; managedDataKey +Network; Test +Transaction; Details Memo Text; manage data Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Manage Data +Remove Data; managedDataKey +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRemoveOffer.txt b/tests/testcases/txRemoveOffer.txt index a98a75c3..e3a8b4be 100644 --- a/tests/testcases/txRemoveOffer.txt +++ b/tests/testcases/txRemoveOffer.txt @@ -1,5 +1,9 @@ -Remove Offer; 209583721 +Network; Test +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Manage Sell Offer +Remove Offer; 209583721 +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRemoveTrust.txt b/tests/testcases/txRemoveTrust.txt index 365ba581..28de3683 100644 --- a/tests/testcases/txRemoveTrust.txt +++ b/tests/testcases/txRemoveTrust.txt @@ -1,5 +1,9 @@ -Remove Trust; SLT@GAD..QN2I +Network; Test +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file +Sequence Number; 27888631402201089 +Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I +Operation Type; Change Trust +Remove Trust; SLT@GAD..QN2I +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipAccount.raw b/tests/testcases/txRevokeSponsorshipAccount.raw new file mode 100644 index 00000000..026beae3 Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipAccount.raw differ diff --git a/tests/testcases/txRevokeSponsorshipAccount.txt b/tests/testcases/txRevokeSponsorshipAccount.txt new file mode 100644 index 00000000..f9beec32 --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipAccount.txt @@ -0,0 +1,9 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (ACCOUNT) +Account ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipClaimableBalance.raw b/tests/testcases/txRevokeSponsorshipClaimableBalance.raw new file mode 100644 index 00000000..8fc3209d Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipClaimableBalance.raw differ diff --git a/tests/testcases/txRevokeSponsorshipClaimableBalance.txt b/tests/testcases/txRevokeSponsorshipClaimableBalance.txt new file mode 100644 index 00000000..c12dab8b --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipClaimableBalance.txt @@ -0,0 +1,9 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (CLAIMABLE_BALANCE) +Balance ID; 0x00000000C9C4A9E3A46891A36015C317B3DF17B42B0F2AD8A2EEA6C934C9F7C8425DA7AD +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipData.raw b/tests/testcases/txRevokeSponsorshipData.raw new file mode 100644 index 00000000..5322a708 Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipData.raw differ diff --git a/tests/testcases/txRevokeSponsorshipData.txt b/tests/testcases/txRevokeSponsorshipData.txt new file mode 100644 index 00000000..bbe462d1 --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipData.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (DATA) +Account ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Data Name; Hello, Ledger +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipOffer.raw b/tests/testcases/txRevokeSponsorshipOffer.raw new file mode 100644 index 00000000..de561fc2 Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipOffer.raw differ diff --git a/tests/testcases/txRevokeSponsorshipOffer.txt b/tests/testcases/txRevokeSponsorshipOffer.txt new file mode 100644 index 00000000..c3054971 --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipOffer.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (OFFER) +Seller ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Offer ID; 123456 +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipSignerEd25519PublicKey.raw b/tests/testcases/txRevokeSponsorshipSignerEd25519PublicKey.raw new file mode 100644 index 00000000..1ea3c807 Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipSignerEd25519PublicKey.raw differ diff --git a/tests/testcases/txRevokeSponsorshipSignerEd25519PublicKey.txt b/tests/testcases/txRevokeSponsorshipSignerEd25519PublicKey.txt new file mode 100644 index 00000000..f481ed92 --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipSignerEd25519PublicKey.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (SIGNER_KEY) +Account ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Signer Key Type; Public Key +Signer Key; GBAQXU7XO242YNH4SXMIETGZLPYXNCAP3DYJDLRDV7W25BPZOUD747C7 +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipSignerHashX.raw b/tests/testcases/txRevokeSponsorshipSignerHashX.raw new file mode 100644 index 00000000..fbf49590 Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipSignerHashX.raw differ diff --git a/tests/testcases/txRevokeSponsorshipSignerHashX.txt b/tests/testcases/txRevokeSponsorshipSignerHashX.txt new file mode 100644 index 00000000..2e01327f --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipSignerHashX.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (SIGNER_KEY) +Account ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Signer Key Type; Hash(x) +Signer Key; XDNA2V62PVEF..SFE3SH235FXL +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipSignerPreAuth.raw b/tests/testcases/txRevokeSponsorshipSignerPreAuth.raw new file mode 100644 index 00000000..24617f6e Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipSignerPreAuth.raw differ diff --git a/tests/testcases/txRevokeSponsorshipSignerPreAuth.txt b/tests/testcases/txRevokeSponsorshipSignerPreAuth.txt new file mode 100644 index 00000000..abee96ff --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipSignerPreAuth.txt @@ -0,0 +1,11 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (SIGNER_KEY) +Account ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Signer Key Type; Pre-Auth +Signer Key; TDNA2V62PVEF..SFE3SH234BSS +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeSponsorshipTrustLine.raw b/tests/testcases/txRevokeSponsorshipTrustLine.raw new file mode 100644 index 00000000..28efdada Binary files /dev/null and b/tests/testcases/txRevokeSponsorshipTrustLine.raw differ diff --git a/tests/testcases/txRevokeSponsorshipTrustLine.txt b/tests/testcases/txRevokeSponsorshipTrustLine.txt new file mode 100644 index 00000000..26b0b643 --- /dev/null +++ b/tests/testcases/txRevokeSponsorshipTrustLine.txt @@ -0,0 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Revoke Sponsorship (TRUSTLINE) +Account ID; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Asset; Hello@GDU..XD2K +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txRevokeTrust.txt b/tests/testcases/txRevokeTrust.txt deleted file mode 100644 index 0e76ec6c..00000000 --- a/tests/testcases/txRevokeTrust.txt +++ /dev/null @@ -1,6 +0,0 @@ -Revoke Trust; JPY -Account ID; GBMHY2EIEGFHW6G4OIC6QA7I7IUPUDD33PGCJLVC57THODEUQY62KNHD -Memo Text; revoke trust -Fee; 0.00001 XLM -Network; Test -Tx Source; GADFVW3UXVKDOU626XUPYDJU2BFCGFJHQ6SREYOZ6IJV4XSHOALEQN2I \ No newline at end of file diff --git a/tests/testcases/txSetAllOptions.txt b/tests/testcases/txSetAllOptions.txt index 61262f87..12db3c4e 100644 --- a/tests/testcases/txSetAllOptions.txt +++ b/tests/testcases/txSetAllOptions.txt @@ -1,3 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Set Options Inflation Dest; GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7 Clear Flags; Auth revocable, Auth immutable Set Flags; Auth required @@ -9,7 +16,4 @@ Home Domain; www.example.com Add Signer; Type Public Key Signer Key; GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7 Weight; 1 -Memo; [none] -Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txSetData.txt b/tests/testcases/txSetData.txt index d8a6f522..d6b01491 100644 --- a/tests/testcases/txSetData.txt +++ b/tests/testcases/txSetData.txt @@ -1,6 +1,10 @@ -Set Data; name -Data Value; dmFsdWU= +Network; Test +Transaction; Details Memo Text; manage data Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Manage Data +Set Data; name +Data Value; dmFsdWU= +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txSetOptionsNoSigner.raw b/tests/testcases/txSetOptionsNoSigner.raw new file mode 100644 index 00000000..d53d933f Binary files /dev/null and b/tests/testcases/txSetOptionsNoSigner.raw differ diff --git a/tests/testcases/txSetOptionsNoSigner.txt b/tests/testcases/txSetOptionsNoSigner.txt new file mode 100644 index 00000000..cf85a653 --- /dev/null +++ b/tests/testcases/txSetOptionsNoSigner.txt @@ -0,0 +1,9 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Set Options +Home Domain; example.com +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txSetSomeOptions.txt b/tests/testcases/txSetSomeOptions.txt index cd2d7a1a..23b37621 100644 --- a/tests/testcases/txSetSomeOptions.txt +++ b/tests/testcases/txSetSomeOptions.txt @@ -1,3 +1,10 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 21728338334711809 +Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH +Operation Type; Set Options Inflation Dest; GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7 Set Flags; Auth required Low Threshold; 1 @@ -6,7 +13,4 @@ Home Domain; www.example.com Add Signer; Type Public Key Signer Key; GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7 Weight; 1 -Memo; [none] -Fee; 0.00001 XLM -Network; Test -Tx Source; GBGBTCCP7WG2E5XFYLQFJP2DYOQZPCCDCHK62K6TZD4BHMNYI5WSXESH \ No newline at end of file +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txSetTrustLineFlags.raw b/tests/testcases/txSetTrustLineFlags.raw new file mode 100644 index 00000000..105395f2 Binary files /dev/null and b/tests/testcases/txSetTrustLineFlags.raw differ diff --git a/tests/testcases/txSetTrustLineFlags.txt b/tests/testcases/txSetTrustLineFlags.txt new file mode 100644 index 00000000..b0feb2ae --- /dev/null +++ b/tests/testcases/txSetTrustLineFlags.txt @@ -0,0 +1,12 @@ +Network; Test +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; GD2J5ZZTU4XM5LEX3XPKSCJIQ3UMXU7NLZMHOZEMELXKI4XLPHHKGVM5 +Operation Type; Set Trust Line Flags +Trustor; GB3UITECWPDI3LZL5G4WPLKWLDPPGTHBDPDZTYTPVNWSPASDSVJQ7USV +Asset; Hello@GDU..XD2K +Clear Flags; [none] +Set Flags; AUTHORIZED, AUTHORIZED_TO_MAINTAIN_LIABILITIES, TRUSTLINE_CLAWBACK_ENABLED +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txSimple.txt b/tests/testcases/txSimple.txt index 318bdd96..e24f0633 100644 --- a/tests/testcases/txSimple.txt +++ b/tests/testcases/txSimple.txt @@ -1,6 +1,10 @@ -Send; 1 XLM -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo; [none] Fee; 0.00001 XLM -Network; Public +Sequence Number; 55649191174602777 Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 1 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txSimpleMuxedSource.raw b/tests/testcases/txSimpleMuxedSource.raw new file mode 100644 index 00000000..0bfbfb45 Binary files /dev/null and b/tests/testcases/txSimpleMuxedSource.raw differ diff --git a/tests/testcases/txSimpleMuxedSource.txt b/tests/testcases/txSimpleMuxedSource.txt new file mode 100644 index 00000000..02485bd5 --- /dev/null +++ b/tests/testcases/txSimpleMuxedSource.txt @@ -0,0 +1,10 @@ +Network; Public +Transaction; Details +Memo; [none] +Fee; 0.00001 XLM +Sequence Number; 2 +Tx Source; MAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRGAAAAAAAAAPCIDE24 +Operation Type; Payment +Send; 1 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file diff --git a/tests/testcases/txTimeBounds.txt b/tests/testcases/txTimeBounds.txt index 0234f516..f92fb683 100644 --- a/tests/testcases/txTimeBounds.txt +++ b/tests/testcases/txTimeBounds.txt @@ -1,8 +1,12 @@ -Send; 1 XLM -Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Network; Public +Transaction; Details Memo ID; 33 Fee; 0.00001 XLM -Network; Public +Sequence Number; 55649191174602781 Time Bounds From; 50 Time Bounds To; 100 -Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM \ No newline at end of file +Tx Source; GAQNVGMLOXSCWH37QXIHLQJH6WZENXYSVWLPAEF4673W64VRNZLRHMFM +Operation Type; Payment +Send; 1 XLM +Destination; GCKUD4BHIYSAYHU7HBB5FDSW6CSYH3GSOUBPWD2KE7KNBERP4BSKEJDV +Op Source; Not set, use Tx Source as Op Source \ No newline at end of file