Skip to content

Commit

Permalink
Update types.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ACStone-MTS authored Aug 15, 2024
1 parent 6d5e5bf commit 9e70b22
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions source/docs/casper/concepts/serialization/types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Type Serialization

## Account Action Thresholds {#account-action-thresholds}

The minimum weight thresholds that have to be met when executing an action of a certain type. It serializes as three consecutive [`u8` values](./primitives.md#clvalue-numeric) as follows.

- `deployment`: The minimum weight threshold required to perform deployment actions as a `u8` value.

- `key_management`: The minimum weight threshold required to perform key management actions as a `u8` value.

## Account Config {#account-config}

Configuration of an individual account in *accounts.toml*, containing the account's public key, main purse balance and validator config.
Expand All @@ -22,16 +30,6 @@ Identifier for possible ways to retrieve an Account. It can consist of any of th

- [`AccountHash`](#account-hash): The `blake2b` hash of the account's public key.

## Action Thresholds {#action-thresholds}

The minimum weight thresholds that have to be met when executing an action of a certain type. It serializes as three consecutive [`u8` values](./primitives.md#clvalue-numeric) as follows.

- `deployment`: The minimum weight threshold required to perform deployment actions as a `u8` value.

- `upgrade_management`: The minimum weight threshold required to perform upgrade management actions as a `u8` value.

- `key_management`: The minimum weight threshold required to perform key management actions as a `u8` value.

## Activation Point {#activation-point}

The first era to which the associated protocol version applies. It serializes as a single [`u8`](./primitives.md#clvalue-numeric) tag indicating if the era in question is genesis. If it is the genesis era, the following bytes will be a `timestamp`. If not, the bytes represent an `era_id`.
Expand Down Expand Up @@ -284,6 +282,16 @@ Disabled contract versions, containing the following:

A log of all transforms produced during execution, serialized as a vector of [transforms](#transformv2).

## Entity Action Thresholds {#entity-action-thresholds}

The minimum weight thresholds that have to be met when executing an action of a certain type. It serializes as three consecutive [`u8` values](./primitives.md#clvalue-numeric) as follows.

- `deployment`: The minimum weight threshold required to perform deployment actions as a `u8` value.

- `upgrade_management`: The minimum weight threshold required to perform upgrade management actions as a `u8` value.

- `key_management`: The minimum weight threshold required to perform key management actions as a `u8` value.

## EntityAddr {#entity-addr}

The address for an `AddressableEntity`. It serializes as a `u8` [`EntityKindTag`](#entity-kind-tag) followed by the 32-byte buffer containing the bytes of the `hash_addr` as follows:
Expand Down Expand Up @@ -442,29 +450,29 @@ The result of a successful execution.

## ExecutionResultV2 {#executionresultv2}

The result of a single deploy. It serializes as a `u8` tag indicating either `Failure` as a 0 or `Success` as a 1. This is followed by the appropriate structure below:
The result of a single transaction. It serializes as a `u8` tag indicating either `Failure` as a 0 or `Success` as a 1. This is followed by the appropriate structure below:

### `Failure`

The result of a failed execution.

- `effects`: The [effect](#effects) of executing the deploy.
- `effects`: The [effect](#effects) of executing the transaction.

- `transfers`: A record of transfers performed while executing the deploy, serialized as a [`List`](./primitives.md#clvalue-list).
- `transfers`: A record of transfers performed while executing the transaction, serialized as a [`List`](./primitives.md#clvalue-list).

- `cost`: The cost of executing the deploy, serializes as a [`U512`](./primitives.md#clvalue-numeric) value.
- `cost`: The cost of executing the transaction, serializes as a [`U512`](./primitives.md#clvalue-numeric) value.

- `error_message`: The error message associated with executing the deploy, serialized as a [`String`](./primitives.md#clvalue-string).
- `error_message`: The error message associated with executing the transaction, serialized as a [`String`](./primitives.md#clvalue-string).

### `Success`

The result of a successful execution.

- `effects`: The [effects](#effects) of executing the deploy.
- `effects`: The [effects](#effects) of executing the transaction.

- `transfers`: A record of transfers performed while executing the deploy, serialized as a [`List`](./primitives.md#clvalue-list).
- `transfers`: A record of transfers performed while executing the transaction, serialized as a [`List`](./primitives.md#clvalue-list).

- `cost`: The cost of executing the deploy, serializes as a [`U512`](./primitives.md#clvalue-numeric) value.
- `cost`: The cost of executing the transaction, serializes as a [`U512`](./primitives.md#clvalue-numeric) value.

## Gas {#gas}

Expand Down

0 comments on commit 9e70b22

Please sign in to comment.