@@ -16,51 +16,36 @@ async def test_get_credits_history():
16
16
# Mock data for credit history
17
17
credit_history_data = {
18
18
"address" : address ,
19
- "credit_balances " : [
19
+ "credit_history " : [
20
20
{
21
- "amount" : 1000 ,
22
- "ratio" : 1.0 ,
23
- "tx_hash" : "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" ,
24
- "token" : "ALEPH" ,
25
- "chain" : "ETH" ,
26
- "provider" : "gateway" ,
27
- "origin" : "purchase" ,
28
- "origin_ref" : "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890" ,
29
- "payment_method" : "token" ,
30
- "credit_ref" : "init_credit_1" ,
31
- "credit_index" : 1 ,
32
- "expiration_date" : "2025-12-31T23:59:59Z" ,
33
- "message_timestamp" : "2023-01-01T12:00:00Z" ,
34
- },
35
- {
36
- "amount" : - 100 ,
21
+ "amount" : - 22 ,
37
22
"ratio" : None ,
38
23
"tx_hash" : None ,
39
24
"token" : None ,
40
25
"chain" : None ,
41
- "provider" : "node1.aleph.im " ,
42
- "origin" : "vm_usage" ,
43
- "origin_ref" : "vm_instance_123456 " ,
44
- "payment_method" : None ,
45
- "credit_ref" : "vm_consumption_1 " ,
46
- "credit_index" : 2 ,
26
+ "provider" : "ALEPH " ,
27
+ "origin" : None ,
28
+ "origin_ref" : "212f4825dd30e01f3801cdff1bdf8cd4d1c14ce2d31d695aee429d2ad0dfcba1 " ,
29
+ "payment_method" : "credit_expense" ,
30
+ "credit_ref" : "cd77a7983af168941fd011427c6198b146ccd6f85077e0b593a4e7239d45fb11 " ,
31
+ "credit_index" : 0 ,
47
32
"expiration_date" : None ,
48
- "message_timestamp" : "2023-01-15T14:30:00Z " ,
33
+ "message_timestamp" : "2025-09-30T06:57:26.106000Z " ,
49
34
},
50
35
{
51
- "amount" : 500 ,
52
- "ratio" : 0.8 ,
53
- "tx_hash" : "0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba" ,
54
- "token" : "ALEPH" ,
55
- "chain" : "ETH" ,
56
- "provider" : "gateway " ,
57
- "origin" : "purchase" ,
58
- "origin_ref" : "0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 " ,
59
- "payment_method" : "token " ,
60
- "credit_ref" : "add_credit_1 " ,
61
- "credit_index" : 3 ,
62
- "expiration_date" : "2026-06-30T23:59:59Z" ,
63
- "message_timestamp" : "2023-02-01T09:15:00Z " ,
36
+ "amount" : - 22 ,
37
+ "ratio" : None ,
38
+ "tx_hash" : None ,
39
+ "token" : None ,
40
+ "chain" : None ,
41
+ "provider" : "ALEPH " ,
42
+ "origin" : None ,
43
+ "origin_ref" : "36ceb85fb570fc87a6b906dc89df39129a971de96cbc56250553cfb8d49487e3 " ,
44
+ "payment_method" : "credit_expense " ,
45
+ "credit_ref" : "5881c8f813ea186b25a9a20d9bea46e2082c4d61c2b9e7d53bf8a164dc892b73 " ,
46
+ "credit_index" : 0 ,
47
+ "expiration_date" : None ,
48
+ "message_timestamp" : "2025-09-30T02:57:07.673000Z " ,
64
49
},
65
50
],
66
51
"pagination_page" : 1 ,
@@ -87,4 +72,4 @@ async def test_get_credits_history():
87
72
spy .assert_called_once_with (
88
73
expected_url , params = {"page" : "1" , "pagination" : "200" }
89
74
)
90
- assert len (response .credit_balances ) == 3
75
+ assert len (response .credit_history ) == 2
0 commit comments