Search in sources :

Example 11 with MintTokenConstructor

use of com.radixdlt.application.tokens.construction.MintTokenConstructor in project radixdlt by radixdlt.

the class DelegationFlagTest method setup.

@Before
public void setup() throws Exception {
    var cmAtomOS = new CMAtomOS();
    cmAtomOS.load(new SystemConstraintScrypt());
    scrypts.forEach(cmAtomOS::load);
    var cm = new ConstraintMachine(cmAtomOS.getProcedures(), cmAtomOS.buildSubstateDeserialization(), cmAtomOS.buildVirtualSubstateDeserialization());
    var parser = new REParser(cmAtomOS.buildSubstateDeserialization());
    var serialization = cmAtomOS.buildSubstateSerialization();
    this.store = new InMemoryEngineStore<>();
    this.engine = new RadixEngine<>(parser, serialization, REConstructor.newBuilder().put(StakeTokens.class, stakeTokensConstructor).put(CreateMutableToken.class, new CreateMutableTokenConstructor(SystemConstraintScrypt.MAX_SYMBOL_LENGTH)).put(MintToken.class, new MintTokenConstructor()).put(UpdateAllowDelegationFlag.class, new UpdateAllowDelegationFlagConstructor()).put(UpdateValidatorOwner.class, new UpdateValidatorOwnerConstructor()).put(CreateSystem.class, new CreateSystemConstructorV2()).build(), cm, store);
    var txn = this.engine.construct(new CreateSystem(0)).buildWithoutSignature();
    this.engine.execute(List.of(txn), null, PermissionLevel.SYSTEM);
}
Also used : SystemConstraintScrypt(com.radixdlt.application.system.scrypt.SystemConstraintScrypt) UpdateValidatorOwnerConstructor(com.radixdlt.application.validators.construction.UpdateValidatorOwnerConstructor) REParser(com.radixdlt.engine.parser.REParser) MintTokenConstructor(com.radixdlt.application.tokens.construction.MintTokenConstructor) CMAtomOS(com.radixdlt.atomos.CMAtomOS) ConstraintMachine(com.radixdlt.constraintmachine.ConstraintMachine) CreateMutableTokenConstructor(com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor) CreateSystemConstructorV2(com.radixdlt.application.system.construction.CreateSystemConstructorV2) UpdateAllowDelegationFlagConstructor(com.radixdlt.application.validators.construction.UpdateAllowDelegationFlagConstructor) Before(org.junit.Before)

Example 12 with MintTokenConstructor

use of com.radixdlt.application.tokens.construction.MintTokenConstructor in project radixdlt by radixdlt.

the class MintTokensTest method setup.

@Before
public void setup() throws Exception {
    var cmAtomOS = new CMAtomOS();
    cmAtomOS.load(new SystemConstraintScrypt());
    cmAtomOS.load(scrypt);
    var cm = new ConstraintMachine(cmAtomOS.getProcedures(), cmAtomOS.buildSubstateDeserialization(), cmAtomOS.buildVirtualSubstateDeserialization());
    var parser = new REParser(cmAtomOS.buildSubstateDeserialization());
    var serialization = cmAtomOS.buildSubstateSerialization();
    this.store = new InMemoryEngineStore<>();
    this.engine = new RadixEngine<>(parser, serialization, REConstructor.newBuilder().put(CreateSystem.class, new CreateSystemConstructorV2()).put(TransferToken.class, transferTokensConstructor).put(CreateMutableToken.class, new CreateMutableTokenConstructor(SystemConstraintScrypt.MAX_SYMBOL_LENGTH)).put(MintToken.class, new MintTokenConstructor()).build(), cm, store);
    var genesis = this.engine.construct(new CreateSystem(0)).buildWithoutSignature();
    this.engine.execute(List.of(genesis), null, PermissionLevel.SYSTEM);
}
Also used : SystemConstraintScrypt(com.radixdlt.application.system.scrypt.SystemConstraintScrypt) REParser(com.radixdlt.engine.parser.REParser) MintTokenConstructor(com.radixdlt.application.tokens.construction.MintTokenConstructor) CMAtomOS(com.radixdlt.atomos.CMAtomOS) ConstraintMachine(com.radixdlt.constraintmachine.ConstraintMachine) CreateMutableTokenConstructor(com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor) CreateSystemConstructorV2(com.radixdlt.application.system.construction.CreateSystemConstructorV2) Before(org.junit.Before)

Aggregations

CreateSystemConstructorV2 (com.radixdlt.application.system.construction.CreateSystemConstructorV2)12 CreateMutableTokenConstructor (com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor)12 MintTokenConstructor (com.radixdlt.application.tokens.construction.MintTokenConstructor)12 CMAtomOS (com.radixdlt.atomos.CMAtomOS)12 ConstraintMachine (com.radixdlt.constraintmachine.ConstraintMachine)12 REParser (com.radixdlt.engine.parser.REParser)12 Before (org.junit.Before)12 SystemConstraintScrypt (com.radixdlt.application.system.scrypt.SystemConstraintScrypt)11 TokensConstraintScryptV3 (com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3)6 TransferTokensConstructorV2 (com.radixdlt.application.tokens.construction.TransferTokensConstructorV2)4 FeeReservePutConstructor (com.radixdlt.application.system.construction.FeeReservePutConstructor)3 FeeReserveCompleteConstructor (com.radixdlt.application.system.construction.FeeReserveCompleteConstructor)2 NextEpochConstructorV3 (com.radixdlt.application.system.construction.NextEpochConstructorV3)2 RegisterValidatorConstructor (com.radixdlt.application.validators.construction.RegisterValidatorConstructor)2 FeeReserveTakeConstructor (com.radixdlt.application.system.construction.FeeReserveTakeConstructor)1 NextViewConstructorV3 (com.radixdlt.application.system.construction.NextViewConstructorV3)1 BurnTokenConstructor (com.radixdlt.application.tokens.construction.BurnTokenConstructor)1 StakeTokensConstructorV3 (com.radixdlt.application.tokens.construction.StakeTokensConstructorV3)1 StakingConstraintScryptV4 (com.radixdlt.application.tokens.scrypt.StakingConstraintScryptV4)1 TokenResource (com.radixdlt.application.tokens.state.TokenResource)1