Skip to content

Commit 7adb012

Browse files
authored
Merge pull request #518 from onflow/petera/access-api-updates
2 parents c6e4e15 + 78514ea commit 7adb012

File tree

8 files changed

+43
-13
lines changed

8 files changed

+43
-13
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fetch-depth: 0
2121
- uses: actions/setup-go@v4
2222
with:
23-
go-version: '1.19.x'
23+
go-version: '1.20.x'
2424
- uses: actions/cache@v3
2525
with:
2626
path: ~/go/pkg/mod
@@ -41,12 +41,12 @@ jobs:
4141
- uses: actions/checkout@v4
4242
- uses: actions/setup-go@v4
4343
with:
44-
go-version: '1.19.x'
44+
go-version: '1.20.x'
4545
- name: Run golangci-lint
4646
uses: golangci/golangci-lint-action@v3
4747
with:
4848
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
49-
version: v1.50
49+
version: v1.54
5050
args: --timeout=10m
5151

5252
docker:

.github/workflows/nightly-builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
- cron: "0 0 * * *"
55

66
env:
7-
GO_VERSION: '1.19.2'
7+
GO_VERSION: '1.20.11'
88

99
jobs:
1010
build:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ci: install-tools test check-tidy test coverage check-headers
5252

5353
.PHONY: install-linter
5454
install-linter:
55-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.46.0
55+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.54.2
5656

5757
.PHONY: lint
5858
lint:

adapters/access.go

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package adapters
2121
import (
2222
"context"
2323
"fmt"
24+
2425
"github.com/onflow/flow/protobuf/go/flow/entities"
2526

2627
jsoncdc "github.com/onflow/cadence/encoding/json"
@@ -393,6 +394,14 @@ func (a *AccessAdapter) GetLatestProtocolStateSnapshot(_ context.Context) ([]byt
393394
return nil, nil
394395
}
395396

397+
func (a *AccessAdapter) GetProtocolStateSnapshotByBlockID(_ context.Context, _ flowgo.Identifier) ([]byte, error) {
398+
return nil, nil
399+
}
400+
401+
func (a *AccessAdapter) GetProtocolStateSnapshotByHeight(_ context.Context, _ uint64) ([]byte, error) {
402+
return nil, nil
403+
}
404+
396405
func (a *AccessAdapter) GetExecutionResultForBlockID(_ context.Context, _ flowgo.Identifier) (*flowgo.ExecutionResult, error) {
397406
return nil, nil
398407
}

adapters/sdk.go

+18
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ import (
2828
emulator "github.com/onflow/flow-emulator/emulator"
2929
sdk "github.com/onflow/flow-go-sdk"
3030
"github.com/onflow/flow-go-sdk/templates"
31+
"github.com/onflow/flow-go/access"
3132
flowgo "github.com/onflow/flow-go/model/flow"
33+
"github.com/onflow/flow/protobuf/go/flow/entities"
3234
"github.com/rs/zerolog"
3335
"google.golang.org/grpc/codes"
3436
"google.golang.org/grpc/status"
@@ -353,10 +355,26 @@ func (b *SDKAdapter) GetLatestProtocolStateSnapshot(_ context.Context) ([]byte,
353355
return nil, nil
354356
}
355357

358+
func (a *SDKAdapter) GetProtocolStateSnapshotByBlockID(_ context.Context, _ flowgo.Identifier) ([]byte, error) {
359+
return nil, nil
360+
}
361+
362+
func (a *SDKAdapter) GetProtocolStateSnapshotByHeight(_ context.Context, _ uint64) ([]byte, error) {
363+
return nil, nil
364+
}
365+
356366
func (b *SDKAdapter) GetExecutionResultForBlockID(_ context.Context, _ sdk.Identifier) (*sdk.ExecutionResult, error) {
357367
return nil, nil
358368
}
359369

370+
func (b *SDKAdapter) GetSystemTransaction(_ context.Context, _ flowgo.Identifier) (*flowgo.TransactionBody, error) {
371+
return nil, nil
372+
}
373+
374+
func (b *SDKAdapter) GetSystemTransactionResult(_ context.Context, _ flowgo.Identifier, _ entities.EventEncodingVersion) (*access.TransactionResult, error) {
375+
return nil, nil
376+
}
377+
360378
func (b *SDKAdapter) GetTransactionsByBlockID(ctx context.Context, id sdk.Identifier) ([]*sdk.Transaction, error) {
361379
result := []*sdk.Transaction{}
362380
transactions, err := b.emulator.GetTransactionsByBlockID(convert.SDKIdentifierToFlow(id))

go.mod

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/onflow/flow-emulator
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
@@ -16,7 +16,7 @@ require (
1616
github.com/onflow/cadence v0.42.5
1717
github.com/onflow/flow-archive v1.3.4-0.20230503192214-9e81e82d4dcc
1818
github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f
19-
github.com/onflow/flow-go v0.32.4-0.20231115172515-c1ec969fd6f2
19+
github.com/onflow/flow-go v0.32.4-0.20231128161804-783804dbd577
2020
github.com/onflow/flow-go-sdk v0.41.16
2121
github.com/onflow/flow-go/crypto v0.24.9
2222
github.com/onflow/flow-nft/lib/go/contracts v1.1.0
@@ -204,6 +204,3 @@ require (
204204
modernc.org/sqlite v1.21.1 // indirect
205205
nhooyr.io/websocket v1.8.7 // indirect
206206
)
207-
208-
//TODO: Remove when merged
209-
replace github.com/onflow/flow-go v0.32.4-0.20231115172515-c1ec969fd6f2 => github.com/AndriiDiachuk/flow-go v0.0.0-20231127171138-fbe6207ef346

go.sum

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
5353
cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM=
5454
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
5555
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
56-
github.com/AndriiDiachuk/flow-go v0.0.0-20231127171138-fbe6207ef346 h1:iCl9UFMgllPsW5Nz7bXfER2K+bokdqUMV6jJIbSqwZI=
57-
github.com/AndriiDiachuk/flow-go v0.0.0-20231127171138-fbe6207ef346/go.mod h1:YJDAoDjbY4OWBj44XV+Qe+dIwn+hlywUDL5xclOOLbw=
5856
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
5957
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
6058
github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
@@ -284,6 +282,7 @@ github.com/fxamacker/circlehash v0.3.0/go.mod h1:3aq3OfVvsWtkWMb6A1owjOQFA+TLsD5
284282
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
285283
github.com/gammazero/deque v0.1.0 h1:f9LnNmq66VDeuAlSAapemq/U7hJ2jpIWa4c09q8Dlik=
286284
github.com/gammazero/deque v0.1.0/go.mod h1:KQw7vFau1hHuM8xmI9RbgKFbAsQFWmBpqQ2KenFLk6M=
285+
github.com/gammazero/workerpool v1.1.2 h1:vuioDQbgrz4HoaCi2q1HLlOXdpbap5AET7xu5/qj87g=
287286
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
288287
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
289288
github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c=
@@ -809,6 +808,8 @@ github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a
809808
github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f/go.mod h1:ZeLxwaBkzuSInESGjL8/IPZWezF+YOYsYbMrZlhN+q4=
810809
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13 h1:B4ll7e3j+MqTJv2122Enq3RtDNzmIGRu9xjV7fo7un0=
811810
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13/go.mod h1:kTMFIySzEJJeupk+7EmXs0EJ6CBWY/MV9fv9iYQk+RU=
811+
github.com/onflow/flow-go v0.32.4-0.20231128161804-783804dbd577 h1:gMwpZp72fF/hhgL3vdGakN6GqUbC4HJBAegLLQbt3F4=
812+
github.com/onflow/flow-go v0.32.4-0.20231128161804-783804dbd577/go.mod h1:YJDAoDjbY4OWBj44XV+Qe+dIwn+hlywUDL5xclOOLbw=
812813
github.com/onflow/flow-go-sdk v0.24.0/go.mod h1:IoptMLPyFXWvyd9yYA6/4EmSeeozl6nJoIv4FaEMg74=
813814
github.com/onflow/flow-go-sdk v0.41.16 h1:HsmHwEVmj+iK+GszHbFseHh7Ii5W3PWOIRNAH/En08Q=
814815
github.com/onflow/flow-go-sdk v0.41.16/go.mod h1:bVrVNoJKiwB6vW5Qbm5tFAfJBQ5we4uSQWnn9gNAFhQ=

server/access/streamBackend.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import (
2222
"context"
2323
"errors"
2424
"fmt"
25+
"time"
26+
2527
"github.com/onflow/flow-emulator/emulator"
2628
"github.com/onflow/flow-emulator/types"
2729
"github.com/onflow/flow-go/engine/access/state_stream"
@@ -35,7 +37,6 @@ import (
3537
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
3638
"github.com/onflow/flow-go/utils/logging"
3739
"github.com/rs/zerolog"
38-
"time"
3940
)
4041

4142
type StateStreamBackend struct {
@@ -247,3 +248,7 @@ func (b StateStreamBackend) getResponseFactory(filter state_stream.EventFilter)
247248
}, nil
248249
}
249250
}
251+
252+
func (b StateStreamBackend) GetRegisterValues(registerIDs flow.RegisterIDs, height uint64) ([]flow.RegisterValue, error) {
253+
return nil, status.Errorf(codes.Unimplemented, "not implemented")
254+
}

0 commit comments

Comments
 (0)