diff --git a/.gitignore b/.gitignore index 5425ff919c..ebd0ef239b 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,3 @@ index.html # test summary testresults.json - -# Received approval test files -*.received.* diff --git a/daemon/algod/api/server/v2/test/handlers_test.go b/daemon/algod/api/server/v2/test/handlers_test.go index 4c604e936a..61071148ff 100644 --- a/daemon/algod/api/server/v2/test/handlers_test.go +++ b/daemon/algod/api/server/v2/test/handlers_test.go @@ -22,8 +22,6 @@ import ( "encoding/json" "errors" "fmt" - approvals "github.com/approvals/go-approval-tests" - "github.com/approvals/go-approval-tests/reporters" "io" "net/http" "net/http/httptest" @@ -157,46 +155,6 @@ func TestGetRoundStateDelta(t *testing.T) { require.Equal(t, poolDeltaResponseGolden.Totals, actualResponse.Totals) } -type AssertableHTTPResponse struct { - Status string `json:"status"` - StatusCode int `json:"statusCode"` - Headers http.Header `json:"headers"` - Body interface{} `json:"body"` -} - -func TestGetRoundStateDeltaApproval(t *testing.T) { - partitiontest.PartitionTest(t) - t.Parallel() - a := require.New(t) - - handler, c, rec, _, _, releasefunc := setupTestForMethodGet(t) - defer releasefunc() - insertRounds(a, handler, 3) - - err := handler.GetRoundStateDelta(c, 2) - require.NoError(t, err) - - actualResponse := model.RoundStateDelta{} - err = protocol.DecodeJSON(rec.Body.Bytes(), &actualResponse) - - // Blot out non-deterministic PrevTimestamp - require.NotZero(t, actualResponse.PrevTimestamp) - z := uint64(0) - actualResponse.PrevTimestamp = &z - - res := rec.Result() - resp := AssertableHTTPResponse{ - res.Status, - res.StatusCode, - res.Header, - actualResponse, - } - - approvals.UseFolder("testdata") - approvals.UseReporter(reporters.NewRealDiffReporter()) - approvals.VerifyJSONBytes(t, protocol.EncodeJSON(resp)) -} - func TestSyncRound(t *testing.T) { partitiontest.PartitionTest(t) t.Parallel() diff --git a/daemon/algod/api/server/v2/test/testdata/handlers_test.TestGetRoundStateDeltaApproval.approved.json b/daemon/algod/api/server/v2/test/testdata/handlers_test.TestGetRoundStateDeltaApproval.approved.json deleted file mode 100644 index db1de7be6e..0000000000 --- a/daemon/algod/api/server/v2/test/testdata/handlers_test.TestGetRoundStateDeltaApproval.approved.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "body": { - "accts": { - "accounts": [ - { - "account-data": { - "address": "7777777777777777777777777777777777777777777777777774MSJUVU", - "amount": 50000000000, - "amount-without-pending-rewards": 50000000000, - "min-balance": 100000, - "pending-rewards": 0, - "rewards": 0, - "round": 2, - "status": "Not Participating", - "total-apps-opted-in": 0, - "total-assets-opted-in": 0, - "total-created-apps": 0, - "total-created-assets": 0 - }, - "address": "7777777777777777777777777777777777777777777777777774MSJUVU" - } - ] - }, - "totals": { - "not-participating": 100000000000, - "offline": 0, - "online": 658511, - "rewards-level": 0 - }, - "tx-ids": [ - { - "intra": 0, - "lastValid": 0, - "txId": "Z7ATVET4TI3UG32H2PYJQPREPYOQHAH376E25M3KB57OEW66YMPA" - } - ] - }, - "headers": { - "Content-Type": [ - "application/json; charset=UTF-8" - ] - }, - "status": "200 OK", - "statusCode": 200 -} \ No newline at end of file diff --git a/go.mod b/go.mod index be25fbe36b..8be3f87c30 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,6 @@ require ( github.com/algorand/msgp v1.1.53 github.com/algorand/oapi-codegen v1.12.0-algorand.0 github.com/algorand/websocket v1.4.5 - github.com/approvals/go-approval-tests v0.0.0-20220530063708-32d5677069bd github.com/aws/aws-sdk-go v1.16.5 github.com/consensys/gnark-crypto v0.7.0 github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018 diff --git a/go.sum b/go.sum index 8f95c2451d..482b393719 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,6 @@ github.com/algorand/websocket v1.4.5 h1:Cs6UTaCReAl02evYxmN8k57cNHmBILRcspfSxYg4 github.com/algorand/websocket v1.4.5/go.mod h1:79n6FSZY08yQagHzE/YWZqTPBYfY5wc3IS+UTZe1W5c= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= -github.com/approvals/go-approval-tests v0.0.0-20220530063708-32d5677069bd h1:8j7sBEy0h6+Bvr0AeKHIHCsmzCzWGXAQweA7k+uiRYk= -github.com/approvals/go-approval-tests v0.0.0-20220530063708-32d5677069bd/go.mod h1:PJOqSY8IofNv3heAD6k8E7EfFS6okiSS9bSAasaAUME= github.com/aws/aws-sdk-go v1.16.5 h1:NVxzZXIuwX828VcJrpNxxWjur1tlOBISdMdDdHIKHcc= github.com/aws/aws-sdk-go v1.16.5/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=