diff --git a/go.mod b/go.mod index 7b85c1c..fdb91e1 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( connectrpc.com/grpchealth v1.3.0 connectrpc.com/grpcreflect v1.2.0 github.com/blinklabs-io/adder v0.25.0 - github.com/blinklabs-io/gouroboros v0.103.1 + github.com/blinklabs-io/gouroboros v0.103.2 github.com/blinklabs-io/tx-submit-api v0.20.1 github.com/gin-contrib/zap v1.1.4 github.com/gin-gonic/gin v1.10.0 diff --git a/go.sum b/go.sum index a48d2a6..3cd4693 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5M github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/blinklabs-io/adder v0.25.0 h1:Rkfg3c3HX9bxM2+GJlkX4npGBunNUSSWUAhquVooVa8= github.com/blinklabs-io/adder v0.25.0/go.mod h1:T8QPCxIk9WfKCwKb+wWIR25/dbXbdOrf9D/QcOcoaYk= -github.com/blinklabs-io/gouroboros v0.103.1 h1:D/3Hlr09kw/cYM8gt6t7jVlTfDCXjb25nHL5V2l/3kc= -github.com/blinklabs-io/gouroboros v0.103.1/go.mod h1:wjiNCbZ2uQy9DGfLCgEgqagHxNBAv5UYsOdRBgoi3SU= +github.com/blinklabs-io/gouroboros v0.103.2 h1:kPA4dL0Ycwkh1ZJ6tckyRpUT2XU7ghRGHeKWI4HwQV8= +github.com/blinklabs-io/gouroboros v0.103.2/go.mod h1:wjiNCbZ2uQy9DGfLCgEgqagHxNBAv5UYsOdRBgoi3SU= github.com/blinklabs-io/ouroboros-mock v0.3.5 h1:/KWbSoH8Pjrd9uxOH7mVbI7XFsDCNW/O9FtLlvJDUpQ= github.com/blinklabs-io/ouroboros-mock v0.3.5/go.mod h1:JtUQ3Luo22hCnGBxuxNp6JaUx63VxidxWwmcaVMremw= github.com/blinklabs-io/tx-submit-api v0.20.1 h1:IdMqh12CSwPY44HqE9s8AbMlMZ+dhNAZSzXDReE+sSo= diff --git a/internal/utxorpc/query.go b/internal/utxorpc/query.go index 065311d..ee69dc0 100644 --- a/internal/utxorpc/query.go +++ b/internal/utxorpc/query.go @@ -24,6 +24,7 @@ import ( "github.com/blinklabs-io/gouroboros/ledger" // ocommon "github.com/blinklabs-io/gouroboros/protocol/common" + query "github.com/utxorpc/go-codegen/utxorpc/v1alpha/query" "github.com/utxorpc/go-codegen/utxorpc/v1alpha/query/queryconnect" @@ -68,18 +69,20 @@ func (s *queryServiceServer) ReadParams( if err != nil { return nil, err } - var acp query.AnyChainParams - // var acpc query.AnyChainParams_Cardano - acpc := &query.AnyChainParams_Cardano{} - log.Printf("protocol parameters: %v", protoParams) - // acpc.Cardano = protoParams.Utxorpc() + + // Set up response parameters + acpc := &query.AnyChainParams_Cardano{ + Cardano: protoParams.Utxorpc(), + } + resp.LedgerTip = &query.ChainPoint{ Slot: point.Slot, Hash: point.Hash, } - // acp.Params = &acpc - acp.Params = acpc - resp.Values = &acp + resp.Values = &query.AnyChainParams{ + Params: acpc, + } + return connect.NewResponse(resp), nil }