Skip to content

Commit

Permalink
fixed added back old method and have new method
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Jun 5, 2023
1 parent d5f6417 commit c361b0f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 7 deletions.
65 changes: 60 additions & 5 deletions mocks/OverflowBetaClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion state.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ type OverflowClient interface {
// beta client with unstable features
type OverflowBetaClient interface {
OverflowClient
GetTransactionById(ctx context.Context, id flow.Identifier) (*OverflowTransaction, error)
GetTransactionById(ctx context.Context, id flow.Identifier) (*flow.Transaction, error)
GetOverflowTransactionById(ctx context.Context, id flow.Identifier) (*OverflowTransaction, error)
GetTransactions(ctx context.Context, id flow.Identifier) ([]OverflowTransaction, error)
StreamTransactions(ctx context.Context, poll time.Duration, height uint64, logger *zap.Logger, channel chan<- BlockResult) error
}
Expand Down
9 changes: 8 additions & 1 deletion transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,20 @@ func CreateOverflowTransactions(blockId string, transactionResult flow.Transacti

}

func (o *OverflowState) GetTransactionById(ctx context.Context, id flow.Identifier) (*OverflowTransaction, error) {
func (o *OverflowState) GetOverflowTransactionById(ctx context.Context, id flow.Identifier) (*OverflowTransaction, error) {
tx, txr, err := o.Flowkit.GetTransactionByID(ctx, id, false)
if err != nil {
return nil, err
}
return CreateOverflowTransactions(txr.BlockID.String(), *txr, *tx)
}
func (o *OverflowState) GetTransactionById(ctx context.Context, id flow.Identifier) (*flow.Transaction, error) {
tx, _, err := o.Flowkit.GetTransactionByID(ctx, id, false)
if err != nil {
return nil, err
}
return tx, nil
}

func (o *OverflowState) GetTransactions(ctx context.Context, id flow.Identifier) ([]OverflowTransaction, error) {

Expand Down

0 comments on commit c361b0f

Please sign in to comment.