Skip to content

Commit

Permalink
Merge pull request #2143 from planetarium/release/10
Browse files Browse the repository at this point in the history
Release/10 to main
  • Loading branch information
U-lis authored Jul 19, 2023
2 parents 4fe61b8 + e1132f5 commit 48930d4
Show file tree
Hide file tree
Showing 66 changed files with 2,325 additions and 842 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/deploy_gh_pages.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/update-submodule.yaml
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 }}?
2 changes: 1 addition & 1 deletion Lib9c
Submodule Lib9c updated 669 files
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void Serialization()
null,
addresses[1],
0,
0,
false,
previousStates,
new Random(123),
Expand All @@ -41,11 +42,12 @@ public void Serialization()
Assert.Equal(Null.Value, deserialized.Action);
Assert.Equal(123, deserialized.InputContext.Random.Seed);
Assert.Equal(0, deserialized.InputContext.BlockIndex);
Assert.Equal(0, deserialized.InputContext.BlockProtocolVersion);
Assert.Equal(new[] { "one", "two" }, deserialized.Logs);
Assert.Equal(addresses[0], deserialized.InputContext.Signer);
Assert.Equal(addresses[1], deserialized.InputContext.Miner);
Assert.Equal(Null.Value, deserialized.OutputStates.GetState(addresses[0]));
Assert.Equal((Text)"foo", deserialized.OutputStates.GetState(addresses[1]));
Assert.Equal(new List((Text)"bar"), deserialized.OutputStates.GetState(addresses[2]));
Assert.Equal(Null.Value, deserialized.OutputState.GetState(addresses[0]));
Assert.Equal((Text)"foo", deserialized.OutputState.GetState(addresses[1]));
Assert.Equal(new List((Text)"bar"), deserialized.OutputState.GetState(addresses[2]));
}
}
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; }
}
}
Loading

0 comments on commit 48930d4

Please sign in to comment.