diff --git a/consensus-client-it/src/test/scala/units/Accounts.scala b/consensus-client-it/src/test/scala/units/Accounts.scala index 227e60d0..8abdc383 100644 --- a/consensus-client-it/src/test/scala/units/Accounts.scala +++ b/consensus-client-it/src/test/scala/units/Accounts.scala @@ -9,6 +9,7 @@ import units.eth.EthAddress import java.nio.charset.StandardCharsets trait Accounts { + val chainRegistryAccount: KeyPair = mkKeyPair("devnet registry", 0) val chainContractAccount: KeyPair = mkKeyPair("devnet cc", 0) val miner11Account = mkKeyPair("devnet-1", 0) diff --git a/consensus-client-it/src/test/scala/units/BaseDockerTestSuite.scala b/consensus-client-it/src/test/scala/units/BaseDockerTestSuite.scala index 2cce8fb5..cc857c46 100644 --- a/consensus-client-it/src/test/scala/units/BaseDockerTestSuite.scala +++ b/consensus-client-it/src/test/scala/units/BaseDockerTestSuite.scala @@ -78,6 +78,9 @@ trait BaseDockerTestSuite } protected def setupChain(): Unit = { + log.info("Approve chain on registry") + waves1.api.broadcast(ChainRegistry.approve()) + log.info("Set script") waves1.api.broadcastAndWait(ChainContract.setScript()) diff --git a/local-network/configs/wavesnode/genesis-template.conf b/local-network/configs/wavesnode/genesis-template.conf index 99724a5c..91aaa3ce 100644 --- a/local-network/configs/wavesnode/genesis-template.conf +++ b/local-network/configs/wavesnode/genesis-template.conf @@ -62,6 +62,15 @@ genesis-generator { # Address: 3FVp6fUSmVehs7Q3uJBXe5kWtpz57f7azzA { seed-text = "devnet dao", nonce = 0, amount = 100000000 } + # Chain registry + # Seed text: devnet registry + # Nonce: 0 + # Seed: 3oujRTe9jVvnMHcKe9vGG + # Private key: 3kqzGQiNy5qTKEGDzCxh6Kk8LLXW5Lh22pLmZvFNqDm1 + # Public key: HRHrDistEQkJJ7dBxBBzxfSsbN8oEF8xt3FeUHLNBYfX + # Address: 3FibjK5ZAXFfJf9J3gDsheia88Vz2itLPu1 + { seed-text = "devnet registry", nonce = 0, amount = 100000000 } + # Chain contract # Seed text: devnet cc # Nonce: 0 diff --git a/local-network/configs/wavesnode/waves.conf b/local-network/configs/wavesnode/waves.conf index 4acda82f..663b5e1e 100644 --- a/local-network/configs/wavesnode/waves.conf +++ b/local-network/configs/wavesnode/waves.conf @@ -41,7 +41,9 @@ waves { dao-address = "3FVGizGxjdi8m4e8WKjbwtzg4rdiiUGkLCu" xtn-buyback-address = "3FZQMZsyypqDUk2r5katP1AUChe7Uzc9dC4" xtn-buyback-reward-period = 20 + units-registry-address = "3FibjK5ZAXFfJf9J3gDsheia88Vz2itLPu1" } + rewards { term = 100000 term-after-capped-reward-feature = 5 @@ -49,6 +51,7 @@ waves { min-increment = 50000000 voting-interval = 1 } + include "genesis.conf" include "/etc/it/genesis.conf" } diff --git a/local-network/deploy/deploy.py b/local-network/deploy/deploy.py index 90eef034..49a94de8 100644 --- a/local-network/deploy/deploy.py +++ b/local-network/deploy/deploy.py @@ -23,8 +23,14 @@ log.info(f"Wait for {min_peers} peers, now: {r}") sleep(2) +log.info(f"Registry address: {network.cl_registry.oracleAddress}") log.info(f"Chain contract address: {network.cl_chain_contract.oracleAddress}") +log.info("Approve chain contract on registry") +network.cl_registry.storeData( + f"unit_{network.cl_chain_contract.oracleAddress}_approved", "boolean", True +) + script_info = network.cl_chain_contract.oracleAcc.scriptInfo() if script_info["script"] is None: log.info("Set chain contract script") diff --git a/local-network/deploy/local/network.py b/local-network/deploy/local/network.py index ac808767..68723222 100644 --- a/local-network/deploy/local/network.py +++ b/local-network/deploy/local/network.py @@ -28,9 +28,13 @@ class Miner: class ExtendedNetwork(Network): @cached_property - def cl_dao(self) -> ChainContract: + def cl_dao(self) -> pw.Address: return pw.Address(seed="devnet dao", nonce=0) + @cached_property + def cl_registry(self) -> pw.Oracle: + return pw.Oracle(seed="devnet registry") + @cached_property def cl_chain_contract(self) -> ChainContract: return ChainContract(seed="devnet cc", nonce=0)