Skip to content

Commit 1632633

Browse files
authored
Merge pull request #2 from semsorock/claude/happy-panini
Fix failing integration tests for governance and transaction endpoints
2 parents ed5624c + 94ca20a commit 1632633

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Install dependencies
175175

176176
```
177177
pip install -r requirements.txt
178-
pip install -r rest-requirements.txt
178+
pip install -r test-requirements.txt
179179
```
180180

181181
Install package

tests/test_cardano_governance.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
from blockfrost import BlockFrostApi, ApiError
33
from blockfrost.utils import convert_json_to_object
44

5-
drep_id = 'drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn'
6-
tx_hash = 'f5ca33220afcc0340d1fa3cba9b0e1f3c3c6e1eab57d688ed700ae56bbce9170'
5+
drep_id = 'drep1yfaaaaa270yjt6tu5skndugekprf5ykv5jshanl0c6gqx5qpstskf'
6+
tx_hash = '51f495aa23f4b3b3aa90afde4a0e67823bb7ac4ac65f5ffbb138373b863f2f74'
77
cert_index = 0
8+
# proposal with metadata (treasury_withdrawals type)
9+
metadata_tx_hash = '60ed6ab43c840ff888a8af30a1ed27b41e9f4a91a89822b2b63d1bfc52aeec45'
810

911

1012
def test_governance_dreps(requests_mock):
@@ -265,4 +267,4 @@ def test_governance_proposal_metadata(requests_mock):
265267
def test_integration_governance_proposal_metadata():
266268
if os.getenv('BLOCKFROST_PROJECT_ID_MAINNET'):
267269
api = BlockFrostApi(project_id=os.getenv('BLOCKFROST_PROJECT_ID_MAINNET'))
268-
api.governance_proposal_metadata(tx_hash=tx_hash, cert_index=cert_index)
270+
api.governance_proposal_metadata(tx_hash=metadata_tx_hash, cert_index=cert_index)

tests/test_cardano_transactions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def test_integration_transaction_submit_cbor():
412412

413413
with pytest.raises(ApiError) as exc_info:
414414
api.transaction_submit_cbor(tx_cbor=tx_cbor)
415-
assert exc_info.value.message.find("transaction submit error") > -1
415+
assert exc_info.value.status_code == 400
416416
# Make sure that the tx cbor was correctly passed
417417
assert exc_info.value.message.find(
418418
"54bcb22a31a100080ffbf7edbac538b1517d99fa85ec77bfac089ab8249e2708") > -1
@@ -443,7 +443,8 @@ def test_integration_transaction_evaluate_cbor():
443443
# }
444444

445445
# Response with an ogmios error about missing input
446-
assert result.result.EvaluationFailure.CannotCreateEvaluationContext.reason.find(
446+
script_failure = getattr(result.result.EvaluationFailure.ScriptFailures, 'spend:0')
447+
assert script_failure.CannotCreateEvaluationContext.reason.find(
447448
'Unknown transaction input') > -1
448449

449450

0 commit comments

Comments
 (0)