From b35f351f0ba00883ef652a64eedffb0d88f27a80 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 27 Nov 2023 19:56:13 +0300 Subject: [PATCH] interop: add contract storage limits Users of NeoGo interop package may have a demand to use these limits for custom purposes, it would be nice to have them as constants. Signed-off-by: Anna Shaleva --- pkg/interop/storage/limits.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pkg/interop/storage/limits.go diff --git a/pkg/interop/storage/limits.go b/pkg/interop/storage/limits.go new file mode 100644 index 000000000..70cf266d7 --- /dev/null +++ b/pkg/interop/storage/limits.go @@ -0,0 +1,12 @@ +package storage + +// Contract storage limits. +const ( + // MaxKeyLen is the maximum length of a key for storage items. + // Contracts can't use keys longer than that in their requests to the DB. + MaxKeyLen = 64 + // MaxValueLen is the maximum length of a value for storage items. + // It is set to be the maximum value for uint16, contracts can't put + // values longer than that into the DB. + MaxValueLen = 65535 +)