This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// slotTypes = [minutes, hours, days, months] in seconds | |
export const getPastSlots = ( | |
start, | |
now, | |
type, | |
length, | |
unit | |
) => { | |
const slot = slotTypes[type] * length; | |
return Math.floor((now - start) / slot) - unit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async applyProposalAsset(store: StateStore): Promise<ApplyProposal> { | |
const errors: TransactionError[] = []; | |
const proposal = await store.account.getOrDefault(this.getProposalAddress()) as ProposalAccount; | |
const addressBook = await store.account.getOrDefault(getAddressFromPublicKey(this.asset.addressBook)) as AddressBookAccount; | |
const proposedMember = await store.account.getOrDefault(getAddressFromPublicKey(this.asset.options.member)) as Account; | |
if (!this.asset.options.member) { | |
errors.push( | |
new TransactionError( | |
'`.asset.options.member` should contain the proposal.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {proposal, errors} = await this.applyProposalAsset(store); | |
errors.map(err => { | |
errs.push(err); | |
}); | |
proposal.publicKey = this.getProposalPublicKey(); | |
proposal.asset = { | |
...proposal.asset, | |
options: proposal.asset.options || {}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
BaseTransaction, | |
TransactionError, | |
utils | |
} = require('@liskhq/lisk-transactions'); | |
class MultiRecipient extends BaseTransaction { | |
static get TYPE() { | |
return 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
BaseTransaction, | |
TransactionError, | |
utils | |
} = require('@liskhq/lisk-transactions'); | |
class MultiRecipient extends BaseTransaction { | |
static get TYPE() { | |
return 20; |
NewerOlder