Skip to content

Commit 6aba16f

Browse files
semsorockclaude
andcommitted
Fix failing integration tests for governance and transaction endpoints
Update governance test fixtures to use valid mainnet DRep and proposal IDs that exist on-chain. Fix transaction submit test to check status_code instead of removed error string. Update evaluate_cbor test to match new Ogmios response structure with ScriptFailures nesting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 18dddb1 commit 6aba16f

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

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)