Skip to content

Commit

Permalink
Merge pull request #98 from bobbrodie/6.0.x
Browse files Browse the repository at this point in the history
Fix satoshisPerByte and remove '.value' from examples
  • Loading branch information
bobbrodie authored May 6, 2024
2 parents d2b084a + 49197b3 commit 2ebabb3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
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

0 comments on commit 2ebabb3

Please sign in to comment.