Search in sources :

Example 1 with MutexConstraintScrypt

use of com.radixdlt.application.unique.scrypt.MutexConstraintScrypt in project radixdlt by radixdlt.

the class NextEpochV2Test method setup.

@Before
public void setup() {
    var cmAtomOS = new CMAtomOS();
    cmAtomOS.load(new SystemConstraintScrypt());
    scrypts.forEach(cmAtomOS::load);
    // For v1 start
    cmAtomOS.load(new MutexConstraintScrypt());
    var cm = new ConstraintMachine(cmAtomOS.getProcedures(), cmAtomOS.buildSubstateDeserialization(), cmAtomOS.buildVirtualSubstateDeserialization());
    this.parser = new REParser(cmAtomOS.buildSubstateDeserialization());
    var serialization = cmAtomOS.buildSubstateSerialization();
    this.store = new InMemoryEngineStore<>();
    this.sut = new RadixEngine<>(parser, serialization, constructors, cm, store);
}
Also used : SystemConstraintScrypt(com.radixdlt.application.system.scrypt.SystemConstraintScrypt) ConstraintMachine(com.radixdlt.constraintmachine.ConstraintMachine) MutexConstraintScrypt(com.radixdlt.application.unique.scrypt.MutexConstraintScrypt) REParser(com.radixdlt.engine.parser.REParser) CMAtomOS(com.radixdlt.atomos.CMAtomOS) Before(org.junit.Before)

Example 2 with MutexConstraintScrypt

use of com.radixdlt.application.unique.scrypt.MutexConstraintScrypt in project radixdlt by radixdlt.

the class UniqueTest method setup.

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

Aggregations

SystemConstraintScrypt (com.radixdlt.application.system.scrypt.SystemConstraintScrypt)2 MutexConstraintScrypt (com.radixdlt.application.unique.scrypt.MutexConstraintScrypt)2 CMAtomOS (com.radixdlt.atomos.CMAtomOS)2 ConstraintMachine (com.radixdlt.constraintmachine.ConstraintMachine)2 REParser (com.radixdlt.engine.parser.REParser)2 Before (org.junit.Before)2 CreateSystemConstructorV2 (com.radixdlt.application.system.construction.CreateSystemConstructorV2)1