Home Reference Source Test
public class | source

SynchronousAccountsTree

Extends:

ObservableAccountsTree → SynchronousAccountsTree

Direct Subclass:

PartialAccountsTree

Method Summary

Public Methods
public
public

getSync(address: Address, expectedToBePresent: boolean): Account

public

async preloadAddresses(addresses: Array<Address>): Promise

public

putBatch(address: Address, account: Account)

public

putSync(address: Address, account: Account)

public
Protected Methods
protected

_insertBatch(node: AccountsTreeNode, prefix: string, account: Account, rootPath: Array<AccountsTreeNode>): *

protected

This method updates all empty hashes (and only such).

Inherited Summary

From class Observable
public static get

WILDCARD: string: string

public

bubble(observable: Observable, types: ...string)

public

fire(type: string, args: ...*): Promise | null

public

off(type: string, id: number)

public

on(type: string, callback: Function): number

From class AccountsTree
public static

async createVolatile(): Promise<AccountsTree>

public static

async getPersistent(jdb: *): Promise<AccountsTree>

public get
public

abort(): Promise

public

async commit(): Promise

public

async get(address: Address): PromiseAccount>

public

async getAccountsProof(addresses: Array<Address>): Promise<AccountsProof>

public

async getChunk(startPrefix: string, size: number): Promise<AccountsTreeChunk>

public

async isEmpty(): Promise<boolean>

public

async partialTree(): Promise<PartialAccountsTree>

public

put(address: Address, account: Account): Promise

public

async root(): Promise<Hash>

public
public

synchronousTransaction(enableWatchdog: boolean): Promise<SynchronousAccountsTree>

public

transaction(enableWatchdog: boolean): Promise<AccountsTree>

protected

async _init(): Promise<AccountsTree>

Public Methods

public finalizeBatch() source

public getSync(address: Address, expectedToBePresent: boolean): Account source

Params:

NameTypeAttributeDescription
address Address
expectedToBePresent boolean
  • optional

Return:

Account (nullable: true)

public async preloadAddresses(addresses: Array<Address>): Promise source

Params:

NameTypeAttributeDescription
addresses Array<Address>

Return:

Promise

public putBatch(address: Address, account: Account) source

Params:

NameTypeAttributeDescription
address Address
account Account

public putSync(address: Address, account: Account) source

Params:

NameTypeAttributeDescription
address Address
account Account

public rootSync(): Hash source

Return:

Hash

Protected Methods

protected _insertBatch(node: AccountsTreeNode, prefix: string, account: Account, rootPath: Array<AccountsTreeNode>): * source

Params:

NameTypeAttributeDescription
node AccountsTreeNode
prefix string
account Account
rootPath Array<AccountsTreeNode>

Return:

*

protected _updateHashes(node: AccountsTreeNode): * source

This method updates all empty hashes (and only such).

Params:

NameTypeAttributeDescription
node AccountsTreeNode

Return:

*