Skip to content
Open
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
6 changes: 6 additions & 0 deletions tests/utils/test_001_detect_address.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import pytest


EXPECTED_RESPONSE_BOUNCEABLE = 'EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N'
EXPECTED_RESPONSE_NONBOUNCEABLE = 'UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI'

TEST_ADDRESSES = [
("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N",
200),
Expand All @@ -24,4 +27,7 @@ def test_detect_address(api_method_call,
return
data = response.json()
assert data['ok'] == True
result = data['result']
assert result['bounceable']['b64'] == EXPECTED_RESPONSE_BOUNCEABLE
assert result['non_bounceable']['b64'] == EXPECTED_RESPONSE_NONBOUNCEABLE
return
4 changes: 2 additions & 2 deletions ton-http-api/src/converters/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ inline schemas::v2::DetectAddress Convert(const core::DetectAddressResult& value
result.raw_form = value.to_raw_form(true);

block::StdAddress b_addr(value.address);
b_addr.bounceable = false;
b_addr.bounceable = true;
result.bounceable.b64 = b_addr.rserialize(false);
result.bounceable.b64url = b_addr.rserialize(true);

b_addr.bounceable = true;
b_addr.bounceable = false;
result.non_bounceable.b64 = b_addr.rserialize(false);
result.non_bounceable.b64url = b_addr.rserialize(true);
if (value.given_type == "raw_form") {
Expand Down