From b5f17215db8491074bd302fc5899c6ae612f4b50 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 8 Aug 2023 18:28:45 +0300 Subject: [PATCH 1/2] config: enable session-based iterators on privnet Signed-off-by: Anna Shaleva --- config/protocol.privnet.docker.four.yml | 1 + config/protocol.privnet.docker.one.yml | 1 + config/protocol.privnet.docker.single.yml | 1 + config/protocol.privnet.docker.three.yml | 1 + config/protocol.privnet.docker.two.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/config/protocol.privnet.docker.four.yml b/config/protocol.privnet.docker.four.yml index e54f85c0a..f4ce1a16b 100644 --- a/config/protocol.privnet.docker.four.yml +++ b/config/protocol.privnet.docker.four.yml @@ -73,6 +73,7 @@ ApplicationConfiguration: - ":30336" MaxGasInvoke: 15 EnableCORSWorkaround: false + SessionEnabled: true Prometheus: Enabled: true Addresses: diff --git a/config/protocol.privnet.docker.one.yml b/config/protocol.privnet.docker.one.yml index 779da4d17..f4e35a7db 100644 --- a/config/protocol.privnet.docker.one.yml +++ b/config/protocol.privnet.docker.one.yml @@ -73,6 +73,7 @@ ApplicationConfiguration: - ":30333" MaxGasInvoke: 15 EnableCORSWorkaround: false + SessionEnabled: true Prometheus: Enabled: true Addresses: diff --git a/config/protocol.privnet.docker.single.yml b/config/protocol.privnet.docker.single.yml index f85722d9e..f5a119414 100644 --- a/config/protocol.privnet.docker.single.yml +++ b/config/protocol.privnet.docker.single.yml @@ -64,6 +64,7 @@ ApplicationConfiguration: - ":30333" EnableCORSWorkaround: false MaxGasInvoke: 15 + SessionEnabled: true Prometheus: Enabled: true Addresses: diff --git a/config/protocol.privnet.docker.three.yml b/config/protocol.privnet.docker.three.yml index fc293d174..634647c9e 100644 --- a/config/protocol.privnet.docker.three.yml +++ b/config/protocol.privnet.docker.three.yml @@ -73,6 +73,7 @@ ApplicationConfiguration: - ":30335" MaxGasInvoke: 15 EnableCORSWorkaround: false + SessionEnabled: true Prometheus: Enabled: true Addresses: diff --git a/config/protocol.privnet.docker.two.yml b/config/protocol.privnet.docker.two.yml index 86e9c7da6..f63158a6a 100644 --- a/config/protocol.privnet.docker.two.yml +++ b/config/protocol.privnet.docker.two.yml @@ -73,6 +73,7 @@ ApplicationConfiguration: EnableCORSWorkaround: false Addresses: - ":30334" + SessionEnabled: true Prometheus: Enabled: true Addresses: From 4e6b1c4a3888aa79bea824fb079f34f1a24e2845 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 8 Aug 2023 18:29:32 +0300 Subject: [PATCH 2/2] examples: extend storage contract Add method that returns iterator. It's needed for the workshop. Signed-off-by: Anna Shaleva --- examples/storage/storage.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/storage/storage.go b/examples/storage/storage.go index 42416dd82..2fe5f7305 100644 --- a/examples/storage/storage.go +++ b/examples/storage/storage.go @@ -54,3 +54,9 @@ func Find(value []byte) []string { } return result } + +// FindReturnIter returns an iterator over key-value pairs with the key that has the specified prefix. +func FindReturnIter(prefix []byte) iterator.Iterator { + iter := storage.Find(ctx, prefix, storage.None) + return iter +}