How to use the merkle-patricia-tree.prototype function in merkle-patricia-tree

To help you get started, we’ve selected a few merkle-patricia-tree 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 trufflesuite / ganache-core / lib / utils / forkedstoragetrie.js View on Github external
this.keyExists(key, function(err, exists) {
    if (err) {
      return callback(err);
    }

    if (exists) {
      // TODO: just because we have the key doesn't mean we're at the right
      // block number/root to send it. We need to check the block number
      // before using the data in our own trie.
      MerklePatriciaTree.prototype.get.call(self, key, function(err, r) {
        callback(err, r);
      });
    } else {
      self.keyIsDeleted(key, (err, deleted) => {
        if (err) {
          return callback(err);
        }

        if (deleted) {
          // it was deleted. return nothing.
          callback(null, Buffer.allocUnsafe(0));
          return;
        }

        // If this is the main trie, get the whole account.
        if (self.address == null) {