cosmos-sdk/core/testing/branch.go
Alex | Interchain Labs 9ea03a3c4b
chore: remove baseapp and sdk.Context fully from x/upgrade (#23396)
Co-authored-by: aljo242 <alex@skip.money>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2025-02-05 12:30:18 +00:00

26 lines
559 B
Go

package coretesting
import (
"context"
"cosmossdk.io/core/branch"
)
var _ branch.Service = &TestBranchService{}
type TestBranchService struct{}
func (bs TestBranchService) Execute(ctx context.Context, f func(ctx context.Context) error) error {
unwrap(ctx) // check that this is a testing context
return f(ctx)
}
func (bs TestBranchService) ExecuteWithGasLimit(
ctx context.Context,
gasLimit uint64,
f func(ctx context.Context) error,
) (gasUsed uint64, err error) {
unwrap(ctx) // check that this is a testing context
return gasLimit, f(ctx)
}