How to use the @liskhq/lisk-cryptography.signDataWithPrivateKey function in @liskhq/lisk-cryptography

To help you get started, we’ve selected a few @liskhq/lisk-cryptography 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 / framework / src / modules / chain / block_processor_v2.js View on Github external
previousBlockId: previousBlock.id,
			generatorPublicKey: keypair.publicKey.toString('hex'),
			transactions: blockTransactions,
			height: nextHeight,
			maxHeightPreviouslyForged,
			maxHeightPrevoted,
		};

		// Reduce reward based on BFT rules
		if (!this.bftModule.isBFTProtocolCompliant(block)) {
			block.reward = block.reward.times(0.25);
		}

		return {
			...block,
			blockSignature: signDataWithPrivateKey(
				hash(getBytes(block)),
				keypair.privateKey,
			),
		};
	}
github LiskHQ / lisk-sdk / framework / src / modules / chain / blocks / block_v2.js View on Github external
const sign = (block, keypair) =>
	signDataWithPrivateKey(hash(getBytes(block)), keypair.privateKey);
github LiskHQ / lisk-sdk / framework / src / modules / chain / block_processor_v0.js View on Github external
totalAmount,
			totalFee,
			height: nextHeight,
			reward,
			payloadHash,
			timestamp,
			numberOfTransactions: blockTransactions.length,
			payloadLength: size,
			previousBlockId: previousBlock.id,
			generatorPublicKey: keypair.publicKey.toString('hex'),
			transactions: blockTransactions,
		};

		return {
			...block,
			blockSignature: signDataWithPrivateKey(
				hash(getBytes(block)),
				keypair.privateKey,
			),
		};
	}
}
github LiskHQ / lisk-sdk / framework / src / modules / chain / blocks / block_v1.js View on Github external
const sign = (block, keypair) =>
	signDataWithPrivateKey(hash(getBytes(block)), keypair.privateKey);
github LiskHQ / lisk-sdk / framework / src / modules / chain / blocks / block.js View on Github external
const sign = (block, keypair) =>
	signDataWithPrivateKey(hash(getBytes(block)), keypair.privateKey);