Skip to content

Commit 20e8ed7

Browse files
authored
Merge pull request #345 from cffls/update_node_8.x.x
Update node version for integration tests
2 parents 486d97f + 386191a commit 20e8ed7

File tree

12 files changed

+119
-21
lines changed

12 files changed

+119
-21
lines changed

integration-test/configs/local-alonzo/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"ByronGenesisFile": "byron-genesis.json",
33
"ShelleyGenesisFile": "shelley-genesis.json",
44
"AlonzoGenesisFile": "alonzo-genesis.json",
5+
"ConwayGenesisFile": "conway-genesis.json",
56
"SocketPath": "db/node.socket",
67
"MaxConcurrencyBulkSync": 1,
78
"MaxConcurrencyDeadline": 2,
@@ -99,6 +100,6 @@
99100
"TestAllegraHardForkAtEpoch": 0,
100101
"TestMaryHardForkAtEpoch": 0,
101102
"TestAlonzoHardForkAtEpoch": 0,
102-
"TestEnableDevelopmentHardForkEras": true,
103-
"TestEnableDevelopmentNetworkProtocols": true
103+
"EnableDevelopmentHardForkEras": true,
104+
"ExperimentalProtocolsEnabled": true
104105
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"poolVotingThresholds": {
3+
"committeeNormal": 0.51,
4+
"committeeNoConfidence": 0.51,
5+
"hardForkInitiation": 0.51,
6+
"motionNoConfidence": 0.51,
7+
"ppSecurityGroup": 0.51
8+
},
9+
"dRepVotingThresholds": {
10+
"motionNoConfidence": 0.51,
11+
"committeeNormal": 0.51,
12+
"committeeNoConfidence": 0.51,
13+
"updateToConstitution": 0.51,
14+
"hardForkInitiation": 0.51,
15+
"ppNetworkGroup": 0.51,
16+
"ppEconomicGroup": 0.51,
17+
"ppTechnicalGroup": 0.51,
18+
"ppGovGroup": 0.51,
19+
"treasuryWithdrawal": 0.51
20+
},
21+
"committeeMinSize": 0,
22+
"committeeMaxTermLength": 200,
23+
"govActionLifetime": 10,
24+
"govActionDeposit": 1000000000,
25+
"dRepDeposit": 2000000,
26+
"dRepActivity": 20,
27+
"constitution": {
28+
"anchor": {
29+
"url": "",
30+
"dataHash": "0000000000000000000000000000000000000000000000000000000000000000"
31+
}
32+
},
33+
"committee": {
34+
"members": {
35+
36+
},
37+
"quorum": 0
38+
}
39+
}

integration-test/configs/local-vasil/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"ByronGenesisFile": "byron-genesis.json",
33
"ShelleyGenesisFile": "shelley-genesis.json",
44
"AlonzoGenesisFile": "alonzo-genesis.json",
5+
"ConwayGenesisFile": "conway-genesis.json",
56
"SocketPath": "db/node.socket",
67
"MaxConcurrencyBulkSync": 1,
78
"MaxConcurrencyDeadline": 2,
@@ -100,6 +101,6 @@
100101
"TestMaryHardForkAtEpoch": 0,
101102
"TestAlonzoHardForkAtEpoch": 0,
102103
"TestBabbageHardForkAtEpoch": 10,
103-
"TestEnableDevelopmentHardForkEras": true,
104-
"TestEnableDevelopmentNetworkProtocols": true
104+
"EnableDevelopmentHardForkEras": true,
105+
"ExperimentalProtocolsEnabled": true
105106
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"poolVotingThresholds": {
3+
"committeeNormal": 0.51,
4+
"committeeNoConfidence": 0.51,
5+
"hardForkInitiation": 0.51,
6+
"motionNoConfidence": 0.51,
7+
"ppSecurityGroup": 0.51
8+
},
9+
"dRepVotingThresholds": {
10+
"motionNoConfidence": 0.51,
11+
"committeeNormal": 0.51,
12+
"committeeNoConfidence": 0.51,
13+
"updateToConstitution": 0.51,
14+
"hardForkInitiation": 0.51,
15+
"ppNetworkGroup": 0.51,
16+
"ppEconomicGroup": 0.51,
17+
"ppTechnicalGroup": 0.51,
18+
"ppGovGroup": 0.51,
19+
"treasuryWithdrawal": 0.51
20+
},
21+
"committeeMinSize": 0,
22+
"committeeMaxTermLength": 200,
23+
"govActionLifetime": 10,
24+
"govActionDeposit": 1000000000,
25+
"dRepDeposit": 2000000,
26+
"dRepActivity": 20,
27+
"constitution": {
28+
"anchor": {
29+
"url": "",
30+
"dataHash": "0000000000000000000000000000000000000000000000000000000000000000"
31+
}
32+
},
33+
"committee": {
34+
"members": {
35+
36+
},
37+
"quorum": 0
38+
}
39+
}

integration-test/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ networks:
99
services:
1010

1111
cardano-node:
12-
image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-1.35.7}
12+
image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2}
1313
entrypoint: bash
1414
environment:
1515
NETWORK: "${NETWORK:-local-alonzo}"
@@ -34,7 +34,7 @@ services:
3434
max-file: "10"
3535

3636
cardano-pool:
37-
image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-1.35.7}
37+
image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2}
3838
entrypoint: bash
3939
environment:
4040
NETWORK: "${NETWORK:-local-alonzo}"
@@ -54,7 +54,7 @@ services:
5454
max-file: "10"
5555

5656
ogmios:
57-
image: cardanosolutions/ogmios:v5.6.0-mainnet
57+
image: cardanosolutions/ogmios:v6.2.0
5858
environment:
5959
NETWORK: "${NETWORK:-local-alonzo}"
6060

integration-test/run_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -o pipefail
66
ROOT=$(pwd)
77

88
poetry install
9+
poetry run pip install ogmios
910

1011
##########
1112
# Alonzo #

integration-test/test/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""An example that demonstrates low-level construction of a transaction."""
22

33
import os
4-
import time
54

5+
import ogmios as python_ogmios
66
from retry import retry
77

88
from pycardano import *
@@ -19,11 +19,12 @@ class TestBase:
1919
# Define chain context
2020
NETWORK = Network.TESTNET
2121

22-
OGMIOS_WS = "ws://localhost:1337"
23-
22+
# TODO: Bring back kupo test
2423
KUPO_URL = "http://localhost:1442"
2524

26-
chain_context = OgmiosChainContext(OGMIOS_WS, Network.TESTNET, kupo_url=KUPO_URL)
25+
chain_context = python_ogmios.OgmiosChainContext(
26+
host="localhost", port=1337, network=Network.TESTNET
27+
)
2728

2829
check_chain_context(chain_context)
2930

integration-test/test/test_cardano_cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
from pathlib import Path
33

4+
from retry import retry
5+
46
from pycardano import (
57
CardanoCliChainContext,
68
CardanoCliNetwork,
@@ -10,6 +12,8 @@
1012
)
1113
from pycardano.backend.cardano_cli import DockerConfig
1214

15+
from .base import TEST_RETRIES
16+
1317

1418
class TestCardanoCli:
1519
network_env = os.getenv("NETWORK", "local-alonzo")
@@ -30,16 +34,16 @@ class TestCardanoCli:
3034
network_magic_number=int(network_magic),
3135
)
3236

37+
@retry(tries=TEST_RETRIES, backoff=1.5, delay=6, jitter=(0, 4))
3338
def test_protocol_param(self):
3439
protocol_param = self.chain_context.protocol_param
3540

3641
assert protocol_param is not None
3742
assert isinstance(protocol_param, ProtocolParameters)
3843

3944
cost_models = protocol_param.cost_models
40-
for _, cost_model in cost_models.items():
41-
assert "addInteger-cpu-arguments-intercept" in cost_model
42-
assert "addInteger-cpu-arguments-slope" in cost_model
45+
for cost_model in cost_models.items():
46+
assert len(cost_model) > 0
4347

4448
def test_genesis_param(self):
4549
genesis_param = self.chain_context.genesis_param

integration-test/test/test_ogmios.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ def test_protocol_param_cost_models(self):
1010

1111
cost_models = protocol_param.cost_models
1212
for _, cost_model in cost_models.items():
13-
assert "addInteger-cpu-arguments-intercept" in cost_model
14-
assert "addInteger-cpu-arguments-slope" in cost_model
13+
assert len(cost_model) > 0

integration-test/test/test_plutus.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ def test_get_plutus_script(self):
370370
assert utxos[0].output.script == forty_two_script
371371

372372

373-
class TestPlutusOgmiosOnly(TestPlutus):
374-
@classmethod
375-
def setup_class(cls):
376-
cls.chain_context._kupo_url = None
373+
# class TestPlutusOgmiosOnly(TestPlutus):
374+
# @classmethod
375+
# def setup_class(cls):
376+
# cls.chain_context._kupo_url = None
377377

378378

379379
def evaluate_tx(tx: Transaction) -> Dict[str, ExecutionUnits]:

pycardano/backend/cardano_cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ def _parse_cost_models(cli_result: JsonDict) -> Dict[str, Dict[str, int]]:
258258
elif "PlutusV2" in cli_cost_models:
259259
cost_models["PlutusV2"] = cli_cost_models["PlutusV2"].copy()
260260

261+
# After 8.x.x, cardano-cli returns cost models as a list
262+
for m in cost_models:
263+
if isinstance(cost_models[m], list):
264+
cost_models[m] = {i: v for i, v in enumerate(cost_models[m])}
265+
261266
return cost_models
262267

263268
def _is_chain_tip_updated(self):

test/pycardano/backend/test_cardano_cli.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,15 @@ def test_protocol_param(self, chain_context):
598598
coins_per_utxo_byte=QUERY_PROTOCOL_PARAMETERS_RESULT.get(
599599
"coinsPerUtxoByte", 0
600600
),
601-
cost_models=QUERY_PROTOCOL_PARAMETERS_RESULT["costModels"],
601+
cost_models={
602+
l: {
603+
i: v
604+
for i, v in enumerate(
605+
QUERY_PROTOCOL_PARAMETERS_RESULT["costModels"][l]
606+
)
607+
}
608+
for l in QUERY_PROTOCOL_PARAMETERS_RESULT["costModels"]
609+
},
602610
)
603611
== chain_context.protocol_param
604612
)

0 commit comments

Comments
 (0)