How to use the @liskhq/lisk-transactions.VoteTransaction function in @liskhq/lisk-transactions

To help you get started, we’ve selected a few @liskhq/lisk-transactions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskHQ / lisk-sdk / protocol-specs / utils / chain_state_builder.js View on Github external
);
					}
					// Get the account that's voting
					const votingAccount = this.findAccountByAddress(
						votingAccountAddress,
						Object.values(this.state.accounts),
					);

					// Create the JSON for the vote transaction
					const castVotesObject = castVotes({
						votes: votedDelegates,
						unvotes: unvotedDelegates,
					});
					castVotesObject.timestamp = this.timestamp;
					// Create vote transaction instance
					const voteInstance = new VoteTransaction(castVotesObject);
					voteInstance.sign(votingAccount.passphrase);

					this.state.pendingTransactions.push(voteInstance);
					return this;
				},
			}),