Skip to content

Commit

Permalink
Merge branch 'main' into static-analyzer-suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
nginnever committed Dec 19, 2022
2 parents 8438a9a + 2167d9f commit be8ddf6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export const ParamConditionInputValue = ({ param, condition, disabled, onChange
}
onChange({ ...condition, value: [value] })
}

const humanReadableValue =
dirty || condition.value[0] == null || condition.value[0] === ""
? condition.value[0]
: ethers.utils.defaultAbiCoder.decode([param], condition.value[0])
return (
<TextField
error={!valid && dirty}
Expand All @@ -68,7 +71,7 @@ export const ParamConditionInputValue = ({ param, condition, disabled, onChange
disableUnderline: true,
className: classNames(classes.input, { [classes.error]: !valid && dirty }),
}}
value={condition.value[0]}
value={humanReadableValue}
placeholder={getPlaceholderForType(param)}
onChange={(evt) => handleChange(evt.target.value)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const TargetFunctionParams = ({ func, funcConditions, disabled, onChange
onChange({ ...funcConditions, type, params: newConditions })
}

// TODO: we need to prefill the current values (without it being added to the changes, since it's not a change)
return (
<>
{func.inputs.map((param, index) => (
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph/src/permissions.mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function handleScopeParameter(event: ScopeParameter): void {
const parameter = new Parameter(parameterId) // will always overwrite the parameter
const paramType = PARAMETER_TYPE[event.params.paramType]
const paramComp = PARAMETER_COMPARISON[event.params.paramComp]
const compValue = event.params.compValue
const compValue = event.params.compValue // Can't be decode here, we do not have the required info (target ABI), must be done in frontend.
parameter.owningFunction = functionId
parameter.index = event.params.index.toI32()
parameter.type = paramType
Expand Down

0 comments on commit be8ddf6

Please sign in to comment.