You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: StratisFullNode-1.0.9.0 PoA with devmode=miner
Sample contract to generate the issue:
[Deploy]
public class SampleContract : SmartContract
{
public SampleContract(ISmartContractState smartContractState)
: base(smartContractState)
{
}
private void SetRequest(uint id, Request request) => State.SetStruct($"request:{id}", request);
public Request GetRequest(uint id) => State.GetStruct<Request>($"request:{id}");
public bool SampleRequest (uint id)
{
var request = new Request()
{
Id = id,
RequestStatus = Status.Created
};
SetRequest(id, request);
return true;
}
public struct Request
{
[Index]
public uint Id;
public Status RequestStatus;
}
public enum Status
{
Created,
Canceled
}
}
You can reproduce the issue by executing the SampleRequest method.
Error:
If you change RequestStatus to int and cast while storing, it works fine.
The text was updated successfully, but these errors were encountered:
divyang-desai
changed the title
Stack Overflow exception on storing struct with an enum value
Stack overflow exception on storing struct with an enum value.
Aug 15, 2021
Version: StratisFullNode-1.0.9.0 PoA with devmode=miner
Sample contract to generate the issue:
You can reproduce the issue by executing the
SampleRequest
method.Error:
If you change
RequestStatus
toint
and cast while storing, it works fine.The text was updated successfully, but these errors were encountered: