-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #286 from lidofinance/develop
Merge into main from develop
- Loading branch information
Showing
12 changed files
with
171 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[ | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "_trustedCaller", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "_nodeOperatorsRegistry", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "_creator", "type": "address" }, | ||
{ "internalType": "bytes", "name": "_evmScriptCallData", "type": "bytes" } | ||
], | ||
"name": "createEVMScript", | ||
"outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes", "name": "_evmScriptCallData", "type": "bytes" } | ||
], | ||
"name": "decodeEVMScriptCallData", | ||
"outputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "nodeOperatorId", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "bool", | ||
"name": "isTargetLimitActive", | ||
"type": "bool" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "targetLimit", | ||
"type": "uint256" | ||
} | ||
], | ||
"internalType": "struct UpdateTargetValidatorLimits.TargetValidatorsLimit[]", | ||
"name": "", | ||
"type": "tuple[]" | ||
} | ||
], | ||
"stateMutability": "pure", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "nodeOperatorsRegistry", | ||
"outputs": [ | ||
{ | ||
"internalType": "contract INodeOperatorsRegistry", | ||
"name": "", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "trustedCaller", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
modules/motions/ui/MotionDescription/DescSDVTTargetValidatorLimitsUpdateV1.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { UpdateTargetValidatorLimitsV1Abi } from 'generated' | ||
import { NestProps } from './types' | ||
import { useSDVTNodeOperatorsList } from 'modules/motions/hooks/useSDVTNodeOperatorsList' | ||
|
||
// UpdateTargetValidatorLimitsV1 | ||
export function DescSDVTTargetValidatorLimitsUpdateV1({ | ||
callData, | ||
isOnChain, | ||
}: NestProps<UpdateTargetValidatorLimitsV1Abi['decodeEVMScriptCallData']>) { | ||
const { data: nodeOperatorsList } = useSDVTNodeOperatorsList({ | ||
withSummary: true, | ||
}) | ||
return ( | ||
<> | ||
{callData.map((item, index) => { | ||
const nodeOperatorId = item.nodeOperatorId.toNumber() | ||
const nodeOperator = nodeOperatorsList?.[nodeOperatorId] | ||
|
||
const nodeOperatorName = nodeOperator ? nodeOperator.name : '' | ||
|
||
if (!item.isTargetLimitActive) { | ||
return ( | ||
<div key={nodeOperatorId}> | ||
Disable target validator limit for Node Operator{' '} | ||
<b>{nodeOperatorName}</b> (id: {nodeOperatorId}) | ||
{index === callData.length - 1 ? '.' : '; '} | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div key={nodeOperatorId}> | ||
Set target validator limit for Node Operator{' '} | ||
<b>{nodeOperatorName}</b> (id: {nodeOperatorId}){' '} | ||
{nodeOperator && isOnChain | ||
? `from ${nodeOperator.targetValidatorsCount} ` | ||
: ''} | ||
{`to ${item.targetLimit}`} | ||
{index === callData.length - 1 ? '.' : '; '} | ||
</div> | ||
) | ||
})} | ||
</> | ||
) | ||
} |
8 changes: 4 additions & 4 deletions
8
...n/DescSDVTTargetValidatorLimitsUpdate.tsx → ...DescSDVTTargetValidatorLimitsUpdateV2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters