laconicd/utils/cmd.go
Roy Crihfield 5aa2594073 Integrate go-nitro
- Add nitro server and x/nitro module
    - wire go-nitro p2p through cometbft

- Add distsig server, currently WIP
    - integrate DKG and DSS schemes into ABCI methods

- Remove deprecated features
    - crisis module
    - module invariants

- Update to use newer SDK patterns
    - upgrade sdk to v0.53.x
    - custom address codec
    - expand use of depinject
    - migrate e2e tests to system tests
    - use depinject to set up integration tests
    - change reserved protobuf field name `cerc.registry.v1.Record.type`

- Revise & add documentation
    - TransferCoinsToModuleAccount: clarify function

- Update init.sh script
2025-09-21 11:44:44 +08:00

19 lines
372 B
Go

package utils
import (
"context"
"errors"
"fmt"
)
func GetFromContext[T any](ctx context.Context, key string) (*T, error) {
if v := ctx.Value(key); v != nil {
val, ok := v.(*T)
if !ok {
return nil, fmt.Errorf("context value of wrong type; expected %T, got %T", new(T), v)
}
return val, nil
}
return nil, errors.New("key not found in context: " + key)
}