Class Block
Block contains a block information
Inheritance
Inherited Members
Namespace: Algorand.Algod.Model
Assembly: Algorand.dll
Syntax
[DataContract]
public class Block : IEquatable<Block>, IValidatableObject
Constructors
| Improve this Doc View SourceBlock(String, Nullable<UInt64>, String, String, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, String, String, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, String, Nullable<Int64>, String, TransactionList, Nullable<Boolean>, String)
Initializes a new instance of the Block class.
Declaration
public Block(string currentProtocol = null, ulong? frac = default(ulong? ), string hash = null, string nextProtocol = null, ulong? nextProtocolApprovals = default(ulong? ), ulong? nextProtocolSwitchOn = default(ulong? ), ulong? nextProtocolVoteBefore = default(ulong? ), ulong? period = default(ulong? ), string previousBlockHash = null, string proposer = null, ulong? rate = default(ulong? ), ulong? reward = default(ulong? ), ulong? round = default(ulong? ), string seed = null, long? timestamp = default(long? ), string txnRoot = null, TransactionList txns = null, bool? upgradeApprove = default(bool? ), string upgradePropose = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | currentProtocol | CurrentProtocol is a string that represents the current protocol (required). |
System.Nullable<System.UInt64> | frac | The number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round.. |
System.String | hash | Hash is the current block hash (required). |
System.String | nextProtocol | NextProtocol is a string that represents the next proposed protocol (required). |
System.Nullable<System.UInt64> | nextProtocolApprovals | NextProtocolApprovals is the number of blocks which approved the protocol upgrade (required). |
System.Nullable<System.UInt64> | nextProtocolSwitchOn | NextProtocolSwitchOn is the round on which the protocol upgrade will take effect (required). |
System.Nullable<System.UInt64> | nextProtocolVoteBefore | NextProtocolVoteBefore is the deadline round for this protocol upgrade (No votes will be consider after this round) (required). |
System.Nullable<System.UInt64> | period | Period is the period on which the block was confirmed (required). |
System.String | previousBlockHash | PreviousBlockHash is the previous block hash (required). |
System.String | proposer | Proposer is the address of this block proposer (required). |
System.Nullable<System.UInt64> | rate | The number of new MicroAlgos added to the participation stake from rewards at the next round.. |
System.Nullable<System.UInt64> | reward | RewardsLevel specifies how many rewards, in MicroAlgos, have been distributed to each config.Protocol.RewardUnit of MicroAlgos since genesis.. |
System.Nullable<System.UInt64> | round | Round is the current round on which this block was appended to the chain (required). |
System.String | seed | Seed is the sortition seed (required). |
System.Nullable<System.Int64> | timestamp | TimeStamp in seconds since epoch (required). |
System.String | txnRoot | 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). |
TransactionList | txns | txns. |
System.Nullable<System.Boolean> | upgradeApprove | UpgradeApprove indicates a yes vote for the current proposal (required). |
System.String | upgradePropose | UpgradePropose indicates a proposed upgrade (required). |
Properties
| Improve this Doc View SourceCurrentProtocol
CurrentProtocol is a string that represents the current protocol
Declaration
[DataMember(Name = "currentProtocol", EmitDefaultValue = false)]
public string CurrentProtocol { get; set; }
Property Value
Type | Description |
---|---|
System.String | CurrentProtocol is a string that represents the current protocol |
Frac
The number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round.
Declaration
[DataMember(Name = "frac", EmitDefaultValue = false)]
public ulong? Frac { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | The number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round. |
Hash
Hash is the current block hash
Declaration
[DataMember(Name = "hash", EmitDefaultValue = false)]
public string Hash { get; set; }
Property Value
Type | Description |
---|---|
System.String | Hash is the current block hash |
NextProtocol
NextProtocol is a string that represents the next proposed protocol
Declaration
[DataMember(Name = "nextProtocol", EmitDefaultValue = false)]
public string NextProtocol { get; set; }
Property Value
Type | Description |
---|---|
System.String | NextProtocol is a string that represents the next proposed protocol |
NextProtocolApprovals
NextProtocolApprovals is the number of blocks which approved the protocol upgrade
Declaration
[DataMember(Name = "nextProtocolApprovals", EmitDefaultValue = false)]
public ulong? NextProtocolApprovals { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | NextProtocolApprovals is the number of blocks which approved the protocol upgrade |
NextProtocolSwitchOn
NextProtocolSwitchOn is the round on which the protocol upgrade will take effect
Declaration
[DataMember(Name = "nextProtocolSwitchOn", EmitDefaultValue = false)]
public ulong? NextProtocolSwitchOn { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | NextProtocolSwitchOn is the round on which the protocol upgrade will take effect |
NextProtocolVoteBefore
NextProtocolVoteBefore is the deadline round for this protocol upgrade (No votes will be consider after this round)
Declaration
[DataMember(Name = "nextProtocolVoteBefore", EmitDefaultValue = false)]
public ulong? NextProtocolVoteBefore { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | NextProtocolVoteBefore is the deadline round for this protocol upgrade (No votes will be consider after this round) |
Period
Period is the period on which the block was confirmed
Declaration
[DataMember(Name = "period", EmitDefaultValue = false)]
public ulong? Period { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | Period is the period on which the block was confirmed |
PreviousBlockHash
PreviousBlockHash is the previous block hash
Declaration
[DataMember(Name = "previousBlockHash", EmitDefaultValue = false)]
public string PreviousBlockHash { get; set; }
Property Value
Type | Description |
---|---|
System.String | PreviousBlockHash is the previous block hash |
Proposer
Proposer is the address of this block proposer
Declaration
[DataMember(Name = "proposer", EmitDefaultValue = false)]
public string Proposer { get; set; }
Property Value
Type | Description |
---|---|
System.String | Proposer is the address of this block proposer |
Rate
The number of new MicroAlgos added to the participation stake from rewards at the next round.
Declaration
[DataMember(Name = "rate", EmitDefaultValue = false)]
public ulong? Rate { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | The number of new MicroAlgos added to the participation stake from rewards at the next round. |
Reward
RewardsLevel specifies how many rewards, in MicroAlgos, have been distributed to each config.Protocol.RewardUnit of MicroAlgos since genesis.
Declaration
[DataMember(Name = "reward", EmitDefaultValue = false)]
public ulong? Reward { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | RewardsLevel specifies how many rewards, in MicroAlgos, have been distributed to each config.Protocol.RewardUnit of MicroAlgos since genesis. |
Round
Round is the current round on which this block was appended to the chain
Declaration
[DataMember(Name = "round", EmitDefaultValue = false)]
public ulong? Round { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> | Round is the current round on which this block was appended to the chain |
Seed
Seed is the sortition seed
Declaration
[DataMember(Name = "seed", EmitDefaultValue = false)]
public string Seed { get; set; }
Property Value
Type | Description |
---|---|
System.String | Seed is the sortition seed |
Timestamp
TimeStamp in seconds since epoch
Declaration
[DataMember(Name = "timestamp", EmitDefaultValue = false)]
public long? Timestamp { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int64> | TimeStamp in seconds since epoch |
TxnRoot
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 = "txnRoot", EmitDefaultValue = false)]
public string TxnRoot { get; set; }
Property Value
Type | Description |
---|---|
System.String | 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. |
Txns
Gets or Sets Txns
Declaration
[DataMember(Name = "txns", EmitDefaultValue = false)]
public TransactionList Txns { get; set; }
Property Value
Type | Description |
---|---|
TransactionList |
UpgradeApprove
UpgradeApprove indicates a yes vote for the current proposal
Declaration
[DataMember(Name = "upgradeApprove", EmitDefaultValue = false)]
public bool? UpgradeApprove { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> | UpgradeApprove indicates a yes vote for the current proposal |
UpgradePropose
UpgradePropose indicates a proposed upgrade
Declaration
[DataMember(Name = "upgradePropose", EmitDefaultValue = false)]
public string UpgradePropose { get; set; }
Property Value
Type | Description |
---|---|
System.String | UpgradePropose indicates a proposed upgrade |
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 |