How to use the @tanker/core/src/Blocks/Block.hashBlock function in @tanker/core

To help you get started, we’ve selected a few @tanker/core 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 TankerHQ / sdk-js / packages / functional-tests / src / Helpers.js View on Github external
export function makeRootBlock(appKeyPair: Object) {
  const rootBlock = {
    trustchain_id: new Uint8Array(0),
    nature: preferredNature(NATURE_KIND.trustchain_creation),
    author: new Uint8Array(32),
    payload: appKeyPair.publicKey,
    signature: new Uint8Array(tcrypto.SIGNATURE_SIZE)
  };

  rootBlock.trustchain_id = hashBlock(rootBlock);

  return rootBlock;
}