Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix manage offer where buying asset is native #5

Merged
merged 3 commits into from Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ APP_LOAD_PARAMS=--appFlags 0x40 --path "44'/148'" --curve ed25519 $(COMMON_LOAD_

APPVERSION_M=3
APPVERSION_N=0
APPVERSION_P=0
APPVERSION_P=1
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)

#prepare hsm generation
Expand Down
201 changes: 0 additions & 201 deletions doc/stellarapp.md

This file was deleted.

6 changes: 5 additions & 1 deletion src/stellar_format_blue.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ void format_manage_offer_price(tx_context_t *txCtx) {

void format_manage_offer_buy(tx_context_t *txCtx) {
strcpy(detailCaption, "Buy");
print_asset_t(&txCtx->opDetails.op.manageOffer.buying, detailValue);
if (txCtx->opDetails.op.manageOffer.buying.type == ASSET_TYPE_NATIVE) {
print_native_asset_code(txCtx->txDetails.network, detailValue);
} else {
print_asset_t(&txCtx->opDetails.op.manageOffer.buying, detailValue);
}
formatter = &format_manage_offer_price;
}

Expand Down
6 changes: 5 additions & 1 deletion src/stellar_format_nanos.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,11 @@ void format_manage_offer_price(tx_context_t *txCtx) {

void format_manage_offer_buy(tx_context_t *txCtx) {
strcpy(detailCaption, "Buy");
print_asset_t(&txCtx->opDetails.op.manageOffer.buying, detailValue);
if (txCtx->opDetails.op.manageOffer.buying.type == ASSET_TYPE_NATIVE) {
print_native_asset_code(txCtx->txDetails.network, detailValue);
} else {
print_asset_t(&txCtx->opDetails.op.manageOffer.buying, detailValue);
}
formatter = &format_manage_offer_price;
}

Expand Down
1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gcc test/parsertest.c src/stellar_utils.c src/stellar_parser.c src/stellar_forma
./obj/parsertest test/txRevokeTrust.hex

./obj/parsertest test/txCreateOffer.hex
./obj/parsertest test/txCreateOffer2.hex
./obj/parsertest test/txChangeOffer.hex
./obj/parsertest test/txRemoveOffer.hex
./obj/parsertest test/txPassiveOffer.hex
Expand Down
1 change: 1 addition & 0 deletions test/txCreateOffer2.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cee0302d59844d32bdca915c8203dd44b33fbb7edc19051ea37abedf28ecd47200000002000000008cdbe7a6f16c268c3f3fcdafdb1280ed8b6d015332ea5d9f57a8f6b06080d8e60000006400000000499602d3000000000000000000000001000000000000000300000001524d540000000000c8675de23dec5c635be0f58cc9e44eb81bf344925b53e3a7fced684b116f72ac0000000000000002540be40000eeb62700989680000000000000000000000000