Skip to content

Commit

Permalink
Merge pull request #1347 from onflow/implement-get-tx-and-result-by-b…
Browse files Browse the repository at this point in the history
…lockid

add support for getting transactions and results from emulator by block id
  • Loading branch information
chasefleming authored Jan 17, 2024
2 parents 4c2ef95 + df76dbd commit 7591b68
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions flowkit/gateway/emulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,20 @@ func (g *EmulatorGateway) GetTransaction(id flow.Identifier) (*flow.Transaction,
return transaction, nil
}

func (g *EmulatorGateway) GetTransactionResultsByBlockID(_ flow.Identifier) ([]*flow.TransactionResult, error) {
// TODO: implement
panic("GetTransactionResultsByBlockID not implemented")
func (g *EmulatorGateway) GetTransactionResultsByBlockID(id flow.Identifier) ([]*flow.TransactionResult, error) {
txr, err := g.adapter.GetTransactionResultsByBlockID(g.ctx, id)
if err != nil {
return nil, UnwrapStatusError(err)
}
return txr, nil
}

func (g *EmulatorGateway) GetTransactionsByBlockID(_ flow.Identifier) ([]*flow.Transaction, error) {
// TODO: implement
panic("GetTransactionResultsByBlockID not implemented")
func (g *EmulatorGateway) GetTransactionsByBlockID(id flow.Identifier) ([]*flow.Transaction, error) {
txr, err := g.adapter.GetTransactionsByBlockID(g.ctx, id)
if err != nil {
return nil, UnwrapStatusError(err)
}
return txr, nil
}

func (g *EmulatorGateway) Ping() error {
Expand Down

0 comments on commit 7591b68

Please sign in to comment.