From 9168b3808950edc71cb2c3b8ae9ffb4c076ecb1e Mon Sep 17 00:00:00 2001 From: Will Winder Date: Fri, 15 Sep 2023 14:59:15 -0400 Subject: [PATCH] Add new unit test. --- test/algodclientv2_test.go | 10 ++++++++++ test/responses_unit_test.go | 3 +++ test/unit.tags | 2 ++ 3 files changed, 15 insertions(+) diff --git a/test/algodclientv2_test.go b/test/algodclientv2_test.go index 910d935a..21b26eab 100644 --- a/test/algodclientv2_test.go +++ b/test/algodclientv2_test.go @@ -64,6 +64,7 @@ func AlgodClientV2Context(s *godog.Suite) { s.Step(`^we make a GetLedgerStateDelta call against round (\d+)$`, weMakeAGetLedgerStateDeltaCallAgainstRound) s.Step(`^we make a LedgerStateDeltaForTransactionGroupResponse call for ID "([^"]*)"$`, weMakeALedgerStateDeltaForTransactionGroupResponseCallForID) s.Step(`^we make a TransactionGroupLedgerStateDeltaForRoundResponse call for round (\d+)$`, weMakeATransactionGroupLedgerStateDeltaForRoundResponseCallForRound) + s.Step(`^we make a GetBlockTxids call against block number (\d+)$`, weMakeAGetBlockTxidsCallAgainstBlockNumber) s.BeforeScenario(func(interface{}) { globalErrForExamination = nil @@ -394,3 +395,12 @@ func weMakeATransactionGroupLedgerStateDeltaForRoundResponseCallForRound(round i algodClient.GetTransactionGroupLedgerStateDeltasForRound(uint64(round)).Do(context.Background()) return nil } + +func weMakeAGetBlockTxidsCallAgainstBlockNumber(round int) error { + algodClient, err := algod.MakeClient(mockServer.URL, "") + if err != nil { + return err + } + algodClient.GetBlockTxids(uint64(round)).Do(context.Background()) + return nil +} diff --git a/test/responses_unit_test.go b/test/responses_unit_test.go index 0d838f5b..ad299696 100644 --- a/test/responses_unit_test.go +++ b/test/responses_unit_test.go @@ -193,6 +193,9 @@ func weMakeAnyCallTo(client /* algod/indexer */, endpoint string) (err error) { case "GetLedgerStateDeltaForTransactionGroup": response, err = algodC.GetLedgerStateDeltaForTransactionGroup("someID").Do(context.Background()) + case "GetBlockTxids": + response, err = + algodC.GetBlockTxids(123).Do(context.Background()) case "any": // This is an error case // pickup the error as the response diff --git a/test/unit.tags b/test/unit.tags index 6b27ad93..29d3b813 100644 --- a/test/unit.tags +++ b/test/unit.tags @@ -6,6 +6,7 @@ @unit.applications.boxes @unit.atomic_transaction_composer @unit.blocksummary +@unit.blocktxids @unit.dryrun @unit.dryrun.trace.application @unit.feetest @@ -26,6 +27,7 @@ @unit.responses.participationupdates @unit.responses.sync @unit.responses.timestamp +@unit.responses.txid.json @unit.responses.unlimited_assets @unit.sourcemap @unit.statedelta