From e5a3108b721ab2fcce5ce0d0704de730b6cac4d7 Mon Sep 17 00:00:00 2001 From: WGB5445 <919603023@qq.com> Date: Wed, 12 Oct 2022 21:36:32 +0800 Subject: [PATCH] add some function in Compare (#180) --- .../bytecode_modules/Compare.mv | Bin 604 -> 695 bytes build/StarcoinFramework/docs/Compare.md | 111 ++++++++++++++++++ .../source_maps/Compare.mvsm | Bin 6647 -> 7436 bytes sources/Compare.move | 23 ++++ 4 files changed, 134 insertions(+) diff --git a/build/StarcoinFramework/bytecode_modules/Compare.mv b/build/StarcoinFramework/bytecode_modules/Compare.mv index 670997b1add99bfab78ea3eae1d9fe90cba9473e..cb60f4b6abb57d4b044ea16ba53fbc64fcfec4ed 100644 GIT binary patch delta 226 zcmXwyJqiLr3`X;1GP5(Ipa-zoLK_Pa3oqb3WQ)ZgmIYm{J%PpI32Z!ojrXt?3tJ1X zU{(;4$NLgO9&)pXbMM^}BJv=-2XS;km-z~GUt+~jn g>KE$k5Vn3E(K;3Q^hLjWiIh;v_U}m9{hd>$FK{&=iU0rr delta 117 zcmdnadWR)uq0DP;76t|e4n_tRW)=k&6&6+vefDq{j@gU?Y^xbLdA2Y%F$3ip8JK{W zff+=wFaZfxW<~}^HdZzu$ + + + +## Function `is_equal` + + + +
public fun is_equal(result: u8): bool
+
+ + + +
+Implementation + + +
public fun is_equal(result: u8): bool {
+    result == EQUAL
+}
+
+ + + +
+ +
+Specification + + + +
aborts_if false;
+
+ + + +
+ + + +## Function `is_less_than` + + + +
public fun is_less_than(result: u8): bool
+
+ + + +
+Implementation + + +
public fun is_less_than(result: u8): bool {
+    result == LESS_THAN
+}
+
+ + + +
+ +
+Specification + + + +
aborts_if false;
+
+ + + +
+ + + +## Function `is_greater_than` + + + +
public fun is_greater_than(result: u8): bool
+
+ + + +
+Implementation + + +
public fun is_greater_than(result: u8): bool {
+    result == GREATER_THAN
+}
+
+ + + +
+ +
+Specification + + + +
aborts_if false;
+
+ + +
diff --git a/build/StarcoinFramework/source_maps/Compare.mvsm b/build/StarcoinFramework/source_maps/Compare.mvsm index 6469c37cff4556057f1c157435b7c434dd73c984..025b415635b8ff773f509f1398b7ebf0f13cf78e 100644 GIT binary patch literal 7436 zcma)=ZA{fw9LLYSgctRSfIJmhCIWIJ>4H3jYl|97C$j`=#Y)HYW)_bc)Jn6KSwd^8 z7e$Z|Bol4x!JIB1KvCvwYi%{QTr;R%SgjY$wNjg{&tdm$z55=v&kMHC{r=DY-1EEt z@4dn9#O+;Eh5e6Scrm^4tCncr!Lpa0nh33b^Wmwn;?$z$xyG0X1mORFfzW-e&25ca zV~C4bq+RnCx#lZq*C5msYw=md!r8_w0ke#FvCo&t{S^Yz{0{3k2ujo4T7opg ztTGvHkmhx+JRdVrnr^pdNwb)|D1@Y0id6o7^KmmznwK&EgnViKg>?lAr1>+}Rah#`pW~QC&68N8kSR^KPF=c2$oqPpPnG%`^D5{n^$*r{ z&{gUetbbvVyrWBTQ&*`J?j{X%l}g9T1YM;9SXrQ}6o-Ar)KzMlJIcn^Rmwd_bd`#b zR|2|9m19+au2Q8~WuU86KGu_<3({(=2GC`uE^bEU32~Vv(i|ppKa@)IAl65qtJDbA z0nk|7Nrnu^v2rGipG4%&I<>?`_0!z?BWEJ?`>olKaqs`z+{2^a9on(2eLhtmi>D zBDYfAb9R!q3v|zMnYz8aLtYQ)_R@#77j%1h533h+dvWim?j!@`jezbXE>ky+Bjnlh zq??Az)J?nUNf}=ai=}Y`ghn@(O$Ev&rF>_{2hE|sxR*P%+vtxAn2JI z#@Y{hriQTgfu1S1Qaw`#$om-dOu0-wQ>Vxq2R&00Sm!{`)ETU^pl8axqk5*!llKki znR1zWrl!fW=Sk0$%hWUFcHZMlV>p$P4<;~cYiwIb(=+PZa0YUYeF5R}K@ml)0DY)e zVBG`yP*-AAfj-ps>NeBk8*yfuF?ry<4f)7L_60uMa4+IY(A!Xp^$6%~ScSD3^fuV5 z+f0vK3ZKg>`tXca|buAw^ cwKeti8`iC?UK2Fo`|E0|*VWX`{2MU;0V*dT2LJ#7 literal 6647 zcma)=TWn2P9EaCA)oF25X{#NVVHD+zp%*PG^U%;B8bfPdPG&U185+HsC~-+MalgFq zAXS%YX<8$}bSA`QibEs3NX#_B#3&vxJWOQVDrCOhoR!SmZ#DTIntb`~wbx$%y?;5G zp5e7HPZQM$CETBV;wz6Aa< znf*J9=U?eSSjjGw{hLatG^g@JrL)T8uOUtTF-m zNb>_%9*7w$O}ks4NOLlISr8}99IRZ3mu3c59`u!_eMlk+jrA5Xr1==@9gLUeqo_GSni0$%2ujm_nZA%_fXPUPiPB8- zW(dBNW(rm+Op<0iRuD3!IV@^Uk>=>AnJZ13nI}!V&Z*Ko%hfx;;S<}1_Lrx+l%5BO z55b}I{Dbxq;#^A4semz8z`68vA>Rjw(z6+DYp*IxPd!?Lrzv zy6h_;Nv`uec^4sBnwPM=*Gh^sf5Ym4A=0$#)TOJ9yjufYs?;0Icc81(d#n$jtJG7h zkD#m6lc=eyR3djX7<83N#u@^;O8Kx-L02gbd#|ahR5y2&hOMiV{f_7=6(lbkbd}1( znhLr~_9%#vr`W@byXh0IpSk>*cWCqP%JHmu{ItJD#! zX3$lt1M4#ADs>g>8cdUSbOkE{)1`S1>jLCU)4Osf%#h~z1Y;(H!v}tDqA?4A%BO!b zT8LNz4!;?N(7yFlm&&&nF#@=Z3Nwj)?%##-H7Z;b5Mo*+*VI==O2|>k#PnvLCAfbbGN+RCkg_^4dUm5}T=;#u@Uw^Q4=G&D2f9 z?!3c;ujOcN0H>MSh*$>>GqnY6o2R;4)JOqOQwKHR3jbo~ahBR?sumjCBn3 zOxcy{nL1A1NzgN8GxbbeCNBbdraG~%gPy6YSl2+$lzpOlrf!gT8}v-sOg&TGy7Gi7()#KaaZ{HCCYoh>RXDJfkvr(nL{1ZEc(7Az_(?)}$i{sZZvGd=(S diff --git a/sources/Compare.move b/sources/Compare.move index b4ee466a..45e20df5 100644 --- a/sources/Compare.move +++ b/sources/Compare.move @@ -104,6 +104,29 @@ module Compare { aborts_if false; } + public fun is_equal(result: u8): bool { + result == EQUAL + } + + spec is_equal { + aborts_if false; + } + + public fun is_less_than(result: u8): bool { + result == LESS_THAN + } + + spec is_less_than { + aborts_if false; + } + + public fun is_greater_than(result: u8): bool { + result == GREATER_THAN + } + + spec is_greater_than { + aborts_if false; + } } }