Skip to content

Commit

Permalink
Fix test script error
Browse files Browse the repository at this point in the history
  • Loading branch information
p0p3yee committed Aug 23, 2024
1 parent db2fdea commit 0b4ecd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 65 deletions.
56 changes: 0 additions & 56 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,63 +78,7 @@ func NewFairyringAnteHandler(options FairyringHandlerOptions) sdk.AnteHandler {
ante.NewSigVerificationDecorator(options.BaseOptions.AccountKeeper, options.BaseOptions.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.BaseOptions.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
// pepante.NewPepDecorator(options.PepKeeper, options.TxEncoder, options.KeyShareLane),
}

return sdk.ChainAnteDecorators(anteDecorators...)
}

// // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// // channel keeper.
// type HandlerOptions struct {
// ante.HandlerOptions

// IBCKeeper *ibckeeper.Keeper
// WasmConfig *wasmtypes.WasmConfig
// WasmKeeper *wasmkeeper.Keeper
// TXCounterStoreService corestoretypes.KVStoreService
// CircuitKeeper circuitante.CircuitBreaker
// }

// func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
// if options.AccountKeeper == nil {
// return nil, errors.New("account keeper is required for ante builder")
// }
// if options.BankKeeper == nil {
// return nil, errors.New("bank keeper is required for ante builder")
// }
// if options.SignModeHandler == nil {
// return nil, errors.New("sign mode handler is required for ante builder")
// }
// if options.WasmConfig == nil {
// return nil, errors.New("wasm config is required for ante builder")
// }
// if options.TXCounterStoreService == nil {
// return nil, errors.New("wasm store service is required for ante builder")
// }
// if options.CircuitKeeper == nil {
// return nil, errors.New("circuit keeper is required for ante builder")
// }

// anteDecorators := []sdk.AnteDecorator{
// ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
// wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
// wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
// wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
// circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
// ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
// ante.NewValidateBasicDecorator(),
// ante.NewTxTimeoutHeightDecorator(),
// ante.NewValidateMemoDecorator(options.AccountKeeper),
// ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
// ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
// ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
// ante.NewValidateSigCountDecorator(options.AccountKeeper),
// ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
// ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
// ante.NewIncrementSequenceDecorator(options.AccountKeeper),
// ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
// }

// return sdk.ChainAnteDecorators(anteDecorators...), nil
// }
4 changes: 2 additions & 2 deletions x/keyshare/keeper/process_queues.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (k Keeper) ProcessPepRequestQueue(ctx sdk.Context) error {
}

reqs := k.pepKeeper.GetAllGenEncTxReqQueueEntry(ctx)
k.Logger().Info(fmt.Sprintf("PROCESSING PEP REQUEST QUEUE: %v", reqs))

for _, req := range reqs {
if req.EstimatedDelay == nil {
k.pepKeeper.RemoveReqQueueEntry(ctx, req.GetRequestId())
Expand Down Expand Up @@ -137,7 +137,7 @@ func (k Keeper) ProcessGovRequestQueue(ctx sdk.Context) error {
reqCount, _ := strconv.ParseUint(reqCountString, 10, 64)
reqCount = reqCount + 1

id := req.GetRequestId()
id := types.IdentityFromRequestCount(reqCount)

var keyshareRequest types.KeyShareRequest

Expand Down
13 changes: 6 additions & 7 deletions x/keyshare/types/key_key_share_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
"encoding/binary"
"strconv"
"strings"
)

var _ binary.ByteOrder
Expand All @@ -13,10 +12,10 @@ const (
KeyShareRequestKeyPrefix = "KeyshareRequest/value/"
)

func RequestCountFromIdentity(
identity string,
) uint64 {
reqCountString := strings.TrimSuffix(identity, "/rq")
reqCount, _ := strconv.ParseUint(reqCountString, 10, 64)
return reqCount
func IdentityFromRequestCount(
reqCount uint64,
) string {
reqNumber := strconv.FormatUint(reqCount, 10)
identity := reqNumber + "/rq"
return identity
}

0 comments on commit 0b4ecd9

Please sign in to comment.