use of io.nem.symbol.sdk.model.transaction.VotingKeyLinkTransaction in project nem2-sdk-java by nemtech.
the class VotingKeyLinkTransactionIntegrationTest method basicAnnounce.
@ParameterizedTest
@EnumSource(RepositoryType.class)
public void basicAnnounce(RepositoryType type) {
Account account = config().getNemesisAccount1();
PublicKey linkedPublicKey = PublicKey.generateRandom();
VotingKeyLinkTransaction linkTransaction = VotingKeyLinkTransactionFactory.create(getNetworkType(), getDeadline(), linkedPublicKey, (72), (26280), LinkAction.LINK).maxFee(maxFee).build();
announceAndValidate(type, account, linkTransaction);
VotingKeyLinkTransaction unlinkTransaction = VotingKeyLinkTransactionFactory.create(getNetworkType(), getDeadline(), linkedPublicKey, (72), (26280), LinkAction.UNLINK).maxFee(maxFee).build();
announceAndValidate(type, account, unlinkTransaction);
}
use of io.nem.symbol.sdk.model.transaction.VotingKeyLinkTransaction in project nem2-sdk-java by nemtech.
the class TestnetTester method sendVotingKey2.
private static void sendVotingKey2(RepositoryFactory repositoryFactory) throws Exception {
NetworkType networkType = repositoryFactory.getNetworkType().toFuture().get();
Account account = Account.createFromPrivateKey(PRIVATE_KEY, networkType);
System.out.println(account.getAddress().plain());
Duration duration = repositoryFactory.getEpochAdjustment().toFuture().get();
Deadline deadline = Deadline.create(duration);
PublicKey votingKey = PublicKey.fromHexString("463CCC639B5306DD06E56A273E13EF08CAB8D46A8ACA1D3919F19AF89DE116C5");
VotingKeyLinkTransaction transaction = VotingKeyLinkTransactionFactory.create(networkType, deadline, votingKey, (1), (26280), LinkAction.LINK).maxFee(MAX_FEE).build();
announceTransaction(repositoryFactory, account, transaction);
}
Aggregations