Skip to content

Commit ce28e18

Browse files
committed
fix: implement IStore.OnNewSnapshot event in RpcStore
The RpcStore class was missing implementation of the OnNewSnapshot event required by the IStore interface. This change adds the event declaration and invokes it in the GetSnapshot method to maintain interface compatibility.
1 parent e40f22b commit ce28e18

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Neo.SmartContract.Testing/Storage/Rpc/RpcStore.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public class RpcStore : IStore
2828
{
2929
private int _id = 0;
3030

31+
/// <summary>
32+
/// Event raised when a new snapshot is created
33+
/// </summary>
34+
public event IStore.OnNewSnapshotDelegate? OnNewSnapshot;
35+
3136
/// <summary>
3237
/// Url
3338
/// </summary>
@@ -50,7 +55,12 @@ public RpcStore(string url) : this(new Uri(url)) { }
5055

5156
public void Delete(byte[] key) => throw new NotImplementedException();
5257
public void Put(byte[] key, byte[] value) => throw new NotImplementedException();
53-
public IStoreSnapshot GetSnapshot() => new RpcSnapshot(this);
58+
public IStoreSnapshot GetSnapshot()
59+
{
60+
var snapshot = new RpcSnapshot(this);
61+
OnNewSnapshot?.Invoke(this, snapshot);
62+
return snapshot;
63+
}
5464
public bool Contains(byte[] key) => TryGet(key) != null;
5565
public void Dispose() { }
5666

0 commit comments

Comments
 (0)