Skip to content

Commit

Permalink
update swagger file
Browse files Browse the repository at this point in the history
  • Loading branch information
trestinlsd committed Feb 17, 2025
1 parent 3758e5b commit bf2dc1c
Show file tree
Hide file tree
Showing 8 changed files with 566 additions and 250 deletions.
546 changes: 346 additions & 200 deletions client/docs/swagger-ui/swagger.json

Large diffs are not rendered by default.

192 changes: 165 additions & 27 deletions precompiles/avs/abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand All @@ -35,9 +35,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand All @@ -60,9 +60,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand All @@ -79,9 +79,9 @@
"inputs": [
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand All @@ -103,9 +103,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "operatorAddress",
"type": "string"
"type": "address"
}
],
"name": "ChallengeInitiated",
Expand All @@ -122,9 +122,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
}
],
"name": "OperatorJoined",
Expand All @@ -141,9 +141,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
}
],
"name": "OperatorLeft",
Expand All @@ -154,9 +154,9 @@
"inputs": [
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand Down Expand Up @@ -185,9 +185,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand Down Expand Up @@ -246,9 +246,9 @@
},
{
"indexed": false,
"internalType": "string",
"internalType": "address",
"name": "sender",
"type": "string"
"type": "address"
},
{
"indexed": false,
Expand Down Expand Up @@ -339,9 +339,9 @@
"type": "uint64"
},
{
"internalType": "uint64",
"internalType": "uint8",
"name": "thresholdPercentage",
"type": "uint64"
"type": "uint8"
},
{
"internalType": "uint64",
Expand Down Expand Up @@ -484,6 +484,35 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "taskAddress",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "uint64",
"name": "taskID",
"type": "uint64"
}
],
"name": "getOperatorTaskResponse",
"outputs": [
{
"internalType": "bytes",
"name": "taskResponse",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand All @@ -495,9 +524,9 @@
"name": "getOptInOperators",
"outputs": [
{
"internalType": "string[]",
"internalType": "address[]",
"name": "operators",
"type": "string[]"
"type": "address[]"
}
],
"stateMutability": "view",
Expand Down Expand Up @@ -543,9 +572,118 @@
"name": "getTaskInfo",
"outputs": [
{
"internalType": "uint64[]",
"name": "info",
"type": "uint64[]"
"components": [
{
"internalType": "address",
"name": "taskContractAddress",
"type": "address"
},
{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "bytes",
"name": "hash",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "taskId",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "taskResponsePeriod",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "taskStatisticalPeriod",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "taskChallengePeriod",
"type": "uint64"
},
{
"internalType": "uint8",
"name": "thresholdPercentage",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "startingEpoch",
"type": "uint64"
},
{
"internalType": "string",
"name": "actualThreshold",
"type": "string"
},
{
"internalType": "address[]",
"name": "optInOperators",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "signedOperators",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "noSignedOperators",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "errSignedOperators",
"type": "address[]"
},
{
"internalType": "string",
"name": "taskTotalPower",
"type": "string"
},
{
"components": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "uint256",
"name": "power",
"type": "uint256"
}
],
"internalType": "struct OperatorActivePower[]",
"name": "operatorActivePower",
"type": "tuple[]"
},
{
"internalType": "bool",
"name": "isExpected",
"type": "bool"
},
{
"internalType": "address[]",
"name": "eligibleRewardOperators",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "eligibleSlashOperators",
"type": "address[]"
}
],
"internalType": "struct TaskInfo",
"name": "taskInfo",
"type": "tuple"
}
],
"stateMutability": "view",
Expand Down
2 changes: 1 addition & 1 deletion precompiles/avs/avs.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz [
bz, err = p.GetTaskInfo(ctx, contract, method, args)
if err != nil {
ctx.Logger().Error("internal error when calling avs precompile", "module", "avs precompile", "method", method.Name, "err", err)
bz, err = method.Outputs.Pack([]uint64{})
bz, err = method.Outputs.Pack(nil)
}
case MethodIsOperator:
bz, err = p.IsOperator(ctx, contract, method, args)
Expand Down
2 changes: 1 addition & 1 deletion precompiles/avs/avs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ func (suite *AVSManagerPrecompileSuite) TestRunRegTaskInfo() {
rand.Bytes(3),
uint64(3),
uint64(3),
uint64(3),
uint8(3),
uint64(3),
)
suite.Require().NoError(err, "failed to pack input")
Expand Down
Loading

0 comments on commit bf2dc1c

Please sign in to comment.