Skip to content

Commit

Permalink
fix(ReadParams): return protocol parameter values (#287)
Browse files Browse the repository at this point in the history
Signed-off-by: Ales Verbic <[email protected]>
  • Loading branch information
verbotenj authored Nov 7, 2024
1 parent 8ac9e73 commit 518fd83
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
19 changes: 11 additions & 8 deletions internal/utxorpc/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 518fd83

Please sign in to comment.