Show / Hide Table of Contents

    Class Block

    Block information. Definition: data/bookkeeping/block.go : Block

    Inheritance
    System.Object
    Block
    Implements
    System.IEquatable<Block>
    System.ComponentModel.DataAnnotations.IValidatableObject
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Algorand.V2.Model
    Assembly: Algorand.dll
    Syntax
    [DataContract]
    public class Block : IEquatable<Block>, IValidatableObject

    Constructors

    | Improve this Doc View Source

    Block(Byte[], String, Byte[], BlockRewards, Nullable<Int64>, Byte[], Nullable<Int64>, List<Transaction>, Byte[], Nullable<Int64>, BlockUpgradeState, BlockUpgradeVote)

    Initializes a new instance of the Block class.

    Declaration
    public Block(byte[] genesisHash = null, string genesisId = null, byte[] previousBlockHash = null, BlockRewards rewards = null, long? round = default(long? ), byte[] seed = null, long? timestamp = default(long? ), List<Transaction> transactions = null, byte[] transactionsRoot = null, long? txnCounter = default(long? ), BlockUpgradeState upgradeState = null, BlockUpgradeVote upgradeVote = null)
    Parameters
    Type Name Description
    System.Byte[] genesisHash

    \[gh\] hash to which this block belongs. (required).

    System.String genesisId

    \[gen\] ID to which this block belongs. (required).

    System.Byte[] previousBlockHash

    \[prev\] Previous block hash. (required).

    BlockRewards rewards

    rewards.

    System.Nullable<System.Int64> round

    \[rnd\] Current round on which this block was appended to the chain. (required).

    System.Byte[] seed

    \[seed\] Sortition seed. (required).

    System.Nullable<System.Int64> timestamp

    \[ts\] Block creation timestamp in seconds since eposh (required).

    System.Collections.Generic.List<Transaction> transactions

    \[txns\] list of transactions corresponding to a given round..

    System.Byte[] transactionsRoot

    \[txn\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot. (required).

    System.Nullable<System.Int64> txnCounter

    \[tc\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced. Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported)..

    BlockUpgradeState upgradeState

    upgradeState.

    BlockUpgradeVote upgradeVote

    upgradeVote.

    Properties

    | Improve this Doc View Source

    GenesisHash

    \[gh\] hash to which this block belongs.

    Declaration
    [DataMember(Name = "genesis-hash", EmitDefaultValue = false)]
    public byte[] GenesisHash { get; set; }
    Property Value
    Type Description
    System.Byte[]

    \[gh\] hash to which this block belongs.

    | Improve this Doc View Source

    GenesisId

    \[gen\] ID to which this block belongs.

    Declaration
    [DataMember(Name = "genesis-id", EmitDefaultValue = false)]
    public string GenesisId { get; set; }
    Property Value
    Type Description
    System.String

    \[gen\] ID to which this block belongs.

    | Improve this Doc View Source

    PreviousBlockHash

    \[prev\] Previous block hash.

    Declaration
    [DataMember(Name = "previous-block-hash", EmitDefaultValue = false)]
    public byte[] PreviousBlockHash { get; set; }
    Property Value
    Type Description
    System.Byte[]

    \[prev\] Previous block hash.

    | Improve this Doc View Source

    Rewards

    Gets or Sets Rewards

    Declaration
    [DataMember(Name = "rewards", EmitDefaultValue = false)]
    public BlockRewards Rewards { get; set; }
    Property Value
    Type Description
    BlockRewards
    | Improve this Doc View Source

    Round

    \[rnd\] Current round on which this block was appended to the chain.

    Declaration
    [DataMember(Name = "round", EmitDefaultValue = false)]
    public long? Round { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int64>

    \[rnd\] Current round on which this block was appended to the chain.

    | Improve this Doc View Source

    Seed

    \[seed\] Sortition seed.

    Declaration
    [DataMember(Name = "seed", EmitDefaultValue = false)]
    public byte[] Seed { get; set; }
    Property Value
    Type Description
    System.Byte[]

    \[seed\] Sortition seed.

    | Improve this Doc View Source

    Timestamp

    \[ts\] Block creation timestamp in seconds since eposh

    Declaration
    [DataMember(Name = "timestamp", EmitDefaultValue = false)]
    public long? Timestamp { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int64>

    \[ts\] Block creation timestamp in seconds since eposh

    | Improve this Doc View Source

    Transactions

    \[txns\] list of transactions corresponding to a given round.

    Declaration
    [DataMember(Name = "transactions", EmitDefaultValue = false)]
    public List<Transaction> Transactions { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Transaction>

    \[txns\] list of transactions corresponding to a given round.

    | Improve this Doc View Source

    TransactionsRoot

    \[txn\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.

    Declaration
    [DataMember(Name = "transactions-root", EmitDefaultValue = false)]
    public byte[] TransactionsRoot { get; set; }
    Property Value
    Type Description
    System.Byte[]

    \[txn\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.

    | Improve this Doc View Source

    TxnCounter

    \[tc\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced. Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).

    Declaration
    [DataMember(Name = "txn-counter", EmitDefaultValue = false)]
    public long? TxnCounter { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int64>

    \[tc\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced. Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).

    | Improve this Doc View Source

    UpgradeState

    Gets or Sets UpgradeState

    Declaration
    [DataMember(Name = "upgrade-state", EmitDefaultValue = false)]
    public BlockUpgradeState UpgradeState { get; set; }
    Property Value
    Type Description
    BlockUpgradeState
    | Improve this Doc View Source

    UpgradeVote

    Gets or Sets UpgradeVote

    Declaration
    [DataMember(Name = "upgrade-vote", EmitDefaultValue = false)]
    public BlockUpgradeVote UpgradeVote { get; set; }
    Property Value
    Type Description
    BlockUpgradeVote

    Methods

    | Improve this Doc View Source

    Equals(Block)

    Returns true if Block instances are equal

    Declaration
    public bool Equals(Block input)
    Parameters
    Type Name Description
    Block input

    Instance of Block to be compared

    Returns
    Type Description
    System.Boolean

    Boolean

    | Improve this Doc View Source

    Equals(Object)

    Returns true if objects are equal

    Declaration
    public override bool Equals(object input)
    Parameters
    Type Name Description
    System.Object input

    Object to be compared

    Returns
    Type Description
    System.Boolean

    Boolean

    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Gets the hash code

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    Hash code

    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    ToJson()

    Returns the JSON string presentation of the object

    Declaration
    public virtual string ToJson()
    Returns
    Type Description
    System.String

    JSON string presentation of the object

    | Improve this Doc View Source

    ToString()

    Returns the string presentation of the object

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    String presentation of the object

    Overrides
    System.Object.ToString()

    Explicit Interface Implementations

    | Improve this Doc View Source

    IValidatableObject.Validate(ValidationContext)

    To validate all properties of the instance

    Declaration
    IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
    Parameters
    Type Name Description
    System.ComponentModel.DataAnnotations.ValidationContext validationContext

    Validation context

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult>

    Validation Result

    Implements

    System.IEquatable<T>
    System.ComponentModel.DataAnnotations.IValidatableObject
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX