use of com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor 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);
}
use of com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor 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);
}
Aggregations