Search in sources :

Example 1 with EpochData

use of com.radixdlt.application.system.state.EpochData in project radixdlt by radixdlt.

the class CreateSystemConstructorV2 method construct.

@Override
public void construct(CreateSystem action, TxBuilder builder) throws TxBuilderException {
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.UNCLAIMED_READDR.id() }));
    builder.end();
    builder.toLowLevelBuilder().syscall(Syscall.READDR_CLAIM, "sys".getBytes(StandardCharsets.UTF_8));
    builder.downREAddr(REAddr.ofSystem());
    builder.up(new EpochData(0));
    builder.up(new RoundData(0, action.timestamp()));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_META_DATA.id() }));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_STAKE_DATA.id() }));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_ALLOW_DELEGATION_FLAG.id() }));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_REGISTERED_FLAG_COPY.id() }));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_RAKE_COPY.id() }));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_OWNER_COPY.id() }));
    builder.up(new VirtualParent(new byte[] { SubstateTypeId.VALIDATOR_SYSTEM_META_DATA.id() }));
    builder.end();
}
Also used : EpochData(com.radixdlt.application.system.state.EpochData) RoundData(com.radixdlt.application.system.state.RoundData) VirtualParent(com.radixdlt.application.system.state.VirtualParent)

Aggregations

EpochData (com.radixdlt.application.system.state.EpochData)1 RoundData (com.radixdlt.application.system.state.RoundData)1 VirtualParent (com.radixdlt.application.system.state.VirtualParent)1