Skip to content

Commit

Permalink
partial pr comment response
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Aug 14, 2023
1 parent 2061960 commit 59fefee
Show file tree
Hide file tree
Showing 16 changed files with 1,320 additions and 1,429 deletions.
6 changes: 3 additions & 3 deletions cmd/goal/clerk.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var (
simulateEnableRequestTrace bool
simulateStackChange bool
simulateScratchChange bool
simulateStateChange bool
simulateAppStateChange bool
simulateAllowUnnamedResources bool
)

Expand Down Expand Up @@ -173,7 +173,7 @@ func init() {
simulateCmd.Flags().BoolVar(&simulateEnableRequestTrace, "trace", false, "Enable simulation time execution trace of app calls")
simulateCmd.Flags().BoolVar(&simulateStackChange, "stack", false, "Report stack change during simulation time")
simulateCmd.Flags().BoolVar(&simulateScratchChange, "scratch", false, "Report scratch change during simulation time")
simulateCmd.Flags().BoolVar(&simulateStateChange, "state", false, "Report app state change during simulation time")
simulateCmd.Flags().BoolVar(&simulateAppStateChange, "state", false, "Report application state changes during simulation time")
simulateCmd.Flags().BoolVar(&simulateAllowUnnamedResources, "allow-unnamed-resources", false, "Allow access to unnamed resources during simulation")
}

Expand Down Expand Up @@ -1388,7 +1388,7 @@ func traceCmdOptionToSimulateTraceConfigModel() simulation.ExecTraceConfig {
traceConfig.Enable = traceConfig.Enable || simulateEnableRequestTrace
traceConfig.Stack = traceConfig.Stack || simulateStackChange
traceConfig.Scratch = traceConfig.Scratch || simulateScratchChange
traceConfig.State = traceConfig.State || simulateStateChange
traceConfig.State = traceConfig.State || simulateAppStateChange

Check warning on line 1391 in cmd/goal/clerk.go

View check run for this annotation

Codecov / codecov/patch

cmd/goal/clerk.go#L1391

Added line #L1391 was not covered by tests

return traceConfig
}
27 changes: 11 additions & 16 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3686,7 +3686,7 @@
"type": "boolean"
},
"state-change": {
"description": "A boolean option enabling returning app state changes together with execution trace during simulation.",
"description": "A boolean option enabling returning application state changes together with execution trace during simulation.",
"type": "boolean"
}
}
Expand Down Expand Up @@ -4096,26 +4096,21 @@
}
}
},
"AppStateOperation": {
"description": "An operation against an app global/local/box key-value pair.",
"ApplicationStateOperation": {
"description": "An operation against an application global/local/box key-value pair.",
"required": [
"operation-type",
"operation",
"app-state-type",
"app-id",
"key"
],
"properties": {
"operation-type": {
"description": "Operation type. Value `1` is **create**, `2` is **write**, `4` is **read**, `8` is **delete**.",
"type": "integer"
"operation": {
"description": "Operation type. Value `w` is **write**, `d` is **delete**.",
"type": "string"
},
"app-state-type": {
"description": "Type of app state. Value `1` is **global state**, `2` is **local state**, `3` is **boxes**.",
"type": "integer"
},
"app-id": {
"description": "Application index.",
"type": "integer"
"description": "Type of application state. Value `g` is **global state**, `l` is **local state**, `b` is **boxes**.",
"type": "string"
},
"key": {
"description": "The key of the global/local/box state get written to.",
Expand Down Expand Up @@ -4146,10 +4141,10 @@
}
},
"state-changes": {
"description": "The operations against app states.",
"description": "The operations against application states.",
"type": "array",
"items": {
"$ref": "#/definitions/AppStateOperation"
"$ref": "#/definitions/ApplicationStateOperation"
}
},
"spawned-inners": {
Expand Down
67 changes: 31 additions & 36 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1200,39 +1200,6 @@
],
"type": "object"
},
"AppStateOperation": {
"description": "An operation against an app global/local/box key-value pair.",
"properties": {
"app-id": {
"description": "Application index.",
"type": "integer"
},
"app-state-type": {
"description": "Type of app state. Value `1` is **global state**, `2` is **local state**, `3` is **boxes**.",
"type": "integer"
},
"key": {
"description": "The key of the global/local/box state get written to.",
"format": "byte",
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
"type": "string"
},
"new-value": {
"$ref": "#/components/schemas/AvmValue"
},
"operation-type": {
"description": "Operation type. Value `1` is **create**, `2` is **write**, `4` is **read**, `8` is **delete**.",
"type": "integer"
}
},
"required": [
"app-id",
"app-state-type",
"key",
"operation-type"
],
"type": "object"
},
"Application": {
"description": "Application index and its parameters",
"properties": {
Expand Down Expand Up @@ -1333,6 +1300,34 @@
],
"type": "object"
},
"ApplicationStateOperation": {
"description": "An operation against an application global/local/box key-value pair.",
"properties": {
"app-state-type": {
"description": "Type of application state. Value `g` is **global state**, `l` is **local state**, `b` is **boxes**.",
"type": "string"
},
"key": {
"description": "The key of the global/local/box state get written to.",
"format": "byte",
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$",
"type": "string"
},
"new-value": {
"$ref": "#/components/schemas/AvmValue"
},
"operation": {
"description": "Operation type. Value `w` is **write**, `d` is **delete**.",
"type": "string"
}
},
"required": [
"app-state-type",
"key",
"operation"
],
"type": "object"
},
"ApplicationStateSchema": {
"description": "Specifies maximums on the number of each type that may be stored.",
"properties": {
Expand Down Expand Up @@ -2136,7 +2131,7 @@
"type": "boolean"
},
"state-change": {
"description": "A boolean option enabling returning app state changes together with execution trace during simulation.",
"description": "A boolean option enabling returning application state changes together with execution trace during simulation.",
"type": "boolean"
}
},
Expand Down Expand Up @@ -2320,9 +2315,9 @@
"type": "integer"
},
"state-changes": {
"description": "The operations against app states.",
"description": "The operations against application states.",
"items": {
"$ref": "#/components/schemas/AppStateOperation"
"$ref": "#/components/schemas/ApplicationStateOperation"
},
"type": "array"
}
Expand Down
Loading

0 comments on commit 59fefee

Please sign in to comment.