Skip to content

Commit

Permalink
Merge pull request #621 from radixdlt/add-transaction-tracker-to-well…
Browse files Browse the repository at this point in the history
…-known-addresses

include transaction tracker address in well known addresses.
  • Loading branch information
krzlabrdx authored Jan 24, 2024
2 parents bf56a45 + 1dd45e1 commit 6b727b4
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release Date: _unreleased_
- `vm_type`, `code_hash_hex` and `code_hex` are returned as collection (it's allowed after protocol update to have multiple codes per package). Previous properties will return empty strings to keep contract compatibility.
- Created new `package_blueprint_aggregate_history` table which will hold pointers to all package blueprints.
- Created new `package_code_aggregate_history` table which will hold pointers to all package codes.
- Extended well known addresses returned from `/status/network-configuration` with transaction tracker address.

## 1.2.4
Release Date: 4.01.2024
Expand Down
3 changes: 2 additions & 1 deletion apps/GatewayApi/Controllers/StatusController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public GatewayModel.NetworkConfigurationResponse NetworkConfiguration()
consensusManager: wellKnownAddresses.ConsensusManager,
genesisHelper: wellKnownAddresses.GenesisHelper,
faucet: wellKnownAddresses.Faucet,
poolPackage: wellKnownAddresses.PoolPackage
poolPackage: wellKnownAddresses.PoolPackage,
transactionTracker: wellKnownAddresses.TransactionTracker
)
);
}
Expand Down
9 changes: 8 additions & 1 deletion src/RadixDlt.CoreApiSdk/core-api-spec-copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5850,7 +5850,7 @@ components:
total_fee:
type: string
description: |
The string-encoded decimal representing the total amount of XRD payed as fee (execution, validator tip and royalties).
The string-encoded decimal representing the total amount of XRD paid as fee (execution, validator tip and royalties).
A decimal is formed of some signed integer `m` of attos (`10^(-18)`) units, where `-2^(192 - 1) <= m < 2^(192 - 1)`.
LtsEntityFungibleBalanceChanges:
type: object
Expand Down Expand Up @@ -6110,6 +6110,7 @@ components:
- consensus_manager
- genesis_helper
- faucet
- transaction_tracker
properties:
xrd:
type: string
Expand Down Expand Up @@ -6163,6 +6164,8 @@ components:
type: string
faucet:
type: string
transaction_tracker:
type: string
AddressType:
type: object
required:
Expand Down Expand Up @@ -7413,8 +7416,12 @@ components:
- $ref: "#/components/schemas/LedgerTransaction"
- type: object
required:
- name
- flashed_state_updates
properties:
name:
type: string
description: Human-readable identifier of the flash transaction.
flashed_state_updates:
$ref: "#/components/schemas/FlashedStateUpdates"
RoundUpdateTransaction:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,18 @@ protected FlashLedgerTransaction() { }
/// <summary>
/// Initializes a new instance of the <see cref="FlashLedgerTransaction" /> class.
/// </summary>
/// <param name="name">Human-readable identifier of the flash transaction. (required).</param>
/// <param name="flashedStateUpdates">flashedStateUpdates (required).</param>
/// <param name="type">type (required) (default to LedgerTransactionType.Flash).</param>
/// <param name="payloadHex">The hex-encoded full ledger transaction payload. Only returned if enabled in TransactionFormatOptions on your request..</param>
public FlashLedgerTransaction(FlashedStateUpdates flashedStateUpdates = default(FlashedStateUpdates), LedgerTransactionType type = LedgerTransactionType.Flash, string payloadHex = default(string)) : base(type, payloadHex)
public FlashLedgerTransaction(string name = default(string), FlashedStateUpdates flashedStateUpdates = default(FlashedStateUpdates), LedgerTransactionType type = LedgerTransactionType.Flash, string payloadHex = default(string)) : base(type, payloadHex)
{
// to ensure "name" is required (not null)
if (name == null)
{
throw new ArgumentNullException("name is a required property for FlashLedgerTransaction and cannot be null");
}
this.Name = name;
// to ensure "flashedStateUpdates" is required (not null)
if (flashedStateUpdates == null)
{
Expand All @@ -122,6 +129,13 @@ protected FlashLedgerTransaction() { }
this.FlashedStateUpdates = flashedStateUpdates;
}

/// <summary>
/// Human-readable identifier of the flash transaction.
/// </summary>
/// <value>Human-readable identifier of the flash transaction.</value>
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }

/// <summary>
/// Gets or Sets FlashedStateUpdates
/// </summary>
Expand All @@ -137,6 +151,7 @@ public override string ToString()
StringBuilder sb = new StringBuilder();
sb.Append("class FlashLedgerTransaction {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" FlashedStateUpdates: ").Append(FlashedStateUpdates).Append("\n");
sb.Append("}\n");
return sb.ToString();
Expand Down Expand Up @@ -173,6 +188,11 @@ public bool Equals(FlashLedgerTransaction input)
return false;
}
return base.Equals(input) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) && base.Equals(input) &&
(
this.FlashedStateUpdates == input.FlashedStateUpdates ||
(this.FlashedStateUpdates != null &&
Expand All @@ -189,6 +209,10 @@ public override int GetHashCode()
unchecked // Overflow is fine, just wrap
{
int hashCode = base.GetHashCode();
if (this.Name != null)
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
if (this.FlashedStateUpdates != null)
{
hashCode = (hashCode * 59) + this.FlashedStateUpdates.GetHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,16 @@ protected FlashLedgerTransactionAllOf() { }
/// <summary>
/// Initializes a new instance of the <see cref="FlashLedgerTransactionAllOf" /> class.
/// </summary>
/// <param name="name">Human-readable identifier of the flash transaction. (required).</param>
/// <param name="flashedStateUpdates">flashedStateUpdates (required).</param>
public FlashLedgerTransactionAllOf(FlashedStateUpdates flashedStateUpdates = default(FlashedStateUpdates))
public FlashLedgerTransactionAllOf(string name = default(string), FlashedStateUpdates flashedStateUpdates = default(FlashedStateUpdates))
{
// to ensure "name" is required (not null)
if (name == null)
{
throw new ArgumentNullException("name is a required property for FlashLedgerTransactionAllOf and cannot be null");
}
this.Name = name;
// to ensure "flashedStateUpdates" is required (not null)
if (flashedStateUpdates == null)
{
Expand All @@ -114,6 +121,13 @@ protected FlashLedgerTransactionAllOf() { }
this.FlashedStateUpdates = flashedStateUpdates;
}

/// <summary>
/// Human-readable identifier of the flash transaction.
/// </summary>
/// <value>Human-readable identifier of the flash transaction.</value>
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }

/// <summary>
/// Gets or Sets FlashedStateUpdates
/// </summary>
Expand All @@ -128,6 +142,7 @@ public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class FlashLedgerTransactionAllOf {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" FlashedStateUpdates: ").Append(FlashedStateUpdates).Append("\n");
sb.Append("}\n");
return sb.ToString();
Expand Down Expand Up @@ -164,6 +179,11 @@ public bool Equals(FlashLedgerTransactionAllOf input)
return false;
}
return
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) &&
(
this.FlashedStateUpdates == input.FlashedStateUpdates ||
(this.FlashedStateUpdates != null &&
Expand All @@ -180,6 +200,10 @@ public override int GetHashCode()
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Name != null)
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
if (this.FlashedStateUpdates != null)
{
hashCode = (hashCode * 59) + this.FlashedStateUpdates.GetHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected LtsCommittedTransactionOutcome() { }
/// <param name="fungibleEntityBalanceChanges">A list of all fungible balance updates which occurred in this transaction, aggregated by the global entity (such as account) which owns the vaults which were updated. (required).</param>
/// <param name="nonFungibleEntityBalanceChanges">Non fungible changes per entity and resource (required).</param>
/// <param name="resultantAccountFungibleBalances">A list of the resultant fungible account balances for any balances which changed in this transaction. Only balances for accounts are returned, not any other kind of entity. (required).</param>
/// <param name="totalFee">The string-encoded decimal representing the total amount of XRD payed as fee (execution, validator tip and royalties). A decimal is formed of some signed integer &#x60;m&#x60; of attos (&#x60;10^(-18)&#x60;) units, where &#x60;-2^(192 - 1) &lt;&#x3D; m &lt; 2^(192 - 1)&#x60;. (required).</param>
/// <param name="totalFee">The string-encoded decimal representing the total amount of XRD paid as fee (execution, validator tip and royalties). A decimal is formed of some signed integer &#x60;m&#x60; of attos (&#x60;10^(-18)&#x60;) units, where &#x60;-2^(192 - 1) &lt;&#x3D; m &lt; 2^(192 - 1)&#x60;. (required).</param>
public LtsCommittedTransactionOutcome(long stateVersion = default(long), long proposerTimestampMs = default(long), string accumulatorHash = default(string), TransactionIdentifiers userTransactionIdentifiers = default(TransactionIdentifiers), LtsCommittedTransactionStatus status = default(LtsCommittedTransactionStatus), List<LtsEntityFungibleBalanceChanges> fungibleEntityBalanceChanges = default(List<LtsEntityFungibleBalanceChanges>), List<LtsEntityNonFungibleBalanceChanges> nonFungibleEntityBalanceChanges = default(List<LtsEntityNonFungibleBalanceChanges>), List<LtsResultantAccountFungibleBalances> resultantAccountFungibleBalances = default(List<LtsResultantAccountFungibleBalances>), string totalFee = default(string))
{
this.StateVersion = stateVersion;
Expand Down Expand Up @@ -204,9 +204,9 @@ protected LtsCommittedTransactionOutcome() { }
public List<LtsResultantAccountFungibleBalances> ResultantAccountFungibleBalances { get; set; }

/// <summary>
/// The string-encoded decimal representing the total amount of XRD payed as fee (execution, validator tip and royalties). A decimal is formed of some signed integer &#x60;m&#x60; of attos (&#x60;10^(-18)&#x60;) units, where &#x60;-2^(192 - 1) &lt;&#x3D; m &lt; 2^(192 - 1)&#x60;.
/// The string-encoded decimal representing the total amount of XRD paid as fee (execution, validator tip and royalties). A decimal is formed of some signed integer &#x60;m&#x60; of attos (&#x60;10^(-18)&#x60;) units, where &#x60;-2^(192 - 1) &lt;&#x3D; m &lt; 2^(192 - 1)&#x60;.
/// </summary>
/// <value>The string-encoded decimal representing the total amount of XRD payed as fee (execution, validator tip and royalties). A decimal is formed of some signed integer &#x60;m&#x60; of attos (&#x60;10^(-18)&#x60;) units, where &#x60;-2^(192 - 1) &lt;&#x3D; m &lt; 2^(192 - 1)&#x60;. </value>
/// <value>The string-encoded decimal representing the total amount of XRD paid as fee (execution, validator tip and royalties). A decimal is formed of some signed integer &#x60;m&#x60; of attos (&#x60;10^(-18)&#x60;) units, where &#x60;-2^(192 - 1) &lt;&#x3D; m &lt; 2^(192 - 1)&#x60;. </value>
[DataMember(Name = "total_fee", IsRequired = true, EmitDefaultValue = true)]
public string TotalFee { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ protected NetworkConfigurationResponseWellKnownAddresses() { }
/// <param name="consensusManager">consensusManager (required).</param>
/// <param name="genesisHelper">genesisHelper (required).</param>
/// <param name="faucet">faucet (required).</param>
public NetworkConfigurationResponseWellKnownAddresses(string xrd = default(string), string secp256k1SignatureVirtualBadge = default(string), string ed25519SignatureVirtualBadge = default(string), string packageOfDirectCallerVirtualBadge = default(string), string globalCallerVirtualBadge = default(string), string systemTransactionBadge = default(string), string packageOwnerBadge = default(string), string validatorOwnerBadge = default(string), string accountOwnerBadge = default(string), string identityOwnerBadge = default(string), string packagePackage = default(string), string resourcePackage = default(string), string accountPackage = default(string), string identityPackage = default(string), string consensusManagerPackage = default(string), string accessControllerPackage = default(string), string transactionProcessorPackage = default(string), string metadataModulePackage = default(string), string royaltyModulePackage = default(string), string roleAssignmentModulePackage = default(string), string genesisHelperPackage = default(string), string faucetPackage = default(string), string poolPackage = default(string), string consensusManager = default(string), string genesisHelper = default(string), string faucet = default(string))
/// <param name="transactionTracker">transactionTracker (required).</param>
public NetworkConfigurationResponseWellKnownAddresses(string xrd = default(string), string secp256k1SignatureVirtualBadge = default(string), string ed25519SignatureVirtualBadge = default(string), string packageOfDirectCallerVirtualBadge = default(string), string globalCallerVirtualBadge = default(string), string systemTransactionBadge = default(string), string packageOwnerBadge = default(string), string validatorOwnerBadge = default(string), string accountOwnerBadge = default(string), string identityOwnerBadge = default(string), string packagePackage = default(string), string resourcePackage = default(string), string accountPackage = default(string), string identityPackage = default(string), string consensusManagerPackage = default(string), string accessControllerPackage = default(string), string transactionProcessorPackage = default(string), string metadataModulePackage = default(string), string royaltyModulePackage = default(string), string roleAssignmentModulePackage = default(string), string genesisHelperPackage = default(string), string faucetPackage = default(string), string poolPackage = default(string), string consensusManager = default(string), string genesisHelper = default(string), string faucet = default(string), string transactionTracker = default(string))
{
// to ensure "xrd" is required (not null)
if (xrd == null)
Expand Down Expand Up @@ -287,6 +288,12 @@ protected NetworkConfigurationResponseWellKnownAddresses() { }
throw new ArgumentNullException("faucet is a required property for NetworkConfigurationResponseWellKnownAddresses and cannot be null");
}
this.Faucet = faucet;
// to ensure "transactionTracker" is required (not null)
if (transactionTracker == null)
{
throw new ArgumentNullException("transactionTracker is a required property for NetworkConfigurationResponseWellKnownAddresses and cannot be null");
}
this.TransactionTracker = transactionTracker;
}

/// <summary>
Expand Down Expand Up @@ -445,6 +452,12 @@ protected NetworkConfigurationResponseWellKnownAddresses() { }
[DataMember(Name = "faucet", IsRequired = true, EmitDefaultValue = true)]
public string Faucet { get; set; }

/// <summary>
/// Gets or Sets TransactionTracker
/// </summary>
[DataMember(Name = "transaction_tracker", IsRequired = true, EmitDefaultValue = true)]
public string TransactionTracker { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand Down Expand Up @@ -479,6 +492,7 @@ public override string ToString()
sb.Append(" ConsensusManager: ").Append(ConsensusManager).Append("\n");
sb.Append(" GenesisHelper: ").Append(GenesisHelper).Append("\n");
sb.Append(" Faucet: ").Append(Faucet).Append("\n");
sb.Append(" TransactionTracker: ").Append(TransactionTracker).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -643,6 +657,11 @@ public bool Equals(NetworkConfigurationResponseWellKnownAddresses input)
this.Faucet == input.Faucet ||
(this.Faucet != null &&
this.Faucet.Equals(input.Faucet))
) &&
(
this.TransactionTracker == input.TransactionTracker ||
(this.TransactionTracker != null &&
this.TransactionTracker.Equals(input.TransactionTracker))
);
}

Expand Down Expand Up @@ -759,6 +778,10 @@ public override int GetHashCode()
{
hashCode = (hashCode * 59) + this.Faucet.GetHashCode();
}
if (this.TransactionTracker != null)
{
hashCode = (hashCode * 59) + this.TransactionTracker.GetHashCode();
}
return hashCode;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public sealed record WellKnownAddresses(
string ConsensusManager,
string GenesisHelper,
string Faucet,
string PoolPackage
string PoolPackage,
string TransactionTracker
);

public enum AddressEntityType
Expand Down
Loading

0 comments on commit 6b727b4

Please sign in to comment.