-
Notifications
You must be signed in to change notification settings - Fork 42
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
Enhancement/2004 add patch timestamp debug api #2077
base: v4.0.0
Are you sure you want to change the base?
Enhancement/2004 add patch timestamp debug api #2077
Conversation
SUGGESTIONS BEFORE MERGE:
|
else if ( _patchName == "SelfdestructStorageLimitPatch" ) | ||
return SchainPatchEnum::SelfdestructStorageLimitPatch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was missing in the original code. We had the SchainPatchEnum::SelfdestructStorageLimitPatch
enum variant defined, but not the convertion from its string value to the enum variant in this function (which converts a string to the corresponding SchainPatchEnum
variant. So I added the missing conversion.
std::vector< int > patchTimestamps; | ||
|
||
// Set custom config file & create timestamps for each patch | ||
size_t numPatches = static_cast< size_t >( SchainPatchEnum::PatchesCount ); | ||
for (size_t patch = 0; patch < numPatches ; patch++ ) { | ||
SchainPatchEnum patchEnum = static_cast< SchainPatchEnum >( patch ); | ||
int ts = patch + 1000; // just to offset from the default values (0, 1) | ||
patchTimestamps.push_back(ts); | ||
|
||
std::string patchName = getPatchNameForEnum(patchEnum) + "Timestamp"; | ||
patchName[0] = tolower( patchName[0] ); | ||
configJson["skaleConfig"]["sChain"][patchName] = ts; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use time_t
type instead of int
, as patchTimestamps are time_t
Description
Example call:
Example response:
Tests
Fixes #2004