Search in sources :

Example 1 with InMemoryEngineStore

use of com.radixdlt.store.InMemoryEngineStore in project radixdlt by radixdlt.

the class BurnTokensV3Test method setup.

@Before
public void setup() throws Exception {
    var cmAtomOS = new CMAtomOS();
    cmAtomOS.load(new SystemConstraintScrypt());
    cmAtomOS.load(new TokensConstraintScryptV3(Set.of(), Pattern.compile("[a-z0-9]+")));
    var cm = new ConstraintMachine(cmAtomOS.getProcedures(), cmAtomOS.buildSubstateDeserialization(), cmAtomOS.buildVirtualSubstateDeserialization());
    var parser = new REParser(cmAtomOS.buildSubstateDeserialization());
    var serialization = cmAtomOS.buildSubstateSerialization();
    EngineStore<Void> store = new InMemoryEngineStore<>();
    this.engine = new RadixEngine<>(parser, serialization, REConstructor.newBuilder().put(CreateSystem.class, new CreateSystemConstructorV2()).put(CreateMutableToken.class, new CreateMutableTokenConstructor(SystemConstraintScrypt.MAX_SYMBOL_LENGTH)).put(MintToken.class, new MintTokenConstructor()).put(BurnToken.class, new BurnTokenConstructor()).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) InMemoryEngineStore(com.radixdlt.store.InMemoryEngineStore) MintTokenConstructor(com.radixdlt.application.tokens.construction.MintTokenConstructor) CMAtomOS(com.radixdlt.atomos.CMAtomOS) TokensConstraintScryptV3(com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3) BurnTokenConstructor(com.radixdlt.application.tokens.construction.BurnTokenConstructor) 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)1 SystemConstraintScrypt (com.radixdlt.application.system.scrypt.SystemConstraintScrypt)1 BurnTokenConstructor (com.radixdlt.application.tokens.construction.BurnTokenConstructor)1 CreateMutableTokenConstructor (com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor)1 MintTokenConstructor (com.radixdlt.application.tokens.construction.MintTokenConstructor)1 TokensConstraintScryptV3 (com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3)1 CMAtomOS (com.radixdlt.atomos.CMAtomOS)1 ConstraintMachine (com.radixdlt.constraintmachine.ConstraintMachine)1 REParser (com.radixdlt.engine.parser.REParser)1 InMemoryEngineStore (com.radixdlt.store.InMemoryEngineStore)1 Before (org.junit.Before)1