Skip to content

Commit

Permalink
Fix blockNumber propagation to eth_call
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Broadhurst <[email protected]>
  • Loading branch information
peterbroadhurst committed Feb 14, 2024
1 parent 1e7b7ae commit 26834f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkg/apitypes/query_request.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 Kaleido, Inc.
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -24,6 +24,7 @@ import (
type QueryRequest struct {
Headers RequestHeaders `json:"headers"`
ffcapi.TransactionInput
BlockNumber *string `json:"blockNumber,omitempty"`
}

// QueryResponse is the response payload for a query
Expand Down
4 changes: 2 additions & 2 deletions pkg/ffcapi/method_call.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 Kaleido, Inc.
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -28,7 +28,7 @@ import (
// detected by the back-end connector.
type QueryInvokeRequest struct {
TransactionInput
BlockNumber *fftypes.FFBigInt `json:"blockNumber,omitempty"`
BlockNumber *string `json:"blockNumber,omitempty"`
}

type QueryInvokeResponse struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/fftm/route__root_command.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 Kaleido, Inc.
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -101,6 +101,7 @@ var postRootCommand = func(m *manager) *ffapi.Route {
}
res, _, err := m.connector.QueryInvoke(r.Req.Context(), &ffcapi.QueryInvokeRequest{
TransactionInput: tReq.TransactionInput,
BlockNumber: tReq.BlockNumber,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 26834f1

Please sign in to comment.