Skip to content

Commit 5f2f8b2

Browse files
fix(affine): migrate record literals to #{ } (affinescript#218) (#137)
affinescript#218 (merged): bare `{`=block, records `#{ }`. Migrated typed record literals in avow-telegram-bot mocks (stamp-mock Proof; test-mock UnsubscribeParams×4 + ConsentParams×2). Parse clean. Refs hyperpolymath/affinescript#218 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c4fb55f commit 5f2f8b2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

avow-protocol/telegram-bot/avow-telegram-bot/src/stamp-mock.affine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub fn verify_rate_limit(p: RateLimitParams) -> VerificationResult {
131131

132132
pub fn generate_proof(proof_type: String) -> Proof {
133133
let ts = time_ms();
134-
Proof {
134+
Proof #{
135135
proof_type: proof_type ++ "_verification",
136136
timestamp: ts,
137137
signature: "mock_sig_" ++ show(ts) ++ "_" ++ random_string(7),

avow-protocol/telegram-bot/avow-telegram-bot/test-mock.affine

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn result_to_string(r: VerificationResult) -> String {
9292
}
9393

9494
fn make_valid_unsub() -> UnsubscribeParams {
95-
UnsubscribeParams {
95+
UnsubscribeParams #{
9696
url: "https://example.com/unsubscribe",
9797
tested_at: mock_now() - 5000,
9898
response_code: 200,
@@ -112,7 +112,7 @@ pub fn test_verify_unsubscribe_valid() -> Bool {
112112
}
113113

114114
pub fn test_verify_unsubscribe_invalid_url() -> Bool {
115-
let p = UnsubscribeParams {
115+
let p = UnsubscribeParams #{
116116
url: "not_https",
117117
tested_at: mock_now() - 5000,
118118
response_code: 200,
@@ -127,7 +127,7 @@ pub fn test_verify_unsubscribe_invalid_url() -> Bool {
127127
}
128128

129129
pub fn test_verify_unsubscribe_stale_timestamp() -> Bool {
130-
let p = UnsubscribeParams {
130+
let p = UnsubscribeParams #{
131131
url: "https://example.com/unsubscribe",
132132
tested_at: 0,
133133
response_code: 200,
@@ -142,7 +142,7 @@ pub fn test_verify_unsubscribe_stale_timestamp() -> Bool {
142142
}
143143

144144
pub fn test_verify_unsubscribe_bad_response_code() -> Bool {
145-
let p = UnsubscribeParams {
145+
let p = UnsubscribeParams #{
146146
url: "https://example.com/unsubscribe",
147147
tested_at: mock_now() - 5000,
148148
response_code: 404,
@@ -157,7 +157,7 @@ pub fn test_verify_unsubscribe_bad_response_code() -> Bool {
157157
}
158158

159159
pub fn test_verify_consent_valid() -> Bool {
160-
let p = ConsentParams {
160+
let p = ConsentParams #{
161161
initial_request: 1000000,
162162
confirmation: 1100000,
163163
ip_address: "192.168.1.1",
@@ -170,7 +170,7 @@ pub fn test_verify_consent_valid() -> Bool {
170170
}
171171

172172
pub fn test_verify_consent_simultaneous() -> Bool {
173-
let p = ConsentParams {
173+
let p = ConsentParams #{
174174
initial_request: 1000000,
175175
confirmation: 1000000,
176176
ip_address: "192.168.1.1",

0 commit comments

Comments
 (0)