Skip to main content

AccountUpdateTree

Class which represents a tree of account updates, in a compressed way which allows iterating and selectively witnessing the account updates.

The (recursive) type signature is:

type AccountUpdateTree = {
accountUpdate: Hashed<AccountUpdate>;
children: AccountUpdateForest;
};
type AccountUpdateForest = MerkleList<AccountUpdateTree>;

Extends

  • {"accountUpdate": HashedAccountUpdate.provable; "children": AccountUpdateForest.provable; "id": RandomId; }

Constructors

new AccountUpdateTree()

new AccountUpdateTree(value: {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}): AccountUpdateTree

Parameters

value

value.accountUpdate: Hashed\<AccountUpdate>= HashedAccountUpdate.provable

value.children: MerkleList\<{ "accountUpdate": HashedAccountUpdate.provable; "children": MerkleListBase\<AccountUpdateTreeBase>; "id": RandomId; }>= AccountUpdateForest.provable

value.id: number= RandomId

Returns

AccountUpdateTree

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).constructor

Source

lib/provable/types/struct.ts:268

Properties

accountUpdate

accountUpdate: Hashed<AccountUpdate> = HashedAccountUpdate.provable;

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).accountUpdate

Source

lib/mina/account-update.ts:1380


children

children: MerkleList<{
"accountUpdate": HashedAccountUpdate.provable;
"children": MerkleListBase<AccountUpdateTreeBase>;
"id": RandomId;
}> = AccountUpdateForest.provable;

Type declaration

accountUpdate
accountUpdate: Hashed<AccountUpdate> = HashedAccountUpdate.provable;
children
children: MerkleListBase<AccountUpdateTreeBase>;
id
id: number = RandomId;

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).children

Source

lib/mina/account-update.ts:1381


id

id: number = RandomId;

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).id

Source

lib/mina/account-update.ts:1379


_isStruct

static _isStruct: true;

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, })._isStruct

Source

lib/provable/types/struct.ts:268


check()

static check: (value: {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}) => void;

Add assertions to the proof to check if value is a valid member of type T. This function does not return anything, instead it creates any number of assertions to prove that value is a valid member of the type T.

For instance, calling check function on the type Bool asserts that the value of the element is either 1 or 0.

Parameters

value

the element of type T to put assertions on.

value.accountUpdate: Hashed\<AccountUpdate>= HashedAccountUpdate.provable

value.children: MerkleList\<{ "accountUpdate": HashedAccountUpdate.provable; "children": MerkleListBase\<AccountUpdateTreeBase>; "id": RandomId; }>= AccountUpdateForest.provable

value.id: number= RandomId

Returns

void

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).check

Source

lib/provable/types/provable-intf.ts:66


fromValue()

static fromValue: (x: any) => {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
};

Convert provable type from a normal JS type.

Parameters

x: any

Returns

{
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}
accountUpdate
accountUpdate: Hashed<AccountUpdate> = HashedAccountUpdate.provable;
children
children: MerkleList<{
"accountUpdate": HashedAccountUpdate.provable;
"children": MerkleListBase<AccountUpdateTreeBase>;
"id": RandomId;
}> = AccountUpdateForest.provable;
Type declaration
accountUpdate
accountUpdate: Hashed<AccountUpdate> = HashedAccountUpdate.provable;
children
children: MerkleListBase<AccountUpdateTreeBase>;
id
id: number = RandomId;
id
id: number = RandomId;

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).fromValue

Source

lib/provable/types/provable-intf.ts:76


toAuxiliary()

static toAuxiliary: (value?: {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}) => any[];

A function that takes value (optional), an element of type T, as argument and returns an array of any type that make up the "auxiliary" (non-provable) data of value.

Parameters

value?

the element of type T to generate the auxiliary data array from, optional. If not provided, a default value for auxiliary data is returned.

value.accountUpdate?: Hashed\<AccountUpdate>= HashedAccountUpdate.provable

value.children?: MerkleList\<{ "accountUpdate": HashedAccountUpdate.provable; "children": MerkleListBase\<AccountUpdateTreeBase>; "id": RandomId; }>= AccountUpdateForest.provable

value.id?: number= RandomId

Returns

any[]

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).toAuxiliary

Source

lib/provable/types/provable-intf.ts:37


toFields()

static toFields: (value: {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}) => Field[];

A function that takes value, an element of type T, as argument and returns an array of Field elements that make up the provable data of value.

Parameters

value

the element of type T to generate the Field array from.

value.accountUpdate: Hashed\<AccountUpdate>= HashedAccountUpdate.provable

value.children: MerkleList\<{ "accountUpdate": HashedAccountUpdate.provable; "children": MerkleListBase\<AccountUpdateTreeBase>; "id": RandomId; }>= AccountUpdateForest.provable

value.id: number= RandomId

Returns

Field[]

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).toFields

Source

lib/provable/types/provable-intf.ts:26


toInput()

static toInput: (x: {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}) => {
"fields": Field[];
"packed": [Field, number][];
};

Parameters

x

x.accountUpdate: Hashed\<AccountUpdate>= HashedAccountUpdate.provable

x.children: MerkleList\<{ "accountUpdate": HashedAccountUpdate.provable; "children": MerkleListBase\<AccountUpdateTreeBase>; "id": RandomId; }>= AccountUpdateForest.provable

x.id: number= RandomId

Returns

{
"fields": Field[];
"packed": [Field, number][];
}
fields?
optional fields: Field[];
packed?
optional packed: [Field, number][];

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).toInput

Source

lib/provable/types/struct.ts:271


toValue()

static toValue: (x: {
"accountUpdate": HashedAccountUpdate.provable;
"children": AccountUpdateForest.provable;
"id": RandomId;
}) => any;

Convert provable type to a normal JS type.

Parameters

x

x.accountUpdate: Hashed\<AccountUpdate>= HashedAccountUpdate.provable

x.children: MerkleList\<{ "accountUpdate": HashedAccountUpdate.provable; "children": MerkleListBase\<AccountUpdateTreeBase>; "id": RandomId; }>= AccountUpdateForest.provable

x.id: number= RandomId

Returns

any

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).toValue

Source

lib/provable/types/provable-intf.ts:71

Methods

approve()

approve(update: AccountUpdate | AccountUpdateTree, hash?: Field): void

Add an AccountUpdate or AccountUpdateTree to the children of this tree's root.

See AccountUpdate.approve.

Parameters

update: AccountUpdate | AccountUpdateTree

hash?: Field

Returns

void

Source

lib/mina/account-update.ts:1400


empty()

static empty(): AccountUpdateTree

Returns

AccountUpdateTree

Overrides

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).empty

Source

lib/mina/account-update.ts:1416


from()

static from(update: AccountUpdate | AccountUpdateTree, hash?: Field): AccountUpdateTree

Create a tree of account updates which only consists of a root.

Parameters

update: AccountUpdate | AccountUpdateTree

hash?: Field

Returns

AccountUpdateTree

Source

lib/mina/account-update.ts:1386


fromFields()

static fromFields(fields: Field[], aux: any): AccountUpdateTree

Parameters

fields: Field[]

aux: any

Returns

AccountUpdateTree

Overrides

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).fromFields

Source

lib/mina/account-update.ts:1413


sizeInFields()

static sizeInFields(): number

Return the size of the T type in terms of Field type, as Field is the primitive type.

Returns

number

A number representing the size of the T type in terms of Field type.

Inherited from

StructNoJson({ id: RandomId, accountUpdate: HashedAccountUpdate.provable, children: AccountUpdateForest.provable, }).sizeInFields

Source

lib/provable/types/provable-intf.ts:56