Skip to content

Commit

Permalink
Fixes for local network and docker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vsuharnikov committed Nov 21, 2024
1 parent 473930a commit 8abbb9b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions consensus-client-it/src/test/scala/units/Accounts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
9 changes: 9 additions & 0 deletions local-network/configs/wavesnode/genesis-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions local-network/configs/wavesnode/waves.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ 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
initial = 600000000
min-increment = 50000000
voting-interval = 1
}

include "genesis.conf"
include "/etc/it/genesis.conf"
}
Expand Down
6 changes: 6 additions & 0 deletions local-network/deploy/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion local-network/deploy/local/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8abbb9b

Please sign in to comment.