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:
28
backend/auth/wallet_auth_test.go
Normal file
28
backend/auth/wallet_auth_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDecodeWalletSignatureRejectsMalformedValues(t *testing.T) {
|
||||
_, err := decodeWalletSignature("deadbeef")
|
||||
require.ErrorContains(t, err, "signature must start with 0x")
|
||||
|
||||
_, err = decodeWalletSignature("0x1234")
|
||||
require.ErrorContains(t, err, "invalid signature length")
|
||||
}
|
||||
|
||||
func TestValidateJWTReturnsClaimsWhenDBUnavailable(t *testing.T) {
|
||||
secret := []byte("test-secret")
|
||||
auth := NewWalletAuth(nil, secret)
|
||||
|
||||
token, _, err := auth.generateJWT("0x4A666F96fC8764181194447A7dFdb7d471b301C8", 4)
|
||||
require.NoError(t, err)
|
||||
|
||||
address, track, err := auth.ValidateJWT(token)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "0x4A666F96fC8764181194447A7dFdb7d471b301C8", address)
|
||||
require.Equal(t, 4, track)
|
||||
}
|
||||
Reference in New Issue
Block a user