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 satoshisPerByte and remove '.value' from examples #98

Merged
merged 2 commits into from
May 6, 2024
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
6 changes: 3 additions & 3 deletions examples/Pos/bill_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class BillRequests:
def create_bill(self) -> None:
client = Client.create_pos_client('somePosToken', Environment.TEST.value)
client = Client.create_pos_client('somePosToken', Environment.TEST)

bill = Bill()
bill.name = 'someName'
Expand All @@ -18,11 +18,11 @@ def create_bill(self) -> None:
result = client.create_bill(bill, Facade.POS, False)

def get_bill(self) -> None:
client = Client.create_pos_client('somePosToken', Environment.TEST.value)
client = Client.create_pos_client('somePosToken', Environment.TEST)

result = client.get_bill('someBillId', Facade.POS, False)

def deliver_bill_via_email(self) -> None:
client = Client.create_pos_client('somePosToken', Environment.TEST.value)
client = Client.create_pos_client('somePosToken', Environment.TEST)

result = client.deliver_bill('someBillId', 'token')
4 changes: 2 additions & 2 deletions examples/Pos/invoice_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def create_invoice(self) -> None:

invoice.buyer = buyer

client = Client.create_pos_client('somePosToken', Environment.TEST.value)
client = Client.create_pos_client('somePosToken', Environment.TEST)

result = client.create_invoice(invoice, Facade.POS, False)

def get_invoice(self) -> None:
client = Client.create_pos_client('somePosToken', Environment.TEST.value)
client = Client.create_pos_client('somePosToken', Environment.TEST)

invoice_by_id = client.get_invoice('someInvoiceId', Facade.POS, False)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "bitpay"
version = "6.0.1"
version = "6.0.2"
authors = [
{ name="Antonio Buedo", email="sales-engineering@bitpay.com" },
]
Expand Down
2 changes: 1 addition & 1 deletion src/bitpay/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class Config(Enum):
TEST_URL = "https://test.bitpay.com/"
PROD_URL = "https://bitpay.com/"
BITPAY_API_VERSION = "2.0.0"
BITPAY_PLUGIN_INFO = "BitPay_Python_Client_v6.0.1"
BITPAY_PLUGIN_INFO = "BitPay_Python_Client_v6.0.2"
BITPAY_API_FRAME = "std"
BITPAY_API_FRAME_VERSION = "1.0.0"
2 changes: 1 addition & 1 deletion src/bitpay/models/invoice/miner_fees_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class MinerFeesItem(BitPayModel):
see this support article for more information
"""

satoshis_per_byte: Union[int, None] = None
satoshis_per_byte: Union[float, None] = None
total_fee: Union[int, None] = None
fiat_amount: Union[float, None] = None
4 changes: 2 additions & 2 deletions tests/unit/models/invoice/test_miner_fees_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
@pytest.mark.unit
def test_constructor():
amount = 12.34
satoshis = 12345
satoshis = 12.345
total_fee = 4354
miner_fees_item = MinerFeesItem(fiat_amount=amount, satoshis_per_byte=satoshis, total_fee=total_fee)

assert amount == miner_fees_item.fiat_amount
assert 12345 == miner_fees_item.satoshis_per_byte
assert 12.345 == miner_fees_item.satoshis_per_byte
assert total_fee == miner_fees_item.total_fee
Loading