use of com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3 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);
}
use of com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3 in project radixdlt by radixdlt.
the class DelegationFlagTest method parameters.
@Parameterized.Parameters
public static Collection<Object[]> parameters() {
var startAmounts = List.of(10);
var stakeAmounts = List.of(10);
var scrypts = List.of(Pair.of(List.of(new RoundUpdateConstraintScrypt(10), new EpochUpdateConstraintScrypt(10, UInt256.NINE, 1, 1, 10), new TokensConstraintScryptV3(Set.of(), Pattern.compile("[a-z0-9]+")), new StakingConstraintScryptV4(Amount.ofTokens(10).toSubunits()), new ValidatorConstraintScryptV2(), new ValidatorUpdateOwnerConstraintScrypt()), new StakeTokensConstructorV3(Amount.ofTokens(10).toSubunits())));
var parameters = new ArrayList<Object[]>();
for (var scrypt : scrypts) {
for (var startAmount : startAmounts) {
for (var stakeAmount : stakeAmounts) {
var param = new Object[] { startAmount, stakeAmount, scrypt.getFirst(), scrypt.getSecond() };
parameters.add(param);
}
}
}
return parameters;
}
use of com.radixdlt.application.tokens.scrypt.TokensConstraintScryptV3 in project radixdlt by radixdlt.
the class StakeTokensTest method parameters.
@Parameterized.Parameters
public static Collection<Object[]> parameters() {
var startAmounts = List.of(10);
var stakeAmounts = List.of(10, 6);
var scrypts = List.of(Pair.of(List.of(new SystemConstraintScrypt(), new TokensConstraintScryptV3(Set.of(), Pattern.compile("[a-z0-9]+")), new StakingConstraintScryptV4(Amount.ofTokens(10).toSubunits()), new ValidatorConstraintScryptV2(), new ValidatorUpdateOwnerConstraintScrypt()), new StakeTokensConstructorV3(Amount.ofTokens(10).toSubunits())));
var parameters = new ArrayList<Object[]>();
for (var scrypt : scrypts) {
for (var startAmount : startAmounts) {
for (var stakeAmount : stakeAmounts) {
var param = new Object[] { startAmount, stakeAmount, scrypt.getFirst(), scrypt.getSecond() };
parameters.add(param);
}
}
}
return parameters;
}
Aggregations