diff --git a/precompiles/avs/tx.go b/precompiles/avs/tx.go index 32a4ac441..40691fb6f 100644 --- a/precompiles/avs/tx.go +++ b/precompiles/avs/tx.go @@ -301,7 +301,7 @@ func (p Precompile) RegisterBLSPublicKey( pubkeyBz, ok := args[2].([]byte) if !ok { - return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 3, "[]byte", pubkeyBz) + return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 2, "[]byte", pubkeyBz) } blsParams.PubKey = pubkeyBz @@ -350,7 +350,7 @@ func (p Precompile) OperatorSubmitTask( taskID, ok := args[1].(uint64) if !ok { - return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 1, "uint64", taskID) + return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 1, "uint64", args[1]) } resultParams.TaskID = taskID @@ -379,7 +379,16 @@ func (p Precompile) OperatorSubmitTask( resultParams.Stage = stage resultParams.OperatorAddress = resultParams.CallerAddress - err := p.avsKeeper.SubmitTaskResult(ctx, resultParams) + + result := &avstypes.TaskResultInfo{ + TaskId: resultParams.TaskID, + OperatorAddress: resultParams.OperatorAddress, + TaskContractAddress: resultParams.TaskContractAddress.String(), + TaskResponse: resultParams.TaskResponse, + BlsSignature: resultParams.BlsSignature, + Stage: resultParams.Stage, + } + err := p.avsKeeper.SetTaskResultInfo(ctx, resultParams.OperatorAddress, result) if err != nil { return nil, err } diff --git a/x/avs/keeper/keeper.go b/x/avs/keeper/keeper.go index 3329ebfa7..36e281f0a 100644 --- a/x/avs/keeper/keeper.go +++ b/x/avs/keeper/keeper.go @@ -445,15 +445,3 @@ func (k Keeper) RaiseAndResolveChallenge(ctx sdk.Context, params *types.Challeng return k.SetTaskChallengedInfo(ctx, params.TaskID, params.OperatorAddress.String(), params.CallerAddress, params.TaskContractAddress) } - -func (k Keeper) SubmitTaskResult(ctx sdk.Context, params *types.TaskResultParams) error { - result := &types.TaskResultInfo{ - TaskId: params.TaskID, - OperatorAddress: params.OperatorAddress, - TaskContractAddress: params.TaskContractAddress.String(), - TaskResponse: params.TaskResponse, - BlsSignature: params.BlsSignature, - Stage: params.Stage, - } - return k.SetTaskResultInfo(ctx, params.OperatorAddress, result) -} diff --git a/x/avs/types/stage.go b/x/avs/types/stage.go index e951ca459..8c7586747 100644 --- a/x/avs/types/stage.go +++ b/x/avs/types/stage.go @@ -13,13 +13,13 @@ const ( ) type OperatorOptParams struct { - Name string - BlsPublicKey string - IsRegistered bool - Action uint64 - OperatorAddress string - Status string - AvsAddress string + Name string `json:"name"` + BlsPublicKey string `json:"bls_public_key"` + IsRegistered bool `json:"is_registered"` + Action uint64 `json:"action"` + OperatorAddress string `json:"operator_address"` + Status string `json:"status"` + AvsAddress string `json:"avs_address"` } type TaskInfoParams struct { @@ -93,8 +93,8 @@ type TaskResultParams struct { } type OperatorParams struct { - EarningsAddr string `json:"earnings_addr"` - ApproveAddr string `json:"approve_addr"` - OperatorMetaInfo string `json:"operator_meta_info"` - CallerAddress string `json:"caller_address"` + EarningsAddr string `json:"earnings_addr"` + ApproveAddr string `json:"approve_addr"` + OperatorMetaInfo string `json:"operator_meta_info"` + CallerAddress sdk.AccAddress `json:"caller_address"` }