From df76dbdb43d747f4a8abd3bb556b7e8dd6544d1f Mon Sep 17 00:00:00 2001 From: Bjarte Stien Karlsen Date: Tue, 16 Jan 2024 23:45:28 +0100 Subject: [PATCH] implement from adapter --- flowkit/gateway/emulator.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/flowkit/gateway/emulator.go b/flowkit/gateway/emulator.go index 31aea3c75..7e6b0bbe1 100644 --- a/flowkit/gateway/emulator.go +++ b/flowkit/gateway/emulator.go @@ -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 {