You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: verify_signature_test.go
+8-13Lines changed: 8 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,6 @@ import (
10
10
11
11
funcTestVerifySignature(t*testing.T) {
12
12
// Common test regexp and duration
13
-
authRegexp:=regexp.MustCompile(`Click sign to add favorite tokens at Kyberswap.com without logging in.
14
-
This request won’t trigger any blockchain transaction or cost any gas fee. Expires in 7 days.
15
-
16
-
Issued at: (.+)`)
17
13
tenMinutes:=10*time.Minute
18
14
19
15
typeargsstruct {
@@ -35,7 +31,8 @@ Issued at: (.+)`)
35
31
Msg: "Click sign to add favorite tokens at Kyberswap.com without logging in.\nThis request won’t trigger any blockchain transaction or cost any gas fee. Expires in 7 days. \n\nIssued at: 2024-11-13T07:22:42.790Z",
Msg: "Signing this message at: 2024-03-20T10:00:00Z",
48
45
Address: "0xabcd...",
49
46
},
50
-
authMessageRegexp: authRegexp,
47
+
authMessageRegexp: kutils.DefaultAuthRegexp,
51
48
authExpiry: tenMinutes,
52
49
},
53
50
wantErr: true,
@@ -61,7 +58,7 @@ Issued at: (.+)`)
61
58
Msg: "Signing this message at: 2024-03-20T10:00:00Z",
62
59
Address: "0xabcd...",
63
60
},
64
-
authMessageRegexp: authRegexp,
61
+
authMessageRegexp: kutils.DefaultAuthRegexp,
65
62
authExpiry: tenMinutes,
66
63
},
67
64
wantErr: true,
@@ -74,7 +71,7 @@ Issued at: (.+)`)
74
71
Msg: "Signing this message at: 2024-03-20T10:00:00Z",
75
72
Address: "0xdifferentAddress...",
76
73
},
77
-
authMessageRegexp: authRegexp,
74
+
authMessageRegexp: kutils.DefaultAuthRegexp,
78
75
authExpiry: tenMinutes,
79
76
},
80
77
wantErr: true,
@@ -87,7 +84,7 @@ Issued at: (.+)`)
87
84
Msg: "Click sign to add favorite tokens at Kyberswap.com without logging in.\nThis request won’t trigger any blockchain transaction or cost any gas fee. Expires in 7 days. \n\nIssued at: 2024-11-01T07:22:42.790Z",
0 commit comments