Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: specify the error message #3030

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Neo.VM/ExecutionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public VMState State
{
return state;
}
internal protected set
protected internal set
{
if (state != value)
{
Expand Down Expand Up @@ -1459,7 +1459,7 @@ private void ExecuteLoadFromSlot(Slot? slot, int index)
/// <summary>
/// Execute the next instruction.
/// </summary>
internal protected void ExecuteNext()
protected internal void ExecuteNext()
{
if (InvocationStack.Count == 0)
{
Expand Down
7 changes: 4 additions & 3 deletions src/Neo/SmartContract/ApplicationEngine.Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected internal StorageContext GetReadOnlyContext()
/// </summary>
/// <param name="context">The storage context to convert.</param>
/// <returns>The readonly storage context.</returns>
internal protected static StorageContext AsReadOnly(StorageContext context)
protected internal static StorageContext AsReadOnly(StorageContext context)
{
if (!context.IsReadOnly)
context = new StorageContext
Expand Down Expand Up @@ -167,8 +167,9 @@ protected internal IIterator Find(StorageContext context, byte[] prefix, FindOpt
/// <param name="value">The value of the entry.</param>
protected internal void Put(StorageContext context, byte[] key, byte[] value)
{
if (key.Length > MaxStorageKeySize || value.Length > MaxStorageValueSize || context.IsReadOnly)
throw new ArgumentException();
if (key.Length > MaxStorageKeySize) throw new ArgumentException("Key length too big", nameof(key));
if (value.Length > MaxStorageValueSize) throw new ArgumentException("Value length too big", nameof(value));
if (context.IsReadOnly) throw new ArgumentException("StorageContext is readonly", nameof(context));

int newDataSize;
StorageKey skey = new()
Expand Down