Skip to content

Commit 9f1dc3b

Browse files
authored
Merge branch 'master' into remoteRollbackAndSnap
2 parents 21be1f7 + 5218938 commit 9f1dc3b

File tree

7 files changed

+215
-173
lines changed

7 files changed

+215
-173
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
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.18.x'
23+
go-version: '1.19.x'
2424
- uses: actions/cache@v3
2525
with:
2626
path: ~/go/pkg/mod
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v3
4242
- uses: actions/setup-go@v4
4343
with:
44-
go-version: '1.18.x'
44+
go-version: '1.19.x'
4545
- name: Run golangci-lint
4646
uses: golangci/golangci-lint-action@v3
4747
with:

emulator/blockchain.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,3 +1641,12 @@ func (b *Blockchain) GetTransactionResultsByBlockID(blockID flowgo.Identifier) (
16411641
}
16421642
return results, nil
16431643
}
1644+
1645+
func (b *Blockchain) GetLogs(identifier flowgo.Identifier) ([]string, error) {
1646+
txResult, err := b.storage.TransactionResultByID(context.Background(), identifier)
1647+
if err != nil {
1648+
return nil, err
1649+
1650+
}
1651+
return txResult.Logs, nil
1652+
}

emulator/emulator.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ type ExecutionCapable interface {
162162
CommitBlock() (*flowgo.Block, error)
163163
}
164164

165+
type LogProvider interface {
166+
GetLogs(flowgo.Identifier) ([]string, error)
167+
}
168+
165169
// Emulator defines the method set of an emulated emulator.
166170
type Emulator interface {
167171
ServiceKey() ServiceKey
@@ -174,4 +178,5 @@ type Emulator interface {
174178
RollbackCapable
175179
AutoMineCapable
176180
ExecutionCapable
181+
LogProvider
177182
}

emulator/mocks/emulator.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
module github.com/onflow/flow-emulator
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c
77
github.com/glebarez/go-sqlite v1.21.1
88
github.com/go-redis/redis/v8 v8.11.5
99
github.com/golang/mock v1.6.0
10-
github.com/google/go-dap v0.9.1
10+
github.com/google/go-dap v0.10.0
1111
github.com/gorilla/mux v1.8.0
1212
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
1313
github.com/hashicorp/go-multierror v1.1.1
1414
github.com/improbable-eng/grpc-web v0.15.0
1515
github.com/logrusorgru/aurora v2.0.3+incompatible
16-
github.com/onflow/cadence v0.39.12
16+
github.com/onflow/cadence v0.39.14
1717
github.com/onflow/flow-archive v1.3.4-0.20230503192214-9e81e82d4dcc
18-
github.com/onflow/flow-go v0.31.1-0.20230622201809-5001508cc224
19-
github.com/onflow/flow-go-sdk v0.41.6
18+
github.com/onflow/flow-go v0.31.1-0.20230712191318-82d6e5f45ca1
19+
github.com/onflow/flow-go-sdk v0.41.9
2020
github.com/onflow/flow-go/crypto v0.24.7
2121
github.com/onflow/flow-nft/lib/go/contracts v1.1.0
2222
github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20230602212908-08fc6536d391
@@ -29,41 +29,41 @@ require (
2929
github.com/slok/go-http-metrics v0.10.0
3030
github.com/spf13/cobra v1.7.0
3131
github.com/stretchr/testify v1.8.4
32-
golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15
33-
google.golang.org/grpc v1.53.0
32+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
33+
google.golang.org/grpc v1.56.1
3434
)
3535

3636
require (
3737
github.com/beorn7/perks v1.0.1 // indirect
3838
github.com/bits-and-blooms/bitset v1.5.0 // indirect
3939
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
40-
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
40+
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
4141
github.com/cespare/xxhash v1.1.0 // indirect
4242
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4343
github.com/coreos/go-semver v0.3.0 // indirect
4444
github.com/davecgh/go-spew v1.1.1 // indirect
45-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
45+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
4646
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
4747
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
4848
github.com/dgraph-io/ristretto v0.1.0 // indirect
4949
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
5050
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
5151
github.com/dustin/go-humanize v1.0.1 // indirect
5252
github.com/ef-ds/deque v1.0.4 // indirect
53-
github.com/envoyproxy/protoc-gen-validate v0.9.1 // indirect
53+
github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect
5454
github.com/ethereum/go-ethereum v1.9.13 // indirect
5555
github.com/fsnotify/fsnotify v1.6.0 // indirect
5656
github.com/fxamacker/circlehash v0.3.0 // indirect
5757
github.com/gammazero/deque v0.1.0 // indirect
5858
github.com/go-kit/kit v0.12.0 // indirect
5959
github.com/go-kit/log v0.2.1 // indirect
6060
github.com/go-logfmt/logfmt v0.5.1 // indirect
61-
github.com/go-logr/logr v1.2.3 // indirect
61+
github.com/go-logr/logr v1.2.4 // indirect
6262
github.com/go-logr/stdr v1.2.2 // indirect
6363
github.com/go-test/deep v1.1.0 // indirect
6464
github.com/gogo/protobuf v1.3.2 // indirect
65-
github.com/golang/glog v1.0.0 // indirect
66-
github.com/golang/protobuf v1.5.2 // indirect
65+
github.com/golang/glog v1.1.0 // indirect
66+
github.com/golang/protobuf v1.5.3 // indirect
6767
github.com/golang/snappy v0.0.4 // indirect
6868
github.com/google/uuid v1.3.0 // indirect
6969
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
@@ -72,40 +72,39 @@ require (
7272
github.com/hashicorp/hcl v1.0.0 // indirect
7373
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7474
github.com/ipfs/bbloom v0.0.4 // indirect
75-
github.com/ipfs/go-block-format v0.0.3 // indirect
76-
github.com/ipfs/go-cid v0.3.2 // indirect
75+
github.com/ipfs/go-block-format v0.1.2 // indirect
76+
github.com/ipfs/go-cid v0.4.1 // indirect
7777
github.com/ipfs/go-datastore v0.6.0 // indirect
78-
github.com/ipfs/go-ipfs-blockstore v1.2.0 // indirect
78+
github.com/ipfs/go-ipfs-blockstore v1.3.0 // indirect
7979
github.com/ipfs/go-ipfs-ds-help v1.1.0 // indirect
8080
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
81-
github.com/ipfs/go-ipld-format v0.3.0 // indirect
81+
github.com/ipfs/go-ipld-format v0.5.0 // indirect
8282
github.com/ipfs/go-log v1.0.5 // indirect
8383
github.com/ipfs/go-log/v2 v2.5.1 // indirect
8484
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
8585
github.com/jbenet/goprocess v0.1.4 // indirect
8686
github.com/kevinburke/go-bindata v3.23.0+incompatible // indirect
87-
github.com/klauspost/compress v1.15.15 // indirect
88-
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
87+
github.com/klauspost/compress v1.16.5 // indirect
88+
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
8989
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
90-
github.com/libp2p/go-libp2p v0.24.2 // indirect
91-
github.com/libp2p/go-openssl v0.1.0 // indirect
90+
github.com/libp2p/go-libp2p v0.28.1 // indirect
9291
github.com/logrusorgru/aurora/v4 v4.0.0 // indirect
9392
github.com/magiconair/properties v1.8.7 // indirect
9493
github.com/mattn/go-colorable v0.1.13 // indirect
95-
github.com/mattn/go-isatty v0.0.18 // indirect
96-
github.com/mattn/go-pointer v0.0.1 // indirect
94+
github.com/mattn/go-isatty v0.0.19 // indirect
9795
github.com/mattn/go-runewidth v0.0.14 // indirect
9896
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
99-
github.com/minio/sha256-simd v1.0.0 // indirect
97+
github.com/minio/sha256-simd v1.0.1 // indirect
10098
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
10199
github.com/mitchellh/mapstructure v1.5.0 // indirect
102100
github.com/mr-tron/base58 v1.2.0 // indirect
103101
github.com/multiformats/go-base32 v0.1.0 // indirect
104102
github.com/multiformats/go-base36 v0.2.0 // indirect
105-
github.com/multiformats/go-multiaddr v0.8.0 // indirect
106-
github.com/multiformats/go-multibase v0.1.1 // indirect
107-
github.com/multiformats/go-multicodec v0.7.0 // indirect
108-
github.com/multiformats/go-multihash v0.2.1 // indirect
103+
github.com/multiformats/go-multiaddr v0.9.0 // indirect
104+
github.com/multiformats/go-multibase v0.2.0 // indirect
105+
github.com/multiformats/go-multicodec v0.9.0 // indirect
106+
github.com/multiformats/go-multihash v0.2.3 // indirect
107+
github.com/multiformats/go-multistream v0.4.1 // indirect
109108
github.com/multiformats/go-varint v0.0.7 // indirect
110109
github.com/onflow/atree v0.6.0 // indirect
111110
github.com/onflow/flow-core-contracts/lib/go/contracts v1.2.3 // indirect
@@ -119,15 +118,14 @@ require (
119118
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
120119
github.com/pkg/errors v0.9.1 // indirect
121120
github.com/pmezard/go-difflib v1.0.0 // indirect
122-
github.com/prometheus/client_model v0.3.0 // indirect
123-
github.com/prometheus/common v0.39.0 // indirect
121+
github.com/prometheus/client_model v0.4.0 // indirect
122+
github.com/prometheus/common v0.42.0 // indirect
124123
github.com/prometheus/procfs v0.9.0 // indirect
125124
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
126125
github.com/rivo/uniseg v0.4.4 // indirect
127126
github.com/rs/cors v1.8.0 // indirect
128127
github.com/schollz/progressbar/v3 v3.13.1 // indirect
129128
github.com/sethvargo/go-retry v0.2.3 // indirect
130-
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
131129
github.com/spaolacci/murmur3 v1.1.0 // indirect
132130
github.com/spf13/afero v1.9.3 // indirect
133131
github.com/spf13/cast v1.5.0 // indirect
@@ -143,32 +141,33 @@ require (
143141
github.com/vmihailenco/tagparser v0.1.1 // indirect
144142
github.com/x448/float16 v0.8.4 // indirect
145143
github.com/zeebo/blake3 v0.2.3 // indirect
146-
go.opentelemetry.io/otel v1.14.0 // indirect
147-
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
148-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
144+
go.opentelemetry.io/otel v1.16.0 // indirect
145+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
146+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect
149147
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 // indirect
150-
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
151-
go.opentelemetry.io/otel/trace v1.14.0 // indirect
148+
go.opentelemetry.io/otel/metric v1.16.0 // indirect
149+
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
150+
go.opentelemetry.io/otel/trace v1.16.0 // indirect
152151
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
153-
go.uber.org/atomic v1.10.0 // indirect
154-
go.uber.org/multierr v1.9.0 // indirect
152+
go.uber.org/atomic v1.11.0 // indirect
153+
go.uber.org/multierr v1.11.0 // indirect
155154
go.uber.org/zap v1.24.0 // indirect
156-
golang.org/x/crypto v0.7.0 // indirect
157-
golang.org/x/net v0.8.0 // indirect
158-
golang.org/x/sync v0.1.0 // indirect
159-
golang.org/x/sys v0.6.0 // indirect
160-
golang.org/x/term v0.6.0 // indirect
161-
golang.org/x/text v0.8.0 // indirect
155+
golang.org/x/crypto v0.10.0 // indirect
156+
golang.org/x/net v0.10.0 // indirect
157+
golang.org/x/sync v0.2.0 // indirect
158+
golang.org/x/sys v0.9.0 // indirect
159+
golang.org/x/term v0.9.0 // indirect
160+
golang.org/x/text v0.10.0 // indirect
162161
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
163162
google.golang.org/appengine v1.6.7 // indirect
164-
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
163+
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
165164
google.golang.org/protobuf v1.30.0 // indirect
166165
gopkg.in/ini.v1 v1.67.0 // indirect
167166
gopkg.in/yaml.v3 v3.0.1 // indirect
168-
lukechampine.com/blake3 v1.1.7 // indirect
167+
lukechampine.com/blake3 v1.2.1 // indirect
169168
modernc.org/libc v1.22.3 // indirect
170169
modernc.org/mathutil v1.5.0 // indirect
171170
modernc.org/memory v1.5.0 // indirect
172171
modernc.org/sqlite v1.21.1 // indirect
173-
nhooyr.io/websocket v1.8.6 // indirect
172+
nhooyr.io/websocket v1.8.7 // indirect
174173
)

0 commit comments

Comments
 (0)