diff --git a/emulator/blocks.go b/emulator/blocks.go index 340545bd..58783f79 100644 --- a/emulator/blocks.go +++ b/emulator/blocks.go @@ -74,6 +74,15 @@ func (b *blocks) SealedHeader() (*flowgo.Header, error) { return block.Header, nil } +func (b *blocks) IndexedHeight() (uint64, error) { + block, err := b.blockchain.storage.LatestBlock(context.Background()) + if err != nil { + return 0, err + } + + return block.Header.Height, nil +} + // We don't have to do anything complex here, as emulator does not fork the chain func (b *blocks) ByHeightFrom(height uint64, header *flowgo.Header) (*flowgo.Header, error) { if height > header.Height { diff --git a/go.mod b/go.mod index 698eaf50..fabbad8f 100644 --- a/go.mod +++ b/go.mod @@ -236,3 +236,5 @@ require ( nhooyr.io/websocket v1.8.7 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) + +replace github.com/onflow/flow-go v0.37.10 => github.com/AndriiDiachuk/flow-go v0.34.0-crescendo-preview.15-atree-inlining.0.20240912140753-a57bf2226f4c diff --git a/go.sum b/go.sum index ddc47008..18543d96 100644 --- a/go.sum +++ b/go.sum @@ -932,6 +932,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/AndriiDiachuk/flow-go v0.34.0-crescendo-preview.15-atree-inlining.0.20240912140753-a57bf2226f4c h1:OlkAHZAEetZgEGZUI9erMKOSaKgviWY3hXNTDoeuN8M= +github.com/AndriiDiachuk/flow-go v0.34.0-crescendo-preview.15-atree-inlining.0.20240912140753-a57bf2226f4c/go.mod h1:Gdqw1ptnAUuB0izif88PWMK8abe655Hr8iEkXXuUJl4= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=