Skip to content

Commit ce6bc97

Browse files
committed
fix: Updated missing heartbeat txn types
1 parent db7f5ea commit ce6bc97

File tree

3 files changed

+192
-6
lines changed

3 files changed

+192
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<div>
2+
<div
3+
aria-label="Visual representation of transactions"
4+
class="w-min bg-card"
5+
>
6+
<div
7+
class="relative grid"
8+
style="grid-template-columns: minmax(100px, 100px) repeat(1, 140px);"
9+
>
10+
<div />
11+
<div
12+
class="p-2 flex justify-center"
13+
>
14+
<div
15+
class="text-l font-semibold w-full"
16+
>
17+
<div
18+
class="grid text-center"
19+
>
20+
<div
21+
class="flex gap-0.5 items-center justify-center overflow-hidden"
22+
>
23+
<div
24+
class="shrink-0 basis-4"
25+
/>
26+
<div
27+
class="flex items-center overflow-hidden"
28+
>
29+
<a
30+
class="text-primary underline truncate"
31+
href="/localnet/account/HEARTBEATADDRESS123456789ABCDEFGHIJKLMNOPQRSTUVW"
32+
>
33+
<abbr
34+
class="tracking-wide"
35+
title="HEARTBEATADDRESS123456789ABCDEFGHIJKLMNOPQRSTUVW"
36+
>
37+
HEAR…TUVW
38+
</abbr>
39+
</a>
40+
</div>
41+
<div
42+
class="shrink-0 basis-4"
43+
>
44+
<div
45+
class="flex size-4 items-center justify-center overflow-hidden rounded-full border border-primary text-[0.6rem] text-primary"
46+
>
47+
1
48+
</div>
49+
</div>
50+
</div>
51+
</div>
52+
</div>
53+
</div>
54+
</div>
55+
<div
56+
class="relative grid"
57+
style="grid-template-columns: minmax(100px, 100px) repeat(1, 140px); grid-template-rows: repeat(1, 40px);"
58+
>
59+
<div
60+
class="absolute left-0"
61+
>
62+
<div>
63+
<div
64+
class="p-0"
65+
/>
66+
<div
67+
class="p-0"
68+
style="height: 40px; width: 140px;"
69+
>
70+
<div
71+
class="grid h-full"
72+
style="grid-template-columns: minmax(100px, 100px) repeat(1, 140px); height: 40px;"
73+
>
74+
<div />
75+
<div
76+
class="flex justify-center"
77+
>
78+
<div
79+
class="border h-full border-dashed"
80+
style="border-left-width: 1px;"
81+
/>
82+
</div>
83+
</div>
84+
</div>
85+
</div>
86+
</div>
87+
<div
88+
class="p-0 relative"
89+
>
90+
<div
91+
class="relative h-full p-0 flex items-center px-0"
92+
style="margin-left: 0px;"
93+
>
94+
<div
95+
class="inline"
96+
style="margin-left: 0px;"
97+
>
98+
<div
99+
class="flex items-center"
100+
>
101+
<a
102+
class="text-primary underline inline"
103+
href="/localnet/transaction/HEARTBEATHS44RJ4BQ6HOMWZCGOJW5WWOQ5CR7XHSZHFP2ZQCDOA"
104+
>
105+
<abbr
106+
class="tracking-wide text-primary"
107+
title="HEARTBEATHS44RJ4BQ6HOMWZCGOJW5WWOQ5CR7XHSZHFP2ZQCDOA"
108+
>
109+
HEARTBE…
110+
</abbr>
111+
</a>
112+
</div>
113+
</div>
114+
</div>
115+
</div>
116+
<div
117+
class="flex items-center justify-center relative z-10"
118+
data-state="closed"
119+
style="grid-column-start: 2; grid-column-end: 3;"
120+
>
121+
<div
122+
class="inline-flex relative size-5 items-center justify-center overflow-hidden rounded-full border text-[0.6rem] border-heartbeat bg-card"
123+
/>
124+
</div>
125+
</div>
126+
</div>
127+
<div
128+
class="sticky bottom-0 left-full z-50 flex size-0 overflow-visible"
129+
>
130+
<button
131+
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-transparent hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2 absolute bottom-1 right-0 w-32"
132+
id="download-transactions-visual"
133+
>
134+
<svg
135+
class="lucide lucide-download mr-2 size-4"
136+
fill="none"
137+
height="24"
138+
stroke="currentColor"
139+
stroke-linecap="round"
140+
stroke-linejoin="round"
141+
stroke-width="2"
142+
viewBox="0 0 24 24"
143+
width="24"
144+
xmlns="http://www.w3.org/2000/svg"
145+
>
146+
<path
147+
d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
148+
/>
149+
<polyline
150+
points="7 10 12 15 17 10"
151+
/>
152+
<line
153+
x1="12"
154+
x2="12"
155+
y1="15"
156+
y2="3"
157+
/>
158+
</svg>
159+
Download
160+
</button>
161+
</div>
162+
</div>

src/tests/builders/transaction-result-builder.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ export class TransactionResultBuilder extends DataBuilder<TransactionResult> {
7676
this.thing['tx-type'] = algosdk.TransactionType.hb
7777
this.thing['heartbeat-transaction'] = {
7878
'hb-address': randomString(52, 52),
79+
'hb-key-dilution': randomNumberBetween(1000, 10000),
80+
'hb-proof': {},
81+
'hb-seed': randomString(52, 52),
82+
'hb-vote-id': randomString(52, 52),
7983
}
8084
return this
8185
}

src/tests/object-mother/transaction-result.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const transactionResultMother = {
6565
},
6666
['mainnet-HEARTBEAT1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ']: () => {
6767
return new TransactionResultBuilder({
68-
id: 'HEARTBEAT1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ',
68+
id: 'HEARTBEATHS44RJ4BQ6HOMWZCGOJW5WWOQ5CR7XHSZHFP2ZQCDOA',
6969
'close-rewards': 0,
7070
'closing-amount': 0,
7171
'confirmed-round': 34675056,
@@ -76,7 +76,17 @@ export const transactionResultMother = {
7676
'intra-round-offset': 26,
7777
'last-valid': 34676052,
7878
'heartbeat-transaction': {
79-
'hb-address': 'HEARTBEATADDRESS123456789ABCDEFGHIJKLMNOPQRSTUVW',
79+
'hb-address': '3WPMTZURXXNEB6CWHGHXQUSESVHYE3HK4G4XDW475BWSZBAUTW5YR7CY4E',
80+
'hb-key-dilution': 1001,
81+
'hb-proof': {
82+
'hb-pk': '6BDFpmMdLXhssJ9fCdVdnClCHe69LqnD70jik+AHANM=',
83+
'hb-pk1sig': 'IxENwM5zMaRkpeD/Iey3hunGVyVVV7c8c9b/p30ISn4t7NeRDwduAJtrL0IN29b32+Iw+aRDxSCDCZQfXGG3Ag==',
84+
'hb-pk2': 'EMBIuwJ9FOl7dce/JBgUJloa1DQwCIv+aVN6bxO4AF0=',
85+
'hb-pk2sig': 'Uj5lV61RtbCl0WjmeX+6AKAX93unmpjXxw7QST+np0VQhiei0qcp0feKj1oz8tEJScB/vHtvQM4uC8yNELBMCQ==',
86+
'hb-sig': 'NGIPT/Q+2EaBkU/wPOK0bJrQdc2TNj08IaZRZxrL4tJnq1vT87p6m2kF5wYyrPK4cdhhaw4pK7lxPOlKQ+YHAg==',
87+
},
88+
'hb-seed': 'OU1+MWj4jCD4xstyaYpS/6ec7aHxqaQpdJO1h3e3Uu0=',
89+
'hb-vote-id': 'wibDDqw0IqhBTI4Kz7bBGC1KU4rpjVyLH75aXWnQ8Q8=',
8090
},
8191
'receiver-rewards': 0,
8292
'round-time': 1703439471,
@@ -96,12 +106,22 @@ export const transactionResultMother = {
96106
'genesis-hash': 'x9maOhZVCNkkZCgV6CcLpxd1ZgIgHwuAfg6fdG2FJo8=',
97107
'genesis-id': 'dockernet-v1',
98108
'heartbeat-transaction': {
99-
'hb-address': 'HEARTBEATADDRESS123456789ABCDEFGHIJKLMNOPQRSTUVW',
100-
},
101-
id: 'HEARTBEAT1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZZZZZZZZ',
109+
'hb-address': '3WPMTZURXXNEB6CWHGHXQUSESVHYE3HK4G4XDW475BWSZBAUTW5YR7CY4E',
110+
'hb-key-dilution': 1001,
111+
'hb-proof': {
112+
'hb-pk': '6BDFpmMdLXhssJ9fCdVdnClCHe69LqnD70jik+AHANM=',
113+
'hb-pk1sig': 'IxENwM5zMaRkpeD/Iey3hunGVyVVV7c8c9b/p30ISn4t7NeRDwduAJtrL0IN29b32+Iw+aRDxSCDCZQfXGG3Ag==',
114+
'hb-pk2': 'EMBIuwJ9FOl7dce/JBgUJloa1DQwCIv+aVN6bxO4AF0=',
115+
'hb-pk2sig': 'Uj5lV61RtbCl0WjmeX+6AKAX93unmpjXxw7QST+np0VQhiei0qcp0feKj1oz8tEJScB/vHtvQM4uC8yNELBMCQ==',
116+
'hb-sig': 'NGIPT/Q+2EaBkU/wPOK0bJrQdc2TNj08IaZRZxrL4tJnq1vT87p6m2kF5wYyrPK4cdhhaw4pK7lxPOlKQ+YHAg==',
117+
},
118+
'hb-seed': 'OU1+MWj4jCD4xstyaYpS/6ec7aHxqaQpdJO1h3e3Uu0=',
119+
'hb-vote-id': 'wibDDqw0IqhBTI4Kz7bBGC1KU4rpjVyLH75aXWnQ8Q8=',
120+
},
121+
id: 'HEARTBEATHS44RJ4BQ6HOMWZCGOJW5WWOQ5CR7XHSZHFP2ZQCDOA',
102122
'last-valid': 34676052,
103123
'round-time': 1703439471,
104-
sender: 'HEARTBEATADDRESS123456789ABCDEFGHIJKLMNOPQRSTUVW',
124+
sender: 'GAU5WA6DT2EPFS6LKOA333BQP67NXIHZ7JPOOHMZWJDPZRL4XMHDDDUCKA',
105125
'tx-type': TransactionType.hb,
106126
'close-rewards': 0,
107127
'closing-amount': 0,

0 commit comments

Comments
 (0)