Search in sources :

Example 1 with FeeReserveTakeConstructor

use of com.radixdlt.application.system.construction.FeeReserveTakeConstructor in project radixdlt by radixdlt.

the class FixedFeeTest method setup.

@Before
public void setup() throws Exception {
    var cmAtomOS = new CMAtomOS();
    cmAtomOS.load(new TokensConstraintScryptV3(Set.of(), Pattern.compile("[a-z0-9]+")));
    cmAtomOS.load(new SystemConstraintScrypt());
    var cm = new ConstraintMachine(cmAtomOS.getProcedures(), cmAtomOS.buildSubstateDeserialization(), cmAtomOS.buildVirtualSubstateDeserialization(), FixedFeeMeter.create(UInt256.FIVE));
    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, new TransferTokensConstructorV2()).put(CreateMutableToken.class, new CreateMutableTokenConstructor(SystemConstraintScrypt.MAX_SYMBOL_LENGTH)).put(MintToken.class, new MintTokenConstructor()).put(FeeReservePut.class, new FeeReservePutConstructor()).put(FeeReserveTake.class, new FeeReserveTakeConstructor()).build(), cm, store);
    var txn = this.engine.construct(TxnConstructionRequest.create().action(new CreateSystem(0)).action(new CreateMutableToken(REAddr.ofNativeToken(), "xrd", "xrd", "", "", "", null)).action(new MintToken(REAddr.ofNativeToken(), accountAddr, UInt256.TEN))).buildWithoutSignature();
    this.engine.execute(List.of(txn), 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) FeeReservePutConstructor(com.radixdlt.application.system.construction.FeeReservePutConstructor) CMAtomOS(com.radixdlt.atomos.CMAtomOS) TokensConstraintScryptV3(com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3) FeeReserveTakeConstructor(com.radixdlt.application.system.construction.FeeReserveTakeConstructor) ConstraintMachine(com.radixdlt.constraintmachine.ConstraintMachine) CreateMutableTokenConstructor(com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor) CreateSystemConstructorV2(com.radixdlt.application.system.construction.CreateSystemConstructorV2) TransferTokensConstructorV2(com.radixdlt.application.tokens.construction.TransferTokensConstructorV2) Before(org.junit.Before)

Aggregations

CreateSystemConstructorV2 (com.radixdlt.application.system.construction.CreateSystemConstructorV2)1 FeeReservePutConstructor (com.radixdlt.application.system.construction.FeeReservePutConstructor)1 FeeReserveTakeConstructor (com.radixdlt.application.system.construction.FeeReserveTakeConstructor)1 SystemConstraintScrypt (com.radixdlt.application.system.scrypt.SystemConstraintScrypt)1 CreateMutableTokenConstructor (com.radixdlt.application.tokens.construction.CreateMutableTokenConstructor)1 MintTokenConstructor (com.radixdlt.application.tokens.construction.MintTokenConstructor)1 TransferTokensConstructorV2 (com.radixdlt.application.tokens.construction.TransferTokensConstructorV2)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 Before (org.junit.Before)1