Class Block
Block information. Definition: data/bookkeeping/block.go : Block
Inheritance
Inherited Members
Namespace: Algorand.V2.Model
Assembly: Algorand.dll
Syntax
[DataContract]
public class Block : IEquatable<Block>, IValidatableObject
Constructors
| Improve this Doc View SourceBlock(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 SourceGenesisHash
\[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. |
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. |
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. |
Rewards
Gets or Sets Rewards
Declaration
[DataMember(Name = "rewards", EmitDefaultValue = false)]
public BlockRewards Rewards { get; set; }
Property Value
Type | Description |
---|---|
BlockRewards |
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. |
Seed
\[seed\] Sortition seed.
Declaration
[DataMember(Name = "seed", EmitDefaultValue = false)]
public byte[] Seed { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] | \[seed\] Sortition seed. |
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 |
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. |
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. |
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). |
UpgradeState
Gets or Sets UpgradeState
Declaration
[DataMember(Name = "upgrade-state", EmitDefaultValue = false)]
public BlockUpgradeState UpgradeState { get; set; }
Property Value
Type | Description |
---|---|
BlockUpgradeState |
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 SourceEquals(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 |
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
GetHashCode()
Gets the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code |
Overrides
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 |
ToString()
Returns the string presentation of the object
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String presentation of the object |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceIValidatableObject.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 |