(t *testing.T)
| 3114 | }) |
| 3115 | } |
| 3116 | func TestHttpServer_IntegrationTests(t *testing.T) { |
| 3117 | t.Run("SuccessRequestWithNoParams", func(t *testing.T) { |
| 3118 | cfg := &common.Config{ |
| 3119 | Server: &common.ServerConfig{ |
| 3120 | MaxTimeout: common.Duration(5 * time.Second).Ptr(), |
| 3121 | }, |
| 3122 | Projects: []*common.ProjectConfig{ |
| 3123 | { |
| 3124 | Id: "test_project", |
| 3125 | CORS: &common.CORSConfig{ |
| 3126 | AllowedOrigins: []string{"https://erpc.cloud"}, |
| 3127 | AllowedMethods: []string{"POST"}, |
| 3128 | }, |
| 3129 | Networks: []*common.NetworkConfig{ |
| 3130 | { |
| 3131 | Architecture: common.ArchitectureEvm, |
| 3132 | Evm: &common.EvmNetworkConfig{ |
| 3133 | ChainId: 123, |
| 3134 | }, |
| 3135 | }, |
| 3136 | }, |
| 3137 | Upstreams: []*common.UpstreamConfig{ |
| 3138 | { |
| 3139 | Id: "rpc1", |
| 3140 | Type: common.UpstreamTypeEvm, |
| 3141 | Endpoint: "http://rpc1.localhost", |
| 3142 | Evm: &common.EvmUpstreamConfig{ |
| 3143 | ChainId: 123, |
| 3144 | }, |
| 3145 | }, |
| 3146 | }, |
| 3147 | }, |
| 3148 | }, |
| 3149 | RateLimiters: &common.RateLimiterConfig{}, |
| 3150 | } |
| 3151 | |
| 3152 | util.ResetGock() |
| 3153 | defer util.ResetGock() |
| 3154 | util.SetupMocksForEvmStatePoller() |
| 3155 | defer util.AssertNoPendingMocks(t, 0) |
| 3156 | |
| 3157 | gock.New("http://rpc1.localhost"). |
| 3158 | Post("/"). |
| 3159 | Filter(func(request *http.Request) bool { |
| 3160 | body := util.SafeReadBody(request) |
| 3161 | return strings.Contains(string(body), "trace_transaction") |
| 3162 | }). |
| 3163 | Reply(200). |
| 3164 | JSON(map[string]interface{}{ |
| 3165 | "jsonrpc": "2.0", |
| 3166 | "id": 111, |
| 3167 | "result": "0x1111111", |
| 3168 | }) |
| 3169 | |
| 3170 | sendRequest, _, _, shutdown, _ := createServerTestFixtures(cfg, t) |
| 3171 | defer shutdown() |
| 3172 | |
| 3173 | time.Sleep(3000 * time.Millisecond) |
nothing calls this directly
no test coverage detected