Skip to content

Commit

Permalink
use common.AddressLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kc1116 committed May 15, 2024
1 parent 32bea82 commit 5edced7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/go/test/epoch_test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/onflow/cadence"
jsoncdc "github.com/onflow/cadence/encoding/json"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/flow-core-contracts/lib/go/contracts"
"github.com/onflow/flow-core-contracts/lib/go/templates"
Expand Down Expand Up @@ -794,15 +795,17 @@ func verifyEpochRecover(
epochAddress flow.Address,
expectedRecover EpochRecover) {
var emittedEvent EpochRecoverEvent
evtTypeStr := fmt.Sprintf("A.%s.FlowEpoch.EpochRecover", epochAddress.String())
addrLocation := common.NewAddressLocation(nil, common.Address(epochAddress), "FlowEpoch")
evtTypeID := string(addrLocation.TypeID(nil, "FlowEpoch.EpochRecover"))
var i uint64
i = 0
for i < 1000 {
results, _ := adapter.GetEventsForHeightRange(context.Background(), evtTypeStr, i, i)
results, _ := adapter.GetEventsForHeightRange(context.Background(), evtTypeID, i, i)

for _, result := range results {
for _, event := range result.Events {
if event.Type == evtTypeStr {

if event.Type == evtTypeID {
emittedEvent = EpochRecoverEvent(event)
}
}
Expand Down

0 comments on commit 5edced7

Please sign in to comment.