From a515e229f8a0187fbdc5614132c4e70c7a870f84 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Tue, 2 Jan 2024 15:54:51 +0900 Subject: [PATCH] Changelog --- CHANGES.md | 3 +++ Libplanet.Action/State/Account.cs | 2 ++ Libplanet.Action/State/IAccount.cs | 15 +++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 37928d3d604..c06bb5bc2d9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -40,6 +40,8 @@ be compatible with this version, specifically, those that ran with - (Libplanet.Store) Removed `BaseNode`. [[#3574]] - (Libplanet.Store) Added `ITrie.Remove()` interface method. [[#3576]] - (Libplanet.Store) Added `FullNode.RemoveChild()` method. [[#3576]] + - (Libplanet.Action) Added `IAccount.RemoveState()` interface method. + [[#3577]] [#3559]: https://github.com/planetarium/libplanet/pull/3559 [#3560]: https://github.com/planetarium/libplanet/pull/3560 @@ -51,6 +53,7 @@ be compatible with this version, specifically, those that ran with [#3573]: https://github.com/planetarium/libplanet/pull/3573 [#3574]: https://github.com/planetarium/libplanet/pull/3574 [#3576]: https://github.com/planetarium/libplanet/pull/3576 +[#3577]: https://github.com/planetarium/libplanet/pull/3577 Version 3.9.2 diff --git a/Libplanet.Action/State/Account.cs b/Libplanet.Action/State/Account.cs index 59e20b708ee..c10dc2c0684 100644 --- a/Libplanet.Action/State/Account.cs +++ b/Libplanet.Action/State/Account.cs @@ -52,6 +52,8 @@ public Account( [Pure] public IAccount SetState(Address address, IValue state) => UpdateState(address, state); + /// + [Pure] public IAccount RemoveState(Address address) => UpdateState(address, null); /// diff --git a/Libplanet.Action/State/IAccount.cs b/Libplanet.Action/State/IAccount.cs index 03f5704e9ac..d82723e83ae 100644 --- a/Libplanet.Action/State/IAccount.cs +++ b/Libplanet.Action/State/IAccount.cs @@ -67,6 +67,21 @@ public interface IAccount : IAccountState [Pure] IAccount SetState(Address address, IValue state); + /// + /// Gets a new instance that the account state of the given + /// is removed. + /// + /// The referring + /// the account to remove its state. + /// A new instance that + /// the account state of the given + /// is removed. + /// + /// This method method does not manipulate the instance, + /// but returns a new instance + /// with updated states instead. + /// + [Pure] IAccount RemoveState(Address address); ///