use of com.radixdlt.api.core.model.OperationTxBuilder in project radixdlt by radixdlt.
the class ConstructionSubmitTest method buildSignedTxn.
private Txn buildSignedTxn(REAddr from, REAddr to) throws Exception {
var toTransfer = UInt256.ONE;
var entityOperationGroups = List.of(List.of(EntityOperation.from(new AccountVaultEntity(from), ResourceOperation.withdraw(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer)), EntityOperation.from(new AccountVaultEntity(to), ResourceOperation.deposit(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer))));
var operationTxBuilder = new OperationTxBuilder(null, entityOperationGroups, currentForkView);
var builder = radixEngine.constructWithFees(operationTxBuilder, false, from, NotEnoughNativeTokensForFeesException::new);
return builder.signAndBuild(hashSigner::sign);
}
use of com.radixdlt.api.core.model.OperationTxBuilder in project radixdlt by radixdlt.
the class MempoolHandlerTest method buildSignedTxn.
private Txn buildSignedTxn(REAddr from, REAddr to) throws Exception {
final UInt256 toTransfer = getLiquidAmount().toSubunits().subtract(Amount.ofTokens(1).toSubunits());
var entityOperationGroups = List.of(List.of(EntityOperation.from(new AccountVaultEntity(from), ResourceOperation.withdraw(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer)), EntityOperation.from(new AccountVaultEntity(to), ResourceOperation.deposit(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer))));
var operationTxBuilder = new OperationTxBuilder(null, entityOperationGroups, currentForkView);
var builder = radixEngine.constructWithFees(operationTxBuilder, false, from, NotEnoughNativeTokensForFeesException::new);
return builder.signAndBuild(hashSigner::sign);
}
use of com.radixdlt.api.core.model.OperationTxBuilder in project radixdlt by radixdlt.
the class KeySignHandlerTest method buildUnsignedTxn.
private byte[] buildUnsignedTxn(REAddr from, REAddr to) throws Exception {
var entityOperationGroups = List.of(List.of(EntityOperation.from(new AccountVaultEntity(from), ResourceOperation.withdraw(new TokenResource("xrd", REAddr.ofNativeToken()), UInt256.ONE)), EntityOperation.from(new AccountVaultEntity(to), ResourceOperation.deposit(new TokenResource("xrd", REAddr.ofNativeToken()), UInt256.ONE))));
var operationTxBuilder = new OperationTxBuilder(null, entityOperationGroups, currentForkView);
var builder = radixEngine.constructWithFees(operationTxBuilder, false, from, NotEnoughNativeTokensForFeesException::new);
return builder.buildForExternalSign().blob();
}
use of com.radixdlt.api.core.model.OperationTxBuilder in project radixdlt by radixdlt.
the class MempoolTransactionHandlerTest method buildSignedTxn.
private Txn buildSignedTxn(REAddr from, REAddr to) throws Exception {
final UInt256 toTransfer = getLiquidAmount().toSubunits().subtract(Amount.ofTokens(1).toSubunits());
var entityOperationGroups = List.of(List.of(EntityOperation.from(new AccountVaultEntity(from), ResourceOperation.withdraw(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer)), EntityOperation.from(new AccountVaultEntity(to), ResourceOperation.deposit(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer))));
var operationTxBuilder = new OperationTxBuilder(null, entityOperationGroups, currentForkView);
var builder = radixEngine.constructWithFees(operationTxBuilder, false, from, NotEnoughNativeTokensForFeesException::new);
return builder.signAndBuild(hashSigner::sign);
}
use of com.radixdlt.api.core.model.OperationTxBuilder in project radixdlt by radixdlt.
the class ConstructionFinalizeTest method buildUnsignedTransferTxn.
private UnsignedTxnData buildUnsignedTransferTxn(REAddr from, REAddr to) throws Exception {
final UInt256 toTransfer = getLiquidAmount().toSubunits().subtract(Amount.ofTokens(1).toSubunits());
var entityOperationGroups = List.of(List.of(EntityOperation.from(new AccountVaultEntity(from), ResourceOperation.withdraw(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer)), EntityOperation.from(new AccountVaultEntity(to), ResourceOperation.deposit(new TokenResource("xrd", REAddr.ofNativeToken()), toTransfer))));
var operationTxBuilder = new OperationTxBuilder(null, entityOperationGroups, currentForkView);
var builder = radixEngine.constructWithFees(operationTxBuilder, false, from, NotEnoughNativeTokensForFeesException::new);
return builder.buildForExternalSign();
}
Aggregations