diff --git a/precompiles/avs/query.go b/precompiles/avs/query.go index dbf99060f..00cb46213 100644 --- a/precompiles/avs/query.go +++ b/precompiles/avs/query.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "strconv" + "strings" errorsmod "cosmossdk.io/errors" @@ -66,7 +67,7 @@ func (p Precompile) GetOptedInOperatorAccAddrs( return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 0, "string", addr) } - list, err := p.avsKeeper.GetOperatorKeeper().GetOptedInOperatorListByAVS(ctx, addr.String()) + list, err := p.avsKeeper.GetOperatorKeeper().GetOptedInOperatorListByAVS(ctx, strings.ToLower(addr.String())) if err != nil { return nil, err } @@ -115,7 +116,7 @@ func (p Precompile) GetOperatorOptedUSDValue( if !ok { return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 1, "string", operatorAddr) } - amount, err := p.avsKeeper.GetOperatorKeeper().GetOperatorOptedUSDValue(ctx, avsAddr.String(), operatorAddr) + amount, err := p.avsKeeper.GetOperatorKeeper().GetOperatorOptedUSDValue(ctx, strings.ToLower(avsAddr.String()), operatorAddr) if err != nil { if errors.Is(err, avstype.ErrNoKeyInTheStore) { return method.Outputs.Pack(common.Big0) diff --git a/precompiles/avs/tx.go b/precompiles/avs/tx.go index d9eba78fd..4929fed78 100644 --- a/precompiles/avs/tx.go +++ b/precompiles/avs/tx.go @@ -360,6 +360,10 @@ func (p Precompile) OperatorSubmitTask( } resultParams.TaskResponse = taskResponse + if len(taskResponse) == 0 { + resultParams.TaskResponse = nil + } + blsSignature, ok := args[3].([]byte) if !ok { return nil, fmt.Errorf(exocmn.ErrContractInputParaOrType, 3, "[]byte", blsSignature) diff --git a/x/operator/keeper/operator.go b/x/operator/keeper/operator.go index 86a9975ad..97b073acd 100644 --- a/x/operator/keeper/operator.go +++ b/x/operator/keeper/operator.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "strings" errorsmod "cosmossdk.io/errors" @@ -106,7 +107,7 @@ func (k *Keeper) HandleOptedInfo(ctx sdk.Context, operatorAddr, avsAddr string, return errorsmod.Wrap(err, "HandleOptedInfo: error occurred when parse acc address from Bech32") } store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorOptedAVSInfo) - infoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr) + infoKey := assetstype.GetJoinedStoreKey(operatorAddr, strings.ToLower(avsAddr)) // get info from the store value := store.Get(infoKey) if value == nil { @@ -130,7 +131,7 @@ func (k *Keeper) SetOptedInfo(ctx sdk.Context, operatorAddr, avsAddr string, inf if err != nil { return assetstype.ErrInvalidOperatorAddr } - infoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr) + infoKey := assetstype.GetJoinedStoreKey(operatorAddr, strings.ToLower(avsAddr)) bz := k.cdc.MustMarshal(info) store.Set(infoKey, bz) @@ -143,7 +144,7 @@ func (k *Keeper) GetOptedInfo(ctx sdk.Context, operatorAddr, avsAddr string) (in return nil, errorsmod.Wrap(err, "GetOptedInfo: error occurred when parse acc address from Bech32") } store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorOptedAVSInfo) - infoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr) + infoKey := assetstype.GetJoinedStoreKey(operatorAddr, strings.ToLower(avsAddr)) value := store.Get(infoKey) if value == nil { return nil, errorsmod.Wrap(operatortypes.ErrNoKeyInTheStore, fmt.Sprintf("GetOptedInfo: operator is %s, avs address is %s", opAccAddr, avsAddr))