From da0fe5044b397f664d7fc41fee14596866cf61cf Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Thu, 26 Oct 2023 15:34:37 +0200 Subject: [PATCH 01/15] Fixed icons having an alpha layer --- icons/nanos_app_stakekit.gif | Bin 78 -> 78 bytes icons/nanox_app_stakekit.gif | Bin 75 -> 75 bytes icons/stax_app_stakekit.gif | Bin 219 -> 219 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/icons/nanos_app_stakekit.gif b/icons/nanos_app_stakekit.gif index bea0250e975eec514e6510edf2de05ea91948ad5..407c33ffd47c5a8d1a9489e31d4602ff76f7d44e 100644 GIT binary patch delta 38 mcmebCQ*ifmv#?AQU=U#V$iVRb|9=J;srZwH1<0AGpa%ftHw$q9 delta 38 ncmebCQ*ifmv#?AQU=U!K$iVRb|9=J;srZwHm4Sh2qJka(+U5%s diff --git a/icons/nanox_app_stakekit.gif b/icons/nanox_app_stakekit.gif index b45e2a014fcf8edb9f6aab3a50ebc19ea204b12c..3a61d6c9306bf20ea0c95b02fea94d3d7f9e162c 100644 GIT binary patch delta 12 TcmebFo*=`*!oa{VQ9&C355EE@ delta 12 TcmebFo*=`*%D})hQ9&C356%KA diff --git a/icons/stax_app_stakekit.gif b/icons/stax_app_stakekit.gif index 8a87f147f14d86b43e7c92c3bbb8262cdbeb3495..62e7c5af80f6512e0f6dccfaa634fd33b38f1b3f 100644 GIT binary patch delta 27 icmcc3c$<;i-P6s&GEsp+f#LH+Zc`Q(1_p+SF4F;Ms0QQ! delta 27 icmcc3c$<;i-P6s&GEsp+fnoDRZc`Rk1_rK)F4F;J*9NZu From 65e72fdfc6e113f3663e57f3115cebe125752a4c Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Thu, 26 Oct 2023 15:20:00 +0200 Subject: [PATCH 02/15] Added a 64x64px Stax glyph --- glyphs/stax_stakekit_64px.gif | Bin 0 -> 631 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 glyphs/stax_stakekit_64px.gif diff --git a/glyphs/stax_stakekit_64px.gif b/glyphs/stax_stakekit_64px.gif new file mode 100644 index 0000000000000000000000000000000000000000..23a5cd4ce42d3f4aad9bf60920c2e2b95ac338a9 GIT binary patch literal 631 zcmV--0*L)bNk%w1VL$*t0P_m~000061_lcY3l|p`EiEl#Vq&ACqtVgP=jZ43_4WGt z`v3p`000000000000000A^8LV00000A^!_WZDD6+O<`wgV`~m)VQp<;JuogbH8eFe zH2^FC0000$06+i$1paWzNvpj$>&?6WU?`3xrYI9~7)DVL!~o0!Q5Z=nD#@|7uz?^z z6U=7Bz@Tu@T~GjpI%^8rU-!+ z2?UsRt!Zk3Cm3tDxVj$+U}Al_!Wsy4h5^XQ7i$B+M+4K;0MF1BYyj9y2Yg!E+o}fG z-dqv~#z*APU}fs-?KAJf(q!{$?Bm-O-Nx)Y!7R(YIp_c&LNlQtmV-Lh$VD3$)i2p{~d4Qa$2MJMqdsVOPt*2CydN=@pr~60w}?cUtyUM RQaFqV$KQYi7WhvD06Xow2ebeH literal 0 HcmV?d00001 From cba4d507ddd2b4d84e9feddc9d1c501f8ce2c64c Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 25 Oct 2023 15:57:01 +0200 Subject: [PATCH 03/15] Removed unused glyphs --- glyphs/icon_back.gif | Bin 74 -> 0 bytes glyphs/icon_back_x.gif | Bin 1123 -> 0 bytes glyphs/icon_certificate.gif | Bin 1133 -> 0 bytes glyphs/icon_crossmark.gif | Bin 1131 -> 0 bytes glyphs/icon_dashboard.gif | Bin 1133 -> 0 bytes glyphs/icon_dashboard_x.gif | Bin 1126 -> 0 bytes glyphs/icon_down.gif | Bin 1100 -> 0 bytes glyphs/icon_eye.gif | Bin 1130 -> 0 bytes glyphs/icon_left.gif | Bin 1101 -> 0 bytes glyphs/icon_right.gif | Bin 1100 -> 0 bytes glyphs/icon_toggle_reset.gif | Bin 225 -> 0 bytes glyphs/icon_toggle_set.gif | Bin 227 -> 0 bytes glyphs/icon_up.gif | Bin 1100 -> 0 bytes glyphs/icon_validate_14.gif | Bin 1125 -> 0 bytes glyphs/icon_warning.gif | Bin 85 -> 0 bytes src/main.c | 142 ----------------------------------- 16 files changed, 142 deletions(-) delete mode 100644 glyphs/icon_back.gif delete mode 100644 glyphs/icon_back_x.gif delete mode 100644 glyphs/icon_certificate.gif delete mode 100644 glyphs/icon_crossmark.gif delete mode 100644 glyphs/icon_dashboard.gif delete mode 100644 glyphs/icon_dashboard_x.gif delete mode 100644 glyphs/icon_down.gif delete mode 100644 glyphs/icon_eye.gif delete mode 100644 glyphs/icon_left.gif delete mode 100644 glyphs/icon_right.gif delete mode 100644 glyphs/icon_toggle_reset.gif delete mode 100644 glyphs/icon_toggle_set.gif delete mode 100644 glyphs/icon_up.gif delete mode 100644 glyphs/icon_validate_14.gif delete mode 100644 glyphs/icon_warning.gif delete mode 100644 src/main.c diff --git a/glyphs/icon_back.gif b/glyphs/icon_back.gif deleted file mode 100644 index a2a7e6d4fa290e4875992d4024e988d14b91df26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJOHaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zGfwlMdQ)(_#RaEceV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LV6Zqk*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% wONgH=z;c3tK?g*D$_@r5iJtzIs~KwUGz+zPEiKD<-x8T<*15Dbij~0{0O2}{jsO4v diff --git a/glyphs/icon_certificate.gif b/glyphs/icon_certificate.gif deleted file mode 100644 index 89b529f792aeb77c8cc3b4d4782d8280b3c6c204..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1133 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJOHaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zGfwlMdQ)(_#RaEceV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LV6Zqk*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% zONgH=z;c3tK?g*D$_@r5rJnxG17}|h+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJMxaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zBTn<6dQ)(_#R;cgeV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LU=%qz*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% zONgH=z;c3tK?g*D$_@r5g`R%S3EQ{LsG1P=G9yPZ?_TW!_O_JIo#INXvMrLH1~M>M F0{{d^jh+i z#(Mch>H3D2mX`VkM*2oZx|Z5PF?(>IEf;+ybD@E~!PCWvMA{Mftf3V2@j6;&zJ# zPV=C8Q*gV*5~p5$pkwqw(Tfz_Fd<+X0x{u<7s!Dp|I|ESnlAz-ZpQ!r{{H#>>*tT} z-@bnN{ORL|_wU}mdHw3;i|5atK6(7;;e-44?%uh5>*kH?*REcZ;0$^0LyB;-bQW{Jh+p?5xa; z^t9BJ|cQ;oTXD3GodplbjYb#3&b2C#D zVqwaWPR5VIe^Qem-6vZZ1v^b~aWPW+p~p z3GtH!SWYl7=zs`N*}=f1)WgepeBpkH7I)L>0efyf`cv6&*0!WWPeHu$lGW7Enz_D= G4Aua{vX6rR diff --git a/glyphs/icon_dashboard_x.gif b/glyphs/icon_dashboard_x.gif deleted file mode 100644 index 33d9b0a74a263937a8cbb3b7c4ccfd4bd4fd2a3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1126 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZx= z5l-`({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|L7iT9&2YWkP8*3{|3v)A5 z6JsMo1ARSR9c?X54RtkD6=fww1$jAH8EGj=32`w|5n&-g0e(JS9&Rp94t6$H7G@?! zUc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDi`Y;NgdWMu4QWZ>pz zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&BF8LAmYFGwpWEr5aq7{EoD zWvMA{Mftf3V1HX>!rg-I6icj50lNgEH3i8fKwls^#1W@feV|kH(V`kA1WZ04CM4AY z(t84%^TORUA=Po(!~qs&z(JU`qar2$B!L7a`@1}1N-;w-Lrew&K=vgZQZhY z)5ZeMTG_VdAT{+S(zE>X{jm6Nr?&Zaj`McQIQehVWA};$o%uI|73_73^0#s@+FtPL0rFC}Ia4}c|0Jk%O AU;qFB diff --git a/glyphs/icon_eye.gif b/glyphs/icon_eye.gif deleted file mode 100644 index df4bb829e6d06e0bde643b1b96fde45c093edef1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1130 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJOHaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zGfwlMdQ)(_#RaEceV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LV6Zqk*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% zONgH=z;c3tK?g*D$_@r5`JVojvmYFo*YYB?T-40^%iq9xH)NNlPJ66kronvNgOR}+ E02G{#(EtDd diff --git a/glyphs/icon_left.gif b/glyphs/icon_left.gif deleted file mode 100644 index 524226ba11247d9c5f797801400fd630071a049a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1101 zcmZ?wbhEHbWMN=u_`m=H|NsA2{K*1lD*orL$SqJvNi0bO(*Nx%3KEmEQ%e+*Qqwc@ zY?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDkcY~W;U?r3IeWZ>*# zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&BF45}GLFGwpWEr5aq7{EoD zWvMA{Mftf3V1HX>!rg-I6l1JT0lNgEH3i8fKwls^!~~~SeV|kH(V`kA1WZ04CM4AY z(t84%^TORUA=Po(!~qs&z(JU`qar2$B!L7a`@1}1N-;w-Lrew&K=vgZQZhY z)5ZeMTG_VdAT{+S(zE>X{jm6Nr?&Zaj`McQIQehVWA};$o%uI|73_73^0#s@+FmbdLb7tJW=fuch4FGsN BgIfRq diff --git a/glyphs/icon_right.gif b/glyphs/icon_right.gif deleted file mode 100644 index 15ff3cf5994421fbd6e7d593aae8e438310f33ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1100 zcmZ?wbhEHbWMN=u_`m=H|NsA2{K*1lD*orL$SqJvNi0bO(*Nx%3KEmEQ%e+*Qqwc@ zY?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDkcY~W;U?r3IcWZ>*# zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&BF2&x%HFGwpWEr5aq7{EoD zWvMA{Mftf3V1HX>!rg-A6jL{>P64|FqBRA{B|u*wIm7^`R(+sT^wFXkCIn1AASNW$ z0@Eju15Nk;OB7P`fT_I*n5-H9|NHyr_phHnzJL4r<@2Wx@87+B^ZM1x7tfzPee(Fx z!w2{8-Mw@B*3BE&uU)-z`O?J;=g*xzbNbZD6UUDoJ#zTa!2|pE?cK9`*UlZ=w{6|B zdDF%X>({MavwGFa70Z_`U9x!5!Ugl^&7CuQ*322xr%jzQdD6rQ{e8VX-Cdm>?QN|s z%}tFB^>wv1)m4=h1nAc$w`R`@o}*+(NU2R;bEa6!9jrm z{(inb-d>&_?ryFw&Q6XF_I9>5)>f7l=4PfQ#zuw)`g*!L+FF_#>T0Sg%1Vj~@^Z2= z(o&KV;$osA!a{-q{CvDTJltHI9PDhYEX+)d3=BG;5&~3eFfg(6@U>OF>g8gv1_1YR Bf|mdQ diff --git a/glyphs/icon_toggle_reset.gif b/glyphs/icon_toggle_reset.gif deleted file mode 100644 index 450bc869d02ecc35afc46e622e175c5e4afca20d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 225 zcmV<703QEGNk%w1VITk!0J8u9-QC^R*4EO}()RZD?d|RI^78!r{Ls+Q{{H^W&CTB4 z-p=jZ47`T76<|IEzHA^8LV00000EC2ui03ZMo000Dzut`ajNH6QXlTgGYHbual z=oS2p@Hr>=Y?x*0!CneV{8Cb2UlrYbRkT6QDgxWI!9gq*06JE~1l$0M&>}L>STr|?VH8@(Es)oYV7nDO zEa41+93?z1>BoT$Jvc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDi`Y;NgdWMu4SWZ>pz zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&oS!~m)pMK4GzC@p}31Q@_Y znPsUdZbkXI3SfU*Wy0Np?i3fSP64|FqBRA{B|u*w9AfN>Q>#AEDf(zp4HE(;9}p9g zYJuq!$bqK&|0N2kdBD_O1WeY9|Ns5{^ZVD&AK$-y{qp(KhxhN^zIpxX<%{Rfo<4c} z=;4F=_wL@gee33p>({PcxqRv3h4bgmo;iK$#u35cm<%;FYmM&SmXyJnS^XAT(J!|HS>C>i8nLKIYg#NzXp6;&Bj`p_J zmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3jP$hBl;otug!s7FnCPg;i14t`kl>)e z0DnJUA8#*D4|g|L7iT9&2YWkP8*3{|3v)A56JsMo1ARSR9c?X54RtkD6=fww1$jAH z8EGj=32`w|5n&-g0e(JS9v*HkP7Zc9Ru*O^Mg|5QPzeDlH5i!KTar5~xYlqnSOWmI C)q;Qk diff --git a/glyphs/icon_validate_14.gif b/glyphs/icon_validate_14.gif deleted file mode 100644 index ccb5cabe38d16ff857d540b64742e4b8346a6949..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1125 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZx= z0Z#LvdQ)(_#So`neV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|L7iT9&2YWkP8*3{|3v)A5 z6JsMo1ARSR9c?X54RtkD6=fww1$jAH8EGj=32`w|5n&-g0e(JS9&Rp94t6$H7G@?! zU -#include -#include - -#include "os.h" -#include "cx.h" - -#include "glyphs.h" - -#include "stakekit_plugin.h" - -void dispatch_plugin_calls(int message, void *parameters) { - PRINTF("Handling message %d\n", message); - switch (message) { - case ETH_PLUGIN_INIT_CONTRACT: - handle_init_contract(parameters); - break; - case ETH_PLUGIN_PROVIDE_PARAMETER: - handle_provide_parameter(parameters); - break; - case ETH_PLUGIN_FINALIZE: - handle_finalize(parameters); - break; - case ETH_PLUGIN_PROVIDE_INFO: - handle_provide_token(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_ID: - handle_query_contract_id(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_UI: - handle_query_contract_ui(parameters); - break; - default: - PRINTF("Unhandled message %d\n", message); - break; - } -} - -void handle_query_ui_exception(unsigned int *args) { - switch (args[0]) { - case ETH_PLUGIN_QUERY_CONTRACT_UI: - ((ethQueryContractUI_t *) args[1])->result = ETH_PLUGIN_RESULT_ERROR; - break; - default: - break; - } -} - -// Calls the ethereum app. -void call_app_ethereum(void) { - unsigned int libcall_params[5]; - libcall_params[0] = (unsigned int) "Ethereum"; - libcall_params[1] = 0x100; - libcall_params[2] = RUN_APPLICATION; - libcall_params[3] = (unsigned int) NULL; -#ifdef HAVE_NBGL - caller_app_t capp; - const char name[] = APPNAME; - nbgl_icon_details_t icon_details; - uint8_t bitmap[sizeof(ICONBITMAP)]; - - memcpy(&icon_details, &ICONGLYPH, sizeof(ICONGLYPH)); - memcpy(&bitmap, &ICONBITMAP, sizeof(bitmap)); - icon_details.bitmap = (const uint8_t *) bitmap; - capp.name = (const char *) name; - capp.icon = &icon_details; - libcall_params[4] = (unsigned int) &capp; -#else - libcall_params[4] = (unsigned int) NULL; -#endif - os_lib_call((unsigned int *) &libcall_params); -} - -// Weird low-level black magic. No need to edit this. -__attribute__((section(".boot"))) int main(int arg0) { - // Exit critical section - __asm volatile("cpsie i"); - - // Ensure exception will work as planned - os_boot(); - - // Try catch block. Please read the docs for more information on how to use those! - BEGIN_TRY { - TRY { - // Low-level black magic. - check_api_level(CX_COMPAT_APILEVEL); - - // Check if we are called from the dashboard. - if (!arg0) { - // Called from dashboard, launch Ethereum app - call_app_ethereum(); - return 0; - } else { - // Not called from dashboard: called from the ethereum app! - const unsigned int *args = (const unsigned int *) arg0; - - // If `ETH_PLUGIN_CHECK_PRESENCE` is set, this means the caller is just trying to - // know whether this app exists or not. We can skip `dispatch_plugin_calls`. - if (args[0] != ETH_PLUGIN_CHECK_PRESENCE) { - dispatch_plugin_calls(args[0], (void *) args[1]); - } - } - } - CATCH_OTHER(e) { - switch (e) { - // These exceptions are only generated on handle_query_contract_ui() - case 0x6502: - case EXCEPTION_OVERFLOW: - handle_query_ui_exception((unsigned int *) arg0); - break; - default: - break; - } - PRINTF("Exception 0x%x caught\n", e); - } - FINALLY { - // Call `os_lib_end`, go back to the ethereum app. - os_lib_end(); - } - } - END_TRY; - - // Will not get reached. - return 0; -} From a6670fc2e4d8b139e87af29c0c273405a54d6d67 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 25 Oct 2023 15:55:46 +0200 Subject: [PATCH 04/15] Updated to use the latest plugin SDK --- ethereum-plugin-sdk | 2 +- src/handle_finalize.c | 3 +- src/handle_init_contract.c | 5 +- src/handle_provide_parameter.c | 5 +- src/handle_provide_token.c | 5 +- src/handle_query_contract_id.c | 5 +- src/handle_query_contract_ui.c | 131 +++++++++++++++++---------------- src/stakekit_plugin.h | 7 -- 8 files changed, 77 insertions(+), 86 deletions(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index b9777e7..1fe4085 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit b9777e7a81a9c33b3f8997ffa23396fa2b3f861d +Subproject commit 1fe4085d04a88f4238103a4ed3db1484fdb69c63 diff --git a/src/handle_finalize.c b/src/handle_finalize.c index a0a1825..8e62c6c 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -47,8 +47,7 @@ static bool set_ticker_withdraw_for_mapped_token(plugin_parameters_t *context, return false; } -void handle_finalize(void *parameters) { - ethPluginFinalize_t *msg = (ethPluginFinalize_t *) parameters; +void handle_finalize(ethPluginFinalize_t *msg) { plugin_parameters_t *context = (plugin_parameters_t *) msg->pluginContext; msg->uiType = ETH_UI_TYPE_GENERIC; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 8f3a81c..155ce51 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -1,9 +1,8 @@ #include "stakekit_plugin.h" +#include "utils.h" // Called once to init. -void handle_init_contract(void *parameters) { - ethPluginInitContract_t *msg = (ethPluginInitContract_t *) parameters; - +void handle_init_contract(ethPluginInitContract_t *msg) { if (msg->interfaceVersion != ETH_PLUGIN_INTERFACE_VERSION_LATEST) { msg->result = ETH_PLUGIN_RESULT_UNAVAILABLE; return; diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index ed73d8b..03ad10b 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -250,8 +250,7 @@ static void handle_aave_supply(ethPluginProvideParameter_t *msg, plugin_paramete } } -void handle_provide_parameter(void *parameters) { - ethPluginProvideParameter_t *msg = (ethPluginProvideParameter_t *) parameters; +void handle_provide_parameter(ethPluginProvideParameter_t *msg) { plugin_parameters_t *context = (plugin_parameters_t *) msg->pluginContext; // We use `%.*H`: it's a utility function to print bytes. You first give @@ -367,4 +366,4 @@ void handle_provide_parameter(void *parameters) { } } msg->result = ETH_PLUGIN_RESULT_OK; -} \ No newline at end of file +} diff --git a/src/handle_provide_token.c b/src/handle_provide_token.c index 3710453..554c21c 100644 --- a/src/handle_provide_token.c +++ b/src/handle_provide_token.c @@ -10,8 +10,7 @@ static void network_token(plugin_parameters_t *context) { } } -void handle_provide_token(void *parameters) { - ethPluginProvideInfo_t *msg = (ethPluginProvideInfo_t *) parameters; +void handle_provide_token(ethPluginProvideInfo_t *msg) { plugin_parameters_t *context = (plugin_parameters_t *) msg->pluginContext; PRINTF("Plugin provide tokens : 0x%p, 0x%p\n", msg->item1, msg->item2); @@ -46,4 +45,4 @@ void handle_provide_token(void *parameters) { } msg->result = ETH_PLUGIN_RESULT_OK; -} \ No newline at end of file +} diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index db542f0..930938f 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -1,8 +1,7 @@ #include "stakekit_plugin.h" // Function to display the method name on the device. -void handle_query_contract_id(void *parameters) { - ethQueryContractID_t *msg = (ethQueryContractID_t *) parameters; +void handle_query_contract_id(ethQueryContractID_t *msg) { plugin_parameters_t *context = (plugin_parameters_t *) msg->pluginContext; strlcpy(msg->name, PLUGIN_NAME, msg->nameLength); @@ -125,4 +124,4 @@ void handle_query_contract_id(void *parameters) { } msg->result = ETH_PLUGIN_RESULT_OK; -} \ No newline at end of file +} diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index e48d8d6..a2ef12b 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -1,8 +1,9 @@ +#include #include "stakekit_plugin.h" // Set UI for the "Send" screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_send_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_send_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case DEPOSIT_SELF_APECOIN: case SWAP_FROM: @@ -46,45 +47,49 @@ static void set_send_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } // Convert to string. - amountToString(context->amount_sent, - INT256_LENGTH, - context->decimals_sent, - context->ticker_sent, - msg->msg, - msg->msgLength); + if (!amountToString(context->amount_sent, + INT256_LENGTH, + context->decimals_sent, + context->ticker_sent, + msg->msg, + msg->msgLength)) { + return false; + } PRINTF("AMOUNT SENT: %s\n", msg->msg); + return true; } // Same as the "set_send_ui" function. However the value is extracted from the pluginSharedRO. -static void set_send_value_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_send_value_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case STAKE: strlcpy(msg->title, "Send", msg->titleLength); break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } // Convert to string. - amountToString(msg->pluginSharedRO->txContent->value.value, - msg->pluginSharedRO->txContent->value.length, - context->decimals_sent, - context->ticker_sent, - msg->msg, - msg->msgLength); + if (!amountToString(msg->pluginSharedRO->txContent->value.value, + msg->pluginSharedRO->txContent->value.length, + context->decimals_sent, + context->ticker_sent, + msg->msg, + msg->msgLength)) { + return false; + } PRINTF("AMOUNT SENT: %s\n", msg->msg); + return true; } // Set UI for "Receive" screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_receive_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_receive_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case WITHDRAW_SELF_APECOIN: case SWAP_TO: @@ -96,22 +101,24 @@ static void set_receive_ui(ethQueryContractUI_t *msg, plugin_parameters_t *conte break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } // Convert to string. - amountToString(context->amount_received, - INT256_LENGTH, - context->decimals_received, - context->ticker_received, - msg->msg, - msg->msgLength); + if (!amountToString(context->amount_received, + INT256_LENGTH, + context->decimals_received, + context->ticker_received, + msg->msg, + msg->msgLength)) { + return false; + } PRINTF("AMOUNT RECEIVED: %s\n", msg->msg); + return true; } // Utility function to print an address to the UI. -static void print_address(ethQueryContractUI_t *msg, uint8_t *address) { +static bool print_address(ethQueryContractUI_t *msg, uint8_t *address) { // Prefix the address with `0x`. msg->msg[0] = '0'; msg->msg[1] = 'x'; @@ -122,7 +129,7 @@ static void print_address(ethQueryContractUI_t *msg, uint8_t *address) { // Get the string representation of the address stored in `context->beneficiary`. Put it in // `msg->msg`. - getEthAddressStringFromBinary( + return getEthAddressStringFromBinary( address, msg->msg + 2, // +2 here because we've already prefixed with '0x'. msg->pluginSharedRW->sha3, @@ -131,7 +138,7 @@ static void print_address(ethQueryContractUI_t *msg, uint8_t *address) { // Set UI for "Recipient" screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_recipient_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_recipient_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case SUBMIT_MATIC_LIDO: case REQUEST_WITHDRAW: @@ -167,17 +174,16 @@ static void set_recipient_ui(ethQueryContractUI_t *msg, plugin_parameters_t *con break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } - print_address(msg, context->recipient); + return print_address(msg, context->recipient); } // Set UI for "Recipient 2" screen. When having more than one recipient. // The recipient address is saved in the contract_address // Each methods sets the title and the message to be displayed on the screen. -static void set_recipient_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_recipient_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case COMET_CLAIM: strlcpy(msg->title, "Comet Protocol", msg->titleLength); @@ -188,17 +194,16 @@ static void set_recipient_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *c break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } - print_address(msg, context->contract_address); + return print_address(msg, context->contract_address); } // Set UI for "Recipient 2" screen. When having more than two recipients. // The recipient address is saved in the amount_received // Each methods sets the title and the message to be displayed on the screen. -static void set_recipient_3_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_recipient_3_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case VOTE: case REVOKE_ACTIVE: @@ -206,16 +211,15 @@ static void set_recipient_3_ui(ethQueryContractUI_t *msg, plugin_parameters_t *c break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } - print_address(msg, context->amount_received); + return print_address(msg, context->amount_received); } // Set UI for smart contract address screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_smart_contract_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_smart_contract_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case CLAIM_SELF_APECOIN: case CREATE_ACCOUNT: @@ -230,37 +234,37 @@ static void set_smart_contract_ui(ethQueryContractUI_t *msg, plugin_parameters_t break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } - print_address(msg, msg->pluginSharedRO->txContent->destination); + return print_address(msg, msg->pluginSharedRO->txContent->destination); } // Set UI for unbound nonce boolean screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_unbound_nonce_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_unbound_nonce_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case UNSTAKE_CLAIM_TOKENS_NEW: strlcpy(msg->title, "Unbound Nonce", msg->titleLength); break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } if (context->unbound_nonce == 0) { strlcpy(msg->msg, "False", msg->msgLength); } else { strlcpy(msg->msg, "True", msg->msgLength); } + return true; } // Set UI for "Warning" screen. -static void set_warning_ui(ethQueryContractUI_t *msg, +static bool set_warning_ui(ethQueryContractUI_t *msg, const plugin_parameters_t *context __attribute__((unused))) { strlcpy(msg->title, "WARNING", msg->titleLength); strlcpy(msg->msg, "Unknown token", msg->msgLength); + return true; } // Set UI for the methods needing a send screen. @@ -521,45 +525,44 @@ static screens_t get_screen(ethQueryContractUI_t *msg, } // Set the UI according to the screen that needs to be displayed. -void handle_query_contract_ui(void *parameters) { - ethQueryContractUI_t *msg = (ethQueryContractUI_t *) parameters; +void handle_query_contract_ui(ethQueryContractUI_t *msg) { plugin_parameters_t *context = (plugin_parameters_t *) msg->pluginContext; + bool ret = false; + (void) memset(msg->title, 0, msg->titleLength); (void) memset(msg->msg, 0, msg->msgLength); - screens_t screen = get_screen(msg, context); switch (screen) { case SEND_SCREEN: - set_send_ui(msg, context); + ret = set_send_ui(msg, context); break; case SEND_VALUE_SCREEN: - set_send_value_ui(msg, context); + ret = set_send_value_ui(msg, context); break; case RECEIVE_SCREEN: - set_receive_ui(msg, context); + ret = set_receive_ui(msg, context); break; case RECIPIENT_SCREEN: - set_recipient_ui(msg, context); + ret = set_recipient_ui(msg, context); break; case RECIPIENT_2_SCREEN: - set_recipient_2_ui(msg, context); + ret = set_recipient_2_ui(msg, context); break; case RECIPIENT_3_SCREEN: - set_recipient_3_ui(msg, context); + ret = set_recipient_3_ui(msg, context); break; case SMART_CONTRACT_SCREEN: - set_smart_contract_ui(msg, context); + ret = set_smart_contract_ui(msg, context); break; case UNBOUND_NONCE_SCREEN: - set_unbound_nonce_ui(msg, context); + ret = set_unbound_nonce_ui(msg, context); break; case WARN_SCREEN: - set_warning_ui(msg, context); + ret = set_warning_ui(msg, context); break; default: PRINTF("Received an invalid screenIndex %d\n", screen); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + break; } - msg->result = ETH_PLUGIN_RESULT_OK; + msg->result = ret ? ETH_PLUGIN_RESULT_OK : ETH_PLUGIN_RESULT_ERROR; } diff --git a/src/stakekit_plugin.h b/src/stakekit_plugin.h index 33331cc..5db9673 100644 --- a/src/stakekit_plugin.h +++ b/src/stakekit_plugin.h @@ -174,13 +174,6 @@ typedef struct plugin_parameters_t { // Do not remove this check. _Static_assert(sizeof(plugin_parameters_t) <= (5 * 32), "Structure of parameters too big."); -void handle_provide_parameter(void *parameters); -void handle_query_contract_ui(void *parameters); -void handle_finalize(void *parameters); -void handle_init_contract(void *parameters); -void handle_provide_token(void *parameters); -void handle_query_contract_id(void *parameters); - static inline void printf_hex_array(const char *title __attribute__((unused)), size_t len __attribute__((unused)), const uint8_t *data __attribute__((unused))) { From d6ab9997f53bca63daf878e6bc0113bb5b32ba00 Mon Sep 17 00:00:00 2001 From: Sarah Gliner <105934250+sgliner-ledger@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:46:11 +0100 Subject: [PATCH 05/15] [auto]: add PR template --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..98b720f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +# Checklist + +- [ ] App update process has been followed +- [ ] Target branch is `develop` +- [ ] Application version has been bumped + + From 0af3917c5a807a4a0f1d272f23ae501f299dd045 Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Wed, 13 Mar 2024 14:19:13 +0100 Subject: [PATCH 06/15] [auto] Add manifest --- ledger_app.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ledger_app.toml diff --git a/ledger_app.toml b/ledger_app.toml new file mode 100644 index 0000000..acd4ba1 --- /dev/null +++ b/ledger_app.toml @@ -0,0 +1,4 @@ +[app] +build_directory = "./" +sdk = "C" +devices = ["nanos", "nanox", "nanos+", "stax"] From 3626abed8f16571fcb08ebb155ec9c6025523946 Mon Sep 17 00:00:00 2001 From: Z4karia Date: Mon, 3 Jun 2024 11:39:50 +0200 Subject: [PATCH 07/15] update sdk --- ethereum-plugin-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index 8fe6572..35a7f76 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit 8fe6572458355828097fa5183a41c83ccb25fece +Subproject commit 35a7f7650e3aab943093ea608016f1c107539db6 From 9b1e707e308d34ac72d350e95be74f42849e8da9 Mon Sep 17 00:00:00 2001 From: Z4karia Date: Mon, 3 Jun 2024 11:54:38 +0200 Subject: [PATCH 08/15] fix build issues + lint --- .clang-format | 1 - src/handle_init_contract.c | 1 - src/handle_query_contract_ui.c | 11 ++++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.clang-format b/.clang-format index b4abfa0..c76e9fc 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,6 @@ SortIncludes: false SpaceAfterCStyleCast: true AllowShortCaseLabelsOnASingleLine: false AllowAllArgumentsOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Never AllowShortFunctionsOnASingleLine: None BinPackArguments: false diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index cdbeea8..04bf657 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -1,5 +1,4 @@ #include "stakekit_plugin.h" -#include "utils.h" // Called once to init. void handle_init_contract(void *parameters) { diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index a8dce10..44bc2b5 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -93,11 +93,11 @@ static bool set_send_value_ui(ethQueryContractUI_t *msg, plugin_parameters_t *co if (msg->pluginSharedRO == NULL) { PRINTF("Error: msg->pluginSharedRO is NULL\n"); - return; + return false; } if (msg->pluginSharedRO->txContent == NULL) { PRINTF("Error: msg->pluginSharedRO->txContent is NULL\n"); - return; + return false; } // Convert to string. @@ -194,7 +194,7 @@ static void set_receive_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *con // Utility function to print an address to the UI. static bool print_address(ethQueryContractUI_t *msg, uint8_t *address) { if (msg == NULL || msg->msgLength <= MIN_MSG_LENGTH) { - return; + return false; } // Prefix the address with `0x`. msg->msg[0] = '0'; @@ -325,14 +325,15 @@ static bool set_smart_contract_ui(ethQueryContractUI_t *msg, plugin_parameters_t if (msg->pluginSharedRO == NULL) { PRINTF("Error: msg->pluginSharedRO is NULL\n"); - return; + return false; } if (msg->pluginSharedRO->txContent == NULL) { PRINTF("Error: msg->pluginSharedRO->txContent is NULL\n"); - return; + return false; } return print_address(msg, msg->pluginSharedRO->txContent->destination); +} // Set UI for unbound nonce boolean screen. // Each methods sets the title and the message to be displayed on the screen. From 18d7af44eda87039a027c22251a9f997e119fbcb Mon Sep 17 00:00:00 2001 From: Z4karia Date: Mon, 3 Jun 2024 12:19:32 +0200 Subject: [PATCH 09/15] ci: recurse submodules when cloning app-eth --- .github/workflows/ci-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index fc897b3..f472f0f 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -117,6 +117,7 @@ jobs: with: repository: LedgerHQ/app-ethereum ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }} + submodules: true - name: Build run: | From 845482a4137c00aa8d9ae208ff9769bac3f5ea04 Mon Sep 17 00:00:00 2001 From: Z4karia Date: Mon, 3 Jun 2024 12:48:05 +0200 Subject: [PATCH 10/15] fix function types --- src/handle_query_contract_ui.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 44bc2b5..203a4f3 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -115,7 +115,7 @@ static bool set_send_value_ui(ethQueryContractUI_t *msg, plugin_parameters_t *co // Set UI for "Send 2" screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_send_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_send_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case LIDO_CLAIM_WITHDRAWALS: strlcpy(msg->title, "Request ID", msg->titleLength); @@ -123,7 +123,7 @@ static void set_send_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *contex default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } amountToString(context->contract_address, // Location of the 2nd request ID. @@ -132,6 +132,7 @@ static void set_send_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *contex context->ticker_sent, msg->msg, msg->msgLength); + return true; } // Set UI for "Receive" screen. @@ -172,7 +173,7 @@ static bool set_receive_ui(ethQueryContractUI_t *msg, plugin_parameters_t *conte // Set UI for "Receive 2" screen. // Each methods sets the title and the message to be displayed on the screen. -static void set_receive_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { +static bool set_receive_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *context) { switch (context->selectorIndex) { case LIDO_CLAIM_WITHDRAWALS: strlcpy(msg->title, "Hint", msg->titleLength); @@ -180,7 +181,7 @@ static void set_receive_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *con default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } amountToString(context->recipient, // Location of the 2nd hint. @@ -189,6 +190,7 @@ static void set_receive_2_ui(ethQueryContractUI_t *msg, plugin_parameters_t *con context->ticker_sent, msg->msg, msg->msgLength); + return true; } // Utility function to print an address to the UI. From 41a43abc8dfb6812726bc8a229a390d509db91dc Mon Sep 17 00:00:00 2001 From: Z4karia Date: Mon, 3 Jun 2024 13:34:16 +0200 Subject: [PATCH 11/15] fix ui function calls --- src/handle_query_contract_ui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 203a4f3..e1bea23 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -697,10 +697,10 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { ret = set_unbound_nonce_ui(msg, context); break; case SEND_2_SCREEN: - set_send_2_ui(msg, context); + ret = set_send_2_ui(msg, context); break; case RECEIVE_2_SCREEN: - set_receive_2_ui(msg, context); + ret = set_receive_2_ui(msg, context); break; case WARN_SCREEN: ret = set_warning_ui(msg, context); From fcb6058c0004ecb2afc7f150fd5bf88320f266ee Mon Sep 17 00:00:00 2001 From: Z4karia Date: Mon, 3 Jun 2024 13:37:10 +0200 Subject: [PATCH 12/15] chore: update app version to 1.2.2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6eeda50..19b87c4 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,6 @@ APPNAME = "StakeKit" # Application version APPVERSION_M = 1 APPVERSION_N = 2 -APPVERSION_P = 1 +APPVERSION_P = 2 include ethereum-plugin-sdk/standard_plugin.mk From 89c12f39e751363ad5a1c0acbbd9c31f6802b64c Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 14:56:54 +0200 Subject: [PATCH 13/15] Update plugin sdk --- ethereum-plugin-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index 35a7f76..0afd2a9 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit 35a7f7650e3aab943093ea608016f1c107539db6 +Subproject commit 0afd2a969eb23e8a508560e0e308dc51fb9219e0 From ec6c3ff98511cae7249ba8b3e7c8fa9b326c5b46 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 18:11:40 +0200 Subject: [PATCH 14/15] Add Flex support --- icons/flex_app_stakekit.gif | Bin 0 -> 425 bytes ledger_app.toml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 icons/flex_app_stakekit.gif diff --git a/icons/flex_app_stakekit.gif b/icons/flex_app_stakekit.gif new file mode 100644 index 0000000000000000000000000000000000000000..f14ba18650d578c978dd9ef24b95c0e78f4590d7 GIT binary patch literal 425 zcmZ?wbhEHb)L_tH_{_}!1gxyA+}zwEA|krFx`~O2bLY;zaN)v>7cahi`SSDU&;S4b zgA~Dl;!hSZQ}I8yXKrG8s&8U?W^y)PdSY&FqOF0Ri75y&=z!FKY+zvdS8&pE^8+)|9a=3(2q$TV|H_ zuEKzqx%r|`_Li!{tQQnF8nDcKI`>hjLx@mdX3V-B8a&Ab?$QlTOicN%%@Xx-rYs7L z4AtF2^^+J_v^l&?S!<^Xx0=rqnqxkto2}2pPney#b7j$Lr={!HY?kKOYRb5MQRn1^ zdrkdvL@MV^O$5>YqfGJ&WBFrxZ`Y@ z72^l_O9~ERS&i*XYj#CyN35HyU%_MCQ?*3@5i2uawBweD#3Wv3OBTzh zPZ22#PO#Q~P&uRWR)sxId+W}e#eBDXf+aIqev}k5u2KA1_3I4ho3zE|My+}uCZ0TC LveZ_Yfx#L8x{{ms literal 0 HcmV?d00001 diff --git a/ledger_app.toml b/ledger_app.toml index 376e254..7329320 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,7 +1,7 @@ [app] build_directory = "./" sdk = "C" -devices = ["nanos", "nanox", "nanos+", "stax"] +devices = ["nanos", "nanox", "nanos+", "stax", "flex"] [tests] -pytest_directory = "./tests/" \ No newline at end of file +pytest_directory = "./tests/" From 954bd98391f2af86be7a6c73e96e11fec419624b Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Thu, 18 Jul 2024 15:48:20 +0200 Subject: [PATCH 15/15] Add reusable build CI --- .github/workflows/release-build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/release-build.yml diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..ca465e5 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,18 @@ +--- +name: Release build + +on: + workflow_dispatch: + push: + branches: + - main + - master + - develop + pull_request: + +jobs: + build: + name: Build application using the reusable workflow + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 + with: + upload_app_binaries_artifact: "compiled_app_bindaries"