From aa844166b743fce7b1afcd50a5730e96c4ffa45b Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Mon, 11 Dec 2017 23:10:53 +0700 Subject: [PATCH] Add codeDepositCost and gasStation img in png --- .DS_Store | Bin 0 -> 8196 bytes assets/.DS_Store | Bin 0 -> 6148 bytes assets/img/.DS_Store | Bin 0 -> 6148 bytes assets/img/gasStation_50.png | Bin 0 -> 960 bytes src/app/editor/contextView.js | 12 +++++++++--- src/app/editor/contextualListener.js | 7 ++++--- 6 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .DS_Store create mode 100644 assets/.DS_Store create mode 100644 assets/img/.DS_Store create mode 100644 assets/img/gasStation_50.png diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..21e42f8ebdb9a8355d9050597005a33cceae41a7 GIT binary patch literal 8196 zcmeHML2lDP6#dht;H0f+C8T!g4HApCYLQA72q~oPq7ooP5G(+-c487!*REoxX$e8u zaEEdPZo&i^i!&5sY0h1LeX*EWjJh2 z+mW)0PD0U1=#hoaP=p*EJXgX=)ReWYRlq7Ru7G+0utq+4sJZ;zj}jkn{yIHCz57cR z>7Ybw)TWR!&hvA)uLiDijsvz$F(r665EMCL$>7X_lL6<^F<2>%PU(;$gZ0^9-2gtt zCjd7!us{EX_510OUcop2C<@bTef_(bnl8=Uxal|*r!rr8+vp_yM&@O`wC;6Z^U*Ue z>-f6=B1xi)zURLTgZ|#a?X4uvyf6;Bk{q@IK;FCx<5tqIC%w3pNb1K^{2;uVK-f;Hc*@jvPC|{MRs_nA!%OBcI1tfakRabOJ^P zb06DTyk_C#)?A^-v`bsGLrm;<+}2oC@?Bg!{}VgiMr%RnFdF{k^FO~60AZVRf5vIhs`@0 z?}i_RwQ3x6^5wUu4^}|kqRPDQ3p{K@TdV?COo3@NpJmSfcP798zhbkt)3FLz1^%T1 zqO{%EuEXQ`PfF7{=h`mnJ}MW+jg*xXG%_8BmFYO_#UF;~yMQvMrtL^soI&~TF9ML! N*yq2L-Zs}*f#2m;q%Hse literal 0 HcmV?d00001 diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e3562e55f6482ff65267714d687da39948a8d5ec GIT binary patch literal 6148 zcmeHK%}&BV5T4~n7mSgE2_Abf@xTF0kb^O45D(r=YV@E6TR>=1x`q~sBBqa_kKmj5 z20o6?{$PUO)xXRnv)}CO%x?E=rz80b49Itvh89E+9R@S+Zx=_l-jt|~WZ?<~gb>d~K7Wc#gAaY^&d$e*i=(_z zbZx$x7wh zM$N+dz6fL24?6>u?6*4@a(?QEZ855gVc3q;JdPgVJjZj*LUBCau2xG{wK6GL<65m; zvUX~<$t1^%o0Yx8%l_@%_JtV4+I14JI1Z(SeOB0T46jR)V(r`A4**1JO2^XhaVR z)2WC$m6;NQnc9KrbR4%$e4Y5PhpD0yeP`%Pp;f5v**E5DV-4fM`?>;gS=LV!40EU#aiytjd{d6_FX3 zeRH!jv%3#&KLCX3)6E1J0T@z+K}L_r-P^TOf`uX1*x(8q+@Zy~r_f(?Y3}=|Iqyfz zIrp#mFK~)ujB(Gk)E7;Ay=>Ygqeay#_2?}NE#LqTxW$Sqf58F`*I!drVS*F-496Vf zd8^jhw_3TNH_m`F;0!ne&cKf`z%yGi+%xpn8E^)iflmgsKSZjqDwquO*1<;CXY~(+ z656^T3uD2mU@~M6C0HuaQbT!S1WTtsmbj{5GPHDrJTmK)kv|?UA&*Xf%;5-?p|{R} zGtgyV*FHx&|Ihi$^gi;tDgNaQI0OHTfiRfOXHzb!oUL2S(^(s-msE-3k_-y%&Lw~! h+D8s^r}anKjH?PJLsgMKrxX1mkO}d|8TbVT-T@X8F023m literal 0 HcmV?d00001 diff --git a/assets/img/gasStation_50.png b/assets/img/gasStation_50.png new file mode 100644 index 0000000000000000000000000000000000000000..67586093854531f693190b8a27449d9d50f7876b GIT binary patch literal 960 zcmV;x13&zUP)(^b8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H113gJZK~!jg)!I#{RaF!R@SpG5Q}e433(Aj|AH9K)ghVfC&?F3+ zgfz5)1&x#@=|ub}90Vl|BE(V9CpkdvRXKur z_mjkvGe9CMpY*EJvkG*dfz}xsD(v9J3EXXTUCj#dR zbQ^G3Zn+o)B4v01A7sKH6M=1bjlm}ZALFrhL>AtMhI?J-LhNWq3P0uKhw)rw^HL=L7+2DdH2%v1GTS4Yqozk?TuAe?XIJn* zszjCu_m_FQQ#dB9{CRzR^^g=1*j>Z-3YL;)ijv_yt(kC)2DWHT`|ly85h2`v>=H8K z%zjch9vY90H{yGo5#9uvX(Bh8ZJ)wN!Un4di-hCW(zlAv^r7=r<;}8=R$)lZHw$JE imG|joNO`h%gnt2xeAGv9m7x6q0000` function showGasEstimation () { - var estimatedGas = self._api.contextualListener.gasEstimation(node) + ' gas' - if (node.name === 'FunctionDefinition') var el = yo`
${estimatedGas}
` - return el + var result = self._api.contextualListener.gasEstimation(node) + var executionCost = 'Execution cost: ' + result.executionCost + ' gas' + var codeDepositCost = 'Code deposit cost: ' + result.codeDepositCost + ' gas' + var estimatedGas = result.codeDepositCost ? `${codeDepositCost}, ${executionCost}` : `${executionCost}` + return yo`
+ + ${estimatedGas} +
` } + } } diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index d1ca121276..c580e9f685 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -99,6 +99,7 @@ class ContextualListener { if (this.estimationObj.external) this.externalFunctions = Object.keys(this.estimationObj.external) if (this.estimationObj.internal) this.internalFunctions = Object.keys(this.estimationObj.internal) this.creationCost = this.estimationObj.creation.totalCost + this.codeDepositCost = this.estimationObj.creation.codeDepositCost } gasEstimation (node) { @@ -106,13 +107,13 @@ class ContextualListener { if (!node.attributes.isConstructor) { var functionName = node.attributes.name if (this.externalFunctions) { - return this.estimationObj.external[this._getFn(this.externalFunctions, functionName)] + return {executionCost: this.estimationObj.external[this._getFn(this.externalFunctions, functionName)]} } if (this.internalFunctions) { - return this.estimationObj.internal[this._getFn(this.internalFunctions, functionName)] + return {executionCost: this.estimationObj.internal[this._getFn(this.internalFunctions, functionName)]} } } else { - return this.creationCost + return {executionCost: this.creationCost, codeDepositCost: this.codeDepositCost} } } }