-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2143 from planetarium/release/10
Release/10 to main
- Loading branch information
Showing
66 changed files
with
2,325 additions
and
842 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: update-submodule | ||
|
||
on: | ||
push: | ||
branches: | ||
- rc-v* | ||
- release/* | ||
|
||
jobs: | ||
update-submodule: | ||
if: github.ref_type == 'branch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update other repos referring NineChronicles.Headless as submodules | ||
uses: planetarium/submodule-updater@main | ||
with: | ||
token: ${{ secrets.SUBMODULE_UPDATER_GH_TOKEN }} | ||
committer: > | ||
Submodule Updater <engineering+submodule-updater@planetariumhq.com> | ||
targets: | | ||
${{ github.repository_owner }}/NineChronicles.DataProvider:${{ github.ref_name }}? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
Libplanet.Extensions.ActionEvaluatorCommonComponents/AccountDelta.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System.Collections.Immutable; | ||
using System.Numerics; | ||
using Bencodex.Types; | ||
using Libplanet.Assets; | ||
using Libplanet.Consensus; | ||
using Libplanet.State; | ||
|
||
namespace Libplanet.Extensions.ActionEvaluatorCommonComponents | ||
{ | ||
public class AccountDelta : IAccountDelta | ||
{ | ||
public AccountDelta() | ||
{ | ||
States = ImmutableDictionary<Address, IValue>.Empty; | ||
Fungibles = ImmutableDictionary<(Address, Currency), BigInteger>.Empty; | ||
TotalSupplies = ImmutableDictionary<Currency, BigInteger>.Empty; | ||
ValidatorSet = null; | ||
} | ||
|
||
public AccountDelta( | ||
IImmutableDictionary<Address, IValue> statesDelta, | ||
IImmutableDictionary<(Address, Currency), BigInteger> fungiblesDelta, | ||
IImmutableDictionary<Currency, BigInteger> totalSuppliesDelta, | ||
ValidatorSet? validatorSetDelta) | ||
{ | ||
States = statesDelta; | ||
Fungibles = fungiblesDelta; | ||
TotalSupplies = totalSuppliesDelta; | ||
ValidatorSet = validatorSetDelta; | ||
} | ||
|
||
/// <inheritdoc cref="IAccountDelta.UpdatedAddresses"/> | ||
public IImmutableSet<Address> UpdatedAddresses => | ||
StateUpdatedAddresses.Union(FungibleUpdatedAddresses); | ||
|
||
/// <inheritdoc cref="IAccountDelta.StateUpdatedAddresses"/> | ||
public IImmutableSet<Address> StateUpdatedAddresses => | ||
States.Keys.ToImmutableHashSet(); | ||
|
||
/// <inheritdoc cref="IAccountDelta.States"/> | ||
public IImmutableDictionary<Address, IValue> States { get; } | ||
|
||
/// <inheritdoc cref="IAccountDelta.FungibleUpdatedAddresses"/> | ||
public IImmutableSet<Address> FungibleUpdatedAddresses => | ||
Fungibles.Keys.Select(pair => pair.Item1).ToImmutableHashSet(); | ||
|
||
/// <inheritdoc cref="IAccountDelta.UpdatedFungibleAssets"/> | ||
public IImmutableSet<(Address, Currency)> UpdatedFungibleAssets => | ||
Fungibles.Keys.ToImmutableHashSet(); | ||
|
||
/// <inheritdoc cref="IAccountDelta.Fungibles"/> | ||
public IImmutableDictionary<(Address, Currency), BigInteger> Fungibles { get; } | ||
|
||
/// <inheritdoc cref="IAccountDelta.UpdatedTotalSupplyCurrencies"/> | ||
public IImmutableSet<Currency> UpdatedTotalSupplyCurrencies => | ||
TotalSupplies.Keys.ToImmutableHashSet(); | ||
|
||
/// <inheritdoc cref="IAccountDelta.TotalSupplies"/> | ||
public IImmutableDictionary<Currency, BigInteger> TotalSupplies { get; } | ||
|
||
/// <inheritdoc cref="IAccountDelta.ValidatorSet"/> | ||
public ValidatorSet? ValidatorSet { get; } | ||
} | ||
} |
Oops, something went wrong.