feat: explorer API, wallet, CCIP scripts, and config refresh
- Backend REST/gateway/track routes, analytics, Blockscout proxy paths. - Frontend wallet and liquidity surfaces; MetaMask token list alignment. - Deployment docs, verification scripts, address inventory updates. Check: go build ./... under backend/ (pass). Made-with: Cursor
This commit is contained in:
43
backend/api/track1/endpoints_validation_test.go
Normal file
43
backend/api/track1/endpoints_validation_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package track1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHandleBlockDetailRejectsInvalidBlockNumber(t *testing.T) {
|
||||
server := &Server{}
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/track1/block/not-a-number", nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
server.HandleBlockDetail(w, req)
|
||||
|
||||
if w.Code != http.StatusBadRequest {
|
||||
t.Fatalf("expected 400 for invalid block number, got %d", w.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleTransactionDetailRejectsInvalidHash(t *testing.T) {
|
||||
server := &Server{}
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/track1/tx/not-a-hash", nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
server.HandleTransactionDetail(w, req)
|
||||
|
||||
if w.Code != http.StatusBadRequest {
|
||||
t.Fatalf("expected 400 for invalid tx hash, got %d", w.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleAddressBalanceRejectsInvalidAddress(t *testing.T) {
|
||||
server := &Server{}
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/track1/address/not-an-address/balance", nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
server.HandleAddressBalance(w, req)
|
||||
|
||||
if w.Code != http.StatusBadRequest {
|
||||
t.Fatalf("expected 400 for invalid address, got %d", w.Code)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user