Create a genesis for the rootnet nodes. On the rootnet the validator power comes out of thin air, ie. the balances don't have to cover it. On subnets this will be different, the collateral has to be funded.
(
&mut self,
m: &mut R,
subnet_name: &SubnetName,
validators: CollateralMap,
balances: BalanceMap,
ipc_contracts_owner: &ResourceId,
)
| 227 | /// ie. the balances don't have to cover it. On subnets this |
| 228 | /// will be different, the collateral has to be funded. |
| 229 | fn create_root_genesis( |
| 230 | &mut self, |
| 231 | m: &mut R, |
| 232 | subnet_name: &SubnetName, |
| 233 | validators: CollateralMap, |
| 234 | balances: BalanceMap, |
| 235 | ipc_contracts_owner: &ResourceId, |
| 236 | ) -> anyhow::Result<()> { |
| 237 | let validators = self |
| 238 | .account_map(validators) |
| 239 | .context("invalid root collaterals")?; |
| 240 | |
| 241 | let balances = self |
| 242 | .account_map(balances) |
| 243 | .context("invalid root balances")?; |
| 244 | |
| 245 | let ipc_contracts_owner = self |
| 246 | .account(ipc_contracts_owner) |
| 247 | .context("invalid ipc contract owner")?; |
| 248 | |
| 249 | // Remember the genesis so we can potentially create more nodes later. |
| 250 | let genesis = |
| 251 | m.create_root_genesis(subnet_name, validators, balances, ipc_contracts_owner)?; |
| 252 | |
| 253 | self.genesis.insert(subnet_name.clone(), genesis); |
| 254 | |
| 255 | Ok(()) |
| 256 | } |
| 257 | |
| 258 | /// Configure and start the nodes of a subnet. |
| 259 | /// |
no test coverage detected