From c11d4ef0f0f16e6529a3305aca5471bc7e67f5f7 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 27 May 2019 22:01:39 -0300 Subject: [PATCH 01/81] (add) base elements for new network selector --- apps/block_scout_web/assets/css/app.scss | 2 + .../css/components/_network-selector.scss | 283 ++++++++++++++++++ .../assets/css/components/_radio.scss | 49 +++ .../network-selector-icons/aerum-mainnet.png | Bin 0 -> 4225 bytes .../callisto-mainnet.png | Bin 0 -> 2871 bytes .../network-selector-icons/callisto.svg | 7 + .../images/network-selector-icons/core.svg | 4 + .../images/network-selector-icons/dai.svg | 33 ++ .../ethereum-classic.png | Bin 0 -> 2965 bytes .../ethereum-mainnet.png | Bin 0 -> 3634 bytes .../network-selector-icons/goerli-testnet.png | Bin 0 -> 4936 bytes .../network-selector-icons/kovan-testnet.png | Bin 0 -> 2846 bytes .../network-selector-icons/poa-core.png | Bin 0 -> 1639 bytes .../network-selector-icons/poa-sokol.png | Bin 0 -> 1714 bytes .../rinkeby-testnet.png | Bin 0 -> 2171 bytes .../images/network-selector-icons/rinkeby.svg | 15 + .../ropsten-testnet.png | Bin 0 -> 1736 bytes .../images/network-selector-icons/ropsten.svg | 4 + .../network-selector-icons/rsk-mainnet.png | Bin 0 -> 3811 bytes .../images/network-selector-icons/sokol.svg | 4 + .../network-selector-icons/xdai-chain.png | Bin 0 -> 7638 bytes .../layout/_network_selector.html.eex | 51 ++++ .../layout/_network_selector_item.html.eex | 25 ++ .../templates/layout/_topnav.html.eex | 1 + 24 files changed, 478 insertions(+) create mode 100644 apps/block_scout_web/assets/css/components/_network-selector.scss create mode 100644 apps/block_scout_web/assets/css/components/_radio.scss create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/aerum-mainnet.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/callisto-mainnet.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/callisto.svg create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/core.svg create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/dai.svg create mode 100755 apps/block_scout_web/assets/static/images/network-selector-icons/ethereum-classic.png create mode 100755 apps/block_scout_web/assets/static/images/network-selector-icons/ethereum-mainnet.png create mode 100755 apps/block_scout_web/assets/static/images/network-selector-icons/goerli-testnet.png create mode 100755 apps/block_scout_web/assets/static/images/network-selector-icons/kovan-testnet.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/poa-core.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/poa-sokol.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/rinkeby-testnet.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/rinkeby.svg create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/ropsten-testnet.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/ropsten.svg create mode 100755 apps/block_scout_web/assets/static/images/network-selector-icons/rsk-mainnet.png create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/sokol.svg create mode 100644 apps/block_scout_web/assets/static/images/network-selector-icons/xdai-chain.png create mode 100644 apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex create mode 100644 apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex diff --git a/apps/block_scout_web/assets/css/app.scss b/apps/block_scout_web/assets/css/app.scss index 3838fd96c1..469e9ab5c4 100644 --- a/apps/block_scout_web/assets/css/app.scss +++ b/apps/block_scout_web/assets/css/app.scss @@ -121,6 +121,8 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/api"; @import "components/alerts"; @import "components/errors"; +@import "components/radio"; +@import "components/network-selector"; :export { dashboardBannerChartAxisFontColor: $dashboard-banner-chart-axis-font-color; diff --git a/apps/block_scout_web/assets/css/components/_network-selector.scss b/apps/block_scout_web/assets/css/components/_network-selector.scss new file mode 100644 index 0000000000..cfa79942d2 --- /dev/null +++ b/apps/block_scout_web/assets/css/components/_network-selector.scss @@ -0,0 +1,283 @@ +$network-selector-overlay-background: $modal-overlay-color !default; +$network-selector-close-color: $primary !default; +$network-selector-horizontal-padding: 28px; +$btn-network-selector-load-more-background: #fff !default; +$btn-network-selector-load-more-color: $primary !default; +$network-selector-search-input-color: #a3a9b5 !default; +$network-selector-tab-active-border-color: $primary !default; +$network-selector-item-icon-dimensions: 30px !default; + +.network-selector-overlay { + background-color: rgba($network-selector-overlay-background, 0.9); + bottom: 0; + display: flex; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 123; +} + +.network-selector { + background-color: #fff; + display: flex; + flex-direction: column; + flex-grow: 1; + flex-shrink: 1; + margin-left: auto; + max-width: 398px; + padding: 28px 0 35px; +} + +.network-selector-close { + flex-shrink: 0; + padding: 0 $network-selector-horizontal-padding; + margin: 0 0 8px; + + svg { + cursor: pointer; + display: block; + margin-left: auto; + } + + path { + fill: $network-selector-close-color; + } +} + +.network-selector-text-container { + flex-shrink: 0; + margin: 0 0 15px; + padding: 0 $network-selector-horizontal-padding; +} + +.network-selector-title { + color: #333; + font-size: 18px; + font-weight: normal; + line-height: 1.2; + margin: 0 0 10px; + padding: 0; +} + +.network-selector-text { + color: #a3a9b5; + font-size: 12px; + font-weight: normal; + line-height: 1.67; + margin: 0; + padding: 0; +} + +.network-selector-search-container { + align-items: center; + background-color: #f5f6fa; + display: flex; + flex-shrink: 0; + height: 62px; + margin: 0; + padding: 0 $network-selector-horizontal-padding; + + path { + flex-grow: 0; + flex-shrink: 0; + fill: $network-selector-search-input-color; + } +} + +.network-selector-search-input { + background-color: transparent; + border-color: transparent; + color: #333; + flex-grow: 1; + font-size: 14px; + font-weight: 600; + height: 100%; + outline: none; + padding: 0 20px 0 10px; + + &[placeholder]{ + color: $network-selector-search-input-color !important; + } + &::-webkit-input-placeholder { /* Chrome/Opera/Safari */ + color: $network-selector-search-input-color !important; + } + &::-moz-placeholder { /* Firefox 19+ */ + color: $network-selector-search-input-color !important; + } + &:-ms-input-placeholder { /* IE 10+ */ + color: $network-selector-search-input-color !important; + } + &:-moz-placeholder { /* Firefox 18- */ + color: $network-selector-search-input-color !important; + } +} + +.network-selector-tabs-container { + border-bottom: 1px solid $base-border-color; + display: flex; + flex-shrink: 0; + margin: 0 $network-selector-horizontal-padding; +} + +.network-selector-tab { + color: #a3a9b5; + cursor: pointer; + font-size: 14px; + font-weight: 600; + line-height: 1.2; + padding: 20px 20px 15px; + position: relative; + text-align: center; + + &:hover { + color: #333; + } + + &.active { + color: #333; + + &::after { + background-color: $network-selector-tab-active-border-color; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + bottom: 0; + content: ""; + height: 4px; + left: 0; + position: absolute; + right: 0; + } + } +} + +.network-selector-tab-content { + display: none; + + &.active { + display: block; + } +} + +.network-selector-item { + border-bottom: 1px solid $base-border-color; + display: flex; + position: relative; + + .radio { + margin: 0 15px 0 0; + } + + .radio-icon { + margin: 0; + } + + &:last-child { + border-bottom: none; + } +} + +.network-selector-item-url { + align-items: center; + cursor: pointer; + display: flex; + flex-grow: 1; + margin: 0; + padding: 20px 20px 20px 0; +} + +.network-selector-item-icon { + background-color: #dfdfdf; + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: contain; + border-radius: 50%; + flex-grow: 0; + flex-shrink: 0; + height: $network-selector-item-icon-dimensions; + margin: 0 15px 0 0; + width: $network-selector-item-icon-dimensions; +} + +.network-selector-item-title { + color: #333; + flex-grow: 1; + font-size: 14px; + font-weight: normal; + line-height: 1.2; + overflow: hidden; + text-align: left; + text-overflow: ellipsis; + white-space: nowrap; +} + +.network-selector-item-type { + color: #a3a9b5; + flex-shrink: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.2; + padding-left: 10px; + text-align: right; + white-space: nowrap; +} + +.network-selector-item-content { + align-items: center; + display: flex; + flex-grow: 1; +} + +.network-selector-networks-container { + flex-grow: 1; + flex-shrink: 1; + margin: 0 0 30px; + min-height: 100px; + overflow: auto; + padding: 0 $network-selector-horizontal-padding; +} + +.network-selector-load-more-container { + flex-shrink: 1; + padding: 0 $network-selector-horizontal-padding; + + .btn-network-selector-load-more { + @include btn-line($btn-network-selector-load-more-background, $btn-network-selector-load-more-color); + width: 100%; + } +} + +.network-selector-item-favorite { + align-items: center; + cursor: pointer; + display: flex; + flex-grow: 1; + flex-shrink: 0; + margin: 0; + max-width: 16px; + position: relative; + + input[type="checkbox"] { + cursor: pointer; + height: 100%; + opacity: 0; + position: absolute; + width: 100%; + z-index: 5; + + &:checked + svg { + position: relative; + z-index: 1; + + path { + fill: #ffb20d; + } + } + } + + &:hover { + path { + fill: rgba(#ffb20d, 0.4); + } + } +} \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/components/_radio.scss b/apps/block_scout_web/assets/css/components/_radio.scss new file mode 100644 index 0000000000..ebcc2ac892 --- /dev/null +++ b/apps/block_scout_web/assets/css/components/_radio.scss @@ -0,0 +1,49 @@ +$radio-color: $primary !default; +$radio-dimensions: 20px !default; + +.radio { + align-items: center; + display: flex; + position: relative; + + input[type="radio"] { + height: 100%; + opacity: 0; + position: absolute; + width: 100%; + z-index: 5; + + &:checked + .radio-icon::before { + background-color: $radio-color; + border-radius: 50%; + content: ""; + height: 12px; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: 12px; + } + } + + .radio-icon { + border: 1px solid $base-border-color; + border-radius: 50%; + flex-grow: 0; + flex-shrink: 0; + height: $radio-dimensions; + margin: 0 10px 0 0; + position: relative; + width: $radio-dimensions; + z-index: 1; + } + + .radio-text { + font-size: 14px; + font-weight: normal; + line-height: 1.2; + position: relative; + white-space: nowrap; + z-index: 1; + } +} diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/aerum-mainnet.png b/apps/block_scout_web/assets/static/images/network-selector-icons/aerum-mainnet.png new file mode 100644 index 0000000000000000000000000000000000000000..cdef9a2edb814eeebcb9317e0fae60b4a858f6ac GIT binary patch literal 4225 zcmaJ_c{r47{~v3XP?T(G>?+Jy#xj=3I`)0v$IKYa(ijZk5Lt>GTSP*R64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v=l99jhll1z@_SI%U`0Z~Y6TXpFu9 literal 0 HcmV?d00001 diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/callisto-mainnet.png b/apps/block_scout_web/assets/static/images/network-selector-icons/callisto-mainnet.png new file mode 100644 index 0000000000000000000000000000000000000000..2e9f2b2730b309d9df7f0216700bebf5a638ac26 GIT binary patch literal 2871 zcmbVO2~<;88cxD0h`6F?fiw;(l`JnLA$cSSSrDpWGs-qvUXlk%N%CS|fPh$tOWluJ z2kL@pI#QRSxFQu)GA`g$mRKD{aE8br&_O^H$K`;|3tQ_Po#UBz&b#j}-~ZkJ`|p4M z^R~oBFZOVo?S{kQJfb3n@z^)n{<=D2E&FIV0sBnQMkb*+oclEUi^uIRo`u6XJyl8) z^@-x8pbSw{AUPt1DF(F`L*sDVMFuS-%YgMnDV(m<@JM}C)g+=)&Lbr-#Wb;204tP{ zxjJ}RZnQ*}n<3-KNsB^>Tmy&^s9`-sG^kY?6g2Qi!@MBYw@*_^#9@d&gGUOtZ%9lO z#}WmI4kj`wEV2w>Fp0q&3cw0ta5#ZPIt^e`X>2MGL${kEGD+wIG$6ot;g|4x%8sbSl8%aHupol};yP2r`9jDcxqhZ1VMm0cMDnOyxC5-{a;{Od*tH;r(J|6zf-}e%u zk{m5ejfYVrQzwHl_}sCrP`xM%b8%GcM;ME;V2ysAq>3&fC2sj*WB*j0^M z!9qw6^GJ3CnZ_j3gC%qTWY9r6K&AzOG};JMjL4N~Iq!oqF;MV3P%P=>kRJLNuviR6 zX;3|+k-`NSxZfCX?^ zEHa$}*sll{2D>m=r_6%o5jsRo98O(O`JPa57&JyOEm-tnsUx=X4~L2ML0js$Gm%OZ z%dec#3a|`bJ=#+#G2gJ80YWnSZN>yan9roq$@e+@ac4V1nyr8_%6C)qoqQXCp-7rO z8`8ny=~y0oWd4s>$`p_$9mYy5m1NgSwHKoianzAR_)Yil+V2Y27#ypH_U?EY#s=es z9M)jeI;>0|&ZFJL;T*f8gy9lHb5F5)v)A(Jw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zM;5;feKbf*NbzZ|027z<{2S}<|5Vo&E99=NKda7Mf17tN%VAC1%xmqI?&6MKhOL6W zqv?8s@J9~@;L+^6GjGi?w4V5cdvzdmY25h@nKh61`1U=%)m`oft-r46xwPceUsuzg zEU)AF>dMp=f4nHFih6tU-obuGGr#2TZo-`jUGlzxK>iHhfs?F<^{4%x&rSg*84hQp z9BlqN?1;I%sAI>}E`1ns8b+thw{CUJJt_W5U9M=Hjvx5${L=&B9^^iAuutQeB=f@V z^fzmL$}&szS + + + + + + diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/core.svg b/apps/block_scout_web/assets/static/images/network-selector-icons/core.svg new file mode 100644 index 0000000000..63c66a6baa --- /dev/null +++ b/apps/block_scout_web/assets/static/images/network-selector-icons/core.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/dai.svg b/apps/block_scout_web/assets/static/images/network-selector-icons/dai.svg new file mode 100644 index 0000000000..c4f800733e --- /dev/null +++ b/apps/block_scout_web/assets/static/images/network-selector-icons/dai.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/ethereum-classic.png b/apps/block_scout_web/assets/static/images/network-selector-icons/ethereum-classic.png new file mode 100755 index 0000000000000000000000000000000000000000..5ca5d8fe7bbbe31f48a59dd2f908d48c7f723654 GIT binary patch literal 2965 zcmbVO2~-nV7NuQT6~q>h03j$UlBE(Li!2=y0zm^Y24w`4B2@{2Bo&fCg3f3QgONd_ z4Y&htalsasc5Ig(RFD=_gvO;2Sw=u{8O0G16bGCNOWK*%IiATmm8$yx-uvHu|NVC= zmmd{wXFb!}!otFi8^IQ!_vNO`avb`9_WG|e=*>zQ@dveqg^i=>`pRNgk+X%x#2%?I zRujux#1J8J0tg{VFhM6*qG$_?z!04h6s5u%Y!WPyDuQq?f4YRjN}(X!GJhV4r)0s& z(uh?mc*&|Lp=edAhz{XGg0X=*1}Y$j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pa?Cflxa60q1Z{z!s kBvtq~`~Nb$%$w0D+5X*&mCM%cm4DT_Ie9QH(sq6GA6;jw6aWAK literal 0 HcmV?d00001 diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/goerli-testnet.png b/apps/block_scout_web/assets/static/images/network-selector-icons/goerli-testnet.png new file mode 100755 index 0000000000000000000000000000000000000000..800590fee5a6b20f365d726451935eebdff86a99 GIT binary patch literal 4936 zcmbVQ2{_bi+m|gd)<#W{rZFePn0?HQ-B3*;Sx!TtF*BIV*34KdTb6K0lxnn)LzWPV zqDYdYNF7U&rG-SY)sV_JTD<3dzteZU*EiSopZ~M`e!u6w@8^E*>w5kPPL5lY71t_C zNl7V_x7s>O-X4pOg0$qn>VBu2iZE zOr>*u7{(!No&+r=Wo8+|qtXHxLa-0RkI6BIysxQ)fSGi2$S$k{!huI(_%pYL@fj{* zj;^$@02+Y~v9ti2g%BkIY=)2u4q>x60%C|c-7fKUc^V_;Y^|gr(`FQ1FN(K7%Uc@?E)H*3Vsb`l$jYkrsCq3)Xj_ z(wLk@X@f z6D732LnTQ^rwXb64cNhfNahHHR1S?nwl#-Hj5202=|n6Fg+-g-Q7{yWMu%aj7&;8^ zOJKmzcr2ZP#8GiLtj{;QBz#*gEpRc0KlyYCAAv_Au_kB)hJZFfBJBtS1QKnBw>7ag zv9?B$Ncf-J9ek$bq)}P_KMgvK=*#7^sgkr{vZ;OyIFI880WWP2k;G+j`I5j%qKp3f zIGIFp;&XkOEXjnxd5aC0Y)8T&2{;@KWsF=rB9bsHI>z8LgBbM9d@dXOEp>^^e+U)A zWHZtZjYIv~)$d&TFT;eg`z05?WXx8kK$2gfKPrF=WB-p9iz%^9ax#ci+Tv-JI7F4$ z4EZtmPX_;Yd;489*qp1z6t;G``g^#3fE7#q#7YxPFN#N{*J%$Sy5i_^aEn!{=+g>blv9 zDDh>Wm(eOs_j|zY4G3WabiXj9tEBd8cE!r!y2)a0WzdWh@I>3N_sYbVA$A$$v|BrS z%6B$8Z})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(I%cUtb;-^X1# zYx>DhW2a|!b$0F#vchK%+h+@b_JZ83JIBKg6vybi;zQ;#YQv64H}(8Ifx0ecg(#r+ zXv=uQ@T5s@*V1{-=7#Ci)9z`e!b?X>3MM4PsqTsHtx3(!lO?;hx2WxHI}f-z%wj{T zxV_`+Y2;a}OATrLY4<)!TWOqM$=PG6p^w&_c>Sv5#_N_fD<-6v3^(Vu`oei%hu99yx#x56xwf}mw42)<<*aX literal 0 HcmV?d00001 diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/poa-core.png b/apps/block_scout_web/assets/static/images/network-selector-icons/poa-core.png new file mode 100644 index 0000000000000000000000000000000000000000..68bb5976f15b7125fca21f56aaa8b663ba68d705 GIT binary patch literal 1639 zcmeAS@N?(olHy`uVBq!ia0vp^Q6S901SGegx)utgBuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFl%InM3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWnQpS7iK&9QrJkXg zv5BRnj)IYap@qJIg}$M&uA!NgiGh`okpdJb0c|TvNwW%aaf8|g1^l#~=$>Fbx5 zm+O@q>*W`v>l<2HTIw4Z=^Gj80#)c1SLT%@R_NvxE5l51Ni9w;$}A|!%+FH*nV6WA zUs__T1av9H3%LbwWAlok!2}F2{ffi_eM3D1ke6TzeSPsO&CP|YE-nd5MYtEM!Nnn! z1*!T$sm1xFMajU3OH&3}Rbb^@l$uzQUlfv`p92fUfQL?oT3Q+yxH*|P zn;JQ~8aTQ+xxw_h~)xn-XroG5X;Q2UXBl}3}*6~3lfs;t4{uD4Edm1U}VKc4YGqg2~T@QP>2 z)RJKDZCx`KT7`1!NiB>G;ug(u)a>Hh#^?9%$x=n%clY*`@AR(zRlEFB_4{@2pU-<< z`TxSYnEQ)kx18N3&1CVQfte4JXl7%VDLBB0OmOB_Gkv{Ro{)e3WOH5k{O&M#5Vp5efRP9>OR}l!tb|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~sBRpMN_jRP=LTnMp&-b-y+fvSj#&{>abhiqW{{>-9?g{HO?+^AjI> zD=)yOR+3ve!@Q{d%M0Y)pKjj?7PrVI+p82w%lZo#PWV`I ztW}#^^NINWJEOE*{rOHpr&kcR{IJu|4hyMc(`!3|qq1dOQIhJHBeX5+&zg&Ns{SSl z8+F06&v^95nL1Y}_m8{`g4uBRBY911biw__wrYmu>=Ft6s`mG{4~KtiVn7G=pU-^t z)wEFsV?b<6Pfy$JHQbiMJACf!_StM^6jBE}*VS{^X?Se@>|W<%?MeAgBQM4y`JI&k z@rC}^T*qL=$&K@^)(5hki)q^49sjjt)Jw;(N411jmQLFI7bzOB{OZ@}t%PuY_3wZu LZ6CFs5}x)S!$o_{ literal 0 HcmV?d00001 diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/rinkeby.svg b/apps/block_scout_web/assets/static/images/network-selector-icons/rinkeby.svg new file mode 100644 index 0000000000..1991096926 --- /dev/null +++ b/apps/block_scout_web/assets/static/images/network-selector-icons/rinkeby.svg @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/ropsten-testnet.png b/apps/block_scout_web/assets/static/images/network-selector-icons/ropsten-testnet.png new file mode 100644 index 0000000000000000000000000000000000000000..91581113dffb031bfe914a1290be32cd22683c8f GIT binary patch literal 1736 zcmaJ?X;2eq7!E3+I5<@hDsn7K6=_L!lR(HuA|MG6AvA<2h^??B8wil>x>-m7u~tE= z)QpPAC}k-18bv$Q4g&=v9;1|sFe(-6Q3s4#JU|5xz)reBj{Yd!`F6i!-sgF*=bPOj zi;s48@^E4>7|xOyk({1WZ13zD^ta)+o2%(*5hYHh5^*(UKuL@dp~BNKK%zx6Fgb>* z@;9_$p$x{%Wg0~?l`M@DC~++dwb`(YT7pJ17@=WC0##;X6p)T(Xmmnwpt%JEG%6vO z6fA|ML?o7}i76nl#DaK*vLIWDsKBrlK&Vkb6KF9C1&rDponBxRf@8b_dTl#~Kw!*- z$`*nj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ten.svg b/apps/block_scout_web/assets/static/images/network-selector-icons/ropsten.svg new file mode 100644 index 0000000000..87c98f79d2 --- /dev/null +++ b/apps/block_scout_web/assets/static/images/network-selector-icons/ropsten.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/rsk-mainnet.png b/apps/block_scout_web/assets/static/images/network-selector-icons/rsk-mainnet.png new file mode 100755 index 0000000000000000000000000000000000000000..c7c0e067c83fd0222cbee6d354e73ed5e2eb02b2 GIT binary patch literal 3811 zcmbVP2{@E%8%A~|TgZ|zLY7&LVJ1V<5VABeWT`aGe8a>n&5XS)6`@XK38gG8vL+>k zlBFn0XhD&sjgq1tN2>pul5@`gpZ@Dy|9sc?eed_a_jA9`{XEb6T-PL$UG102YRHO+ zh%9q-uyq69KEhjC418AKee40gWVjCAd=U{jW#KIS4z;m{ScTz10u~^kLc&-GhQgRbEO2lX)(nHgnL^M=lqCXbi9ngbP*^+$iASR$3qL5h8;{PwyV-77*bDq3 zKm!Bf1l z$VlDE2^J8bpr=11u(*q~Z2m%+zVko$H5)YsXI6Ml66ZA97n-b=x8hr3q#YfbQlIKNth)P%YdN)GX@HY zF#{~Amf!sX?QJ=4Kwm%fIm>xWd6U53EYo6!$(h#yJ#L-+T! zKQ*qOaIhN+hl_0({8(({02`#{fo=N!Si6IWh;*i-Es+w|H}1>y?e#0qtzw1Zk>y1x$Th4y0eS9~mIgXT7^Lln- zWw11VX1PJ3ftFT95KMKr;j@l`s@CH<tS9zP<|v3R?5S3bzYt zJ;F}~mbAd9Labs36+8QIE=8K8wATnS1R51 zW=Ps9SLE27w&GatZu~d_t+|ZOR=A(~sbzEd>CTHow>I$sO3;(LM8MjdY59QoX(WyUVt(eG7^_k&dwU!(0W*%sZ{;Nru%@7;SJ z9zM~m@oDWlnYSK<{radU0BJFDOP?t)L8)OSZm_U#ju&2HbNnV`)fynD&$I zSF?B>=T{G)$VRT$#-ta^Mr)ZoMr>e@M&KwSlAwz9_Sux%+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CjHo>RJS`>uQ^Sy~N7be_k-8q0sBIYm zqNNq1K@&p`8$;0tYa#Vw9xv76*YNCS&oi0}F{WD2#u?AfdD267^(?J_GnKPO?liH> z-7VHUFJ8gcldNTuHvKikeY^GM8j7DR@8A^|nKNnai4}oP(S&p9avQMv%N(R?YO2Jg zUZ}Lrooj#hCi!mc?j&dD$W`h`M+*IVO@@3BCUW&>t{aqw$J8s;kxz!#X$JBJtT@&je7~2$93#iG`Td6sTj#6^l>s@puY}^sFsvoG0wl3u44DLq+q^~zdC&T yVF;mSNP;MR*xFcE&vP)Lsww8zm!5U85vVE_eJwtW4Leg6iawHyQh literal 0 HcmV?d00001 diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/sokol.svg b/apps/block_scout_web/assets/static/images/network-selector-icons/sokol.svg new file mode 100644 index 0000000000..b2ced66189 --- /dev/null +++ b/apps/block_scout_web/assets/static/images/network-selector-icons/sokol.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/block_scout_web/assets/static/images/network-selector-icons/xdai-chain.png b/apps/block_scout_web/assets/static/images/network-selector-icons/xdai-chain.png new file mode 100644 index 0000000000000000000000000000000000000000..ab35a5b07235016486d096fdd62fcd0cba932b81 GIT binary patch literal 7638 zcmaKRWmr_v+V;?mbST}@&CuNqLwAgT#EioLLxXfkw@8;XNOww!w3G}WA}KAB^5S{V zIq&!5oNr&(-fOMrdhYwF`_H;|jGm4v0q#>=002OsuBK%0xSIccu`wUNzzTWP$AucM zYzjAoyny@I!N34{M~FR`LEYWX32XqibM$>R29^Q<&^TN`rf^ejEeQvRJFneeA6|qz z^brjJNXa6gb`Gv!IDA16(iNVEDn#n{&n_nBM2zGW+^Mip6{d7PMey$GU zj!d#L3{nV*M*?>++>Qa^?&jesfskhU2d~8A{;!#jiQykEa93%j|4qtNTaQ5z0s}LM z@QU&{2ndTXh>7zGhzbddi*qvw@(Td@_cY#1NH4$3FM%m25ee>rMv|NmXx z-T&?F2{!=$U%vm5*c0Rn1@jqzJt1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`1$}7 X+d@w4jj9xX|Fo(r>nPPK*uMTBp*k`w literal 0 HcmV?d00001 diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex new file mode 100644 index 0000000000..042fc2135e --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex @@ -0,0 +1,51 @@ +
+
+
+ + + +
+
+

<%= gettext("Change Network") %>

+

<%= gettext("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.") %>

+
+
+ + + + +
+
+
<%= gettext("All") %>
+
<%= gettext("Mainnet") %>
+
<%= gettext("Testnet") %>
+
<%= gettext("Favorites") %>
+
+
+
+ <%= for %{url: url, title: title} <- other_networks() do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Mainnet" %> + <% end %> +
+ <% main_nets = main_nets(other_networks()) %> +
+ <%= for %{url: url, title: title} <- main_nets do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: assigns[:tab_type] %> + <% end %> +
+ <% test_nets = test_nets(other_networks()) %> +
+ <%= for %{url: url, title: title} <- test_nets do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: assigns[:tab_type] %> + <% end %> +
+
+ No content. +
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex new file mode 100644 index 0000000000..2636542e4e --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex @@ -0,0 +1,25 @@ +
+ + +
\ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index 514422bcc8..1839c6d445 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -131,3 +131,4 @@ +<%= render BlockScoutWeb.LayoutView, "_network_selector.html" %> \ No newline at end of file From 239b5ac6c476498d884323922ff0f6b4dd8d4053 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Tue, 28 May 2019 13:00:27 -0300 Subject: [PATCH 02/81] (add) new network selector behaviours --- .../css/components/_network-selector.scss | 47 +++++++++- apps/block_scout_web/assets/js/app.js | 1 + .../assets/js/lib/network_selector.js | 71 ++++++++++++++ .../layout/_network_selector.html.eex | 92 ++++++++++--------- .../layout/_network_selector_item.html.eex | 2 +- .../templates/layout/_topnav.html.eex | 16 +--- 6 files changed, 165 insertions(+), 64 deletions(-) create mode 100644 apps/block_scout_web/assets/js/lib/network_selector.js diff --git a/apps/block_scout_web/assets/css/components/_network-selector.scss b/apps/block_scout_web/assets/css/components/_network-selector.scss index cfa79942d2..e4305befb9 100644 --- a/apps/block_scout_web/assets/css/components/_network-selector.scss +++ b/apps/block_scout_web/assets/css/components/_network-selector.scss @@ -7,10 +7,14 @@ $network-selector-search-input-color: #a3a9b5 !default; $network-selector-tab-active-border-color: $primary !default; $network-selector-item-icon-dimensions: 30px !default; +.network-selector-visible { + position: fixed; +} + .network-selector-overlay { background-color: rgba($network-selector-overlay-background, 0.9); bottom: 0; - display: flex; + display: none; left: 0; position: fixed; right: 0; @@ -18,6 +22,12 @@ $network-selector-item-icon-dimensions: 30px !default; z-index: 123; } +.network-selector-wrapper { + display: flex; + height: 100%; + width: 100%; +} + .network-selector { background-color: #fff; display: flex; @@ -26,7 +36,10 @@ $network-selector-item-icon-dimensions: 30px !default; flex-shrink: 1; margin-left: auto; max-width: 398px; + min-width: 0; padding: 28px 0 35px; + position: relative; + transition: right 0.25s ease-out; } .network-selector-close { @@ -123,12 +136,16 @@ $network-selector-item-icon-dimensions: 30px !default; .network-selector-tab { color: #a3a9b5; cursor: pointer; + flex-shrink: 1; font-size: 14px; font-weight: 600; line-height: 1.2; - padding: 20px 20px 15px; + min-width: 0; + padding: 20px 18px 15px; position: relative; text-align: center; + user-select: none; + white-space: nowrap; &:hover { color: #333; @@ -136,6 +153,7 @@ $network-selector-item-icon-dimensions: 30px !default; &.active { color: #333; + cursor: default; &::after { background-color: $network-selector-tab-active-border-color; @@ -165,7 +183,12 @@ $network-selector-item-icon-dimensions: 30px !default; position: relative; .radio { + cursor: pointer; margin: 0 15px 0 0; + + input[type="radio"] { + cursor: pointer; + } } .radio-icon { @@ -183,7 +206,13 @@ $network-selector-item-icon-dimensions: 30px !default; display: flex; flex-grow: 1; margin: 0; - padding: 20px 20px 20px 0; + padding: 20px 0; + + &:hover { + .network-selector-item-type { + color: #333; + } + } } .network-selector-item-icon { @@ -208,6 +237,7 @@ $network-selector-item-icon-dimensions: 30px !default; overflow: hidden; text-align: left; text-overflow: ellipsis; + user-select: none; white-space: nowrap; } @@ -219,6 +249,7 @@ $network-selector-item-icon-dimensions: 30px !default; line-height: 1.2; padding-left: 10px; text-align: right; + user-select: none; white-space: nowrap; } @@ -254,7 +285,8 @@ $network-selector-item-icon-dimensions: 30px !default; flex-grow: 1; flex-shrink: 0; margin: 0; - max-width: 16px; + max-width: 36px; + padding-left: 20px; position: relative; input[type="checkbox"] { @@ -280,4 +312,11 @@ $network-selector-item-icon-dimensions: 30px !default; fill: rgba(#ffb20d, 0.4); } } +} + +.network-selector-tab-content-empty { + font-size: 16px; + font-weight: 600; + padding: 40px; + text-align: center; } \ No newline at end of file diff --git a/apps/block_scout_web/assets/js/app.js b/apps/block_scout_web/assets/js/app.js index f10e3d696d..f37659ccba 100644 --- a/apps/block_scout_web/assets/js/app.js +++ b/apps/block_scout_web/assets/js/app.js @@ -54,3 +54,4 @@ import './lib/tooltip' import './lib/modals' import './lib/try_api' import './lib/card_tabs' +import './lib/network_selector' diff --git a/apps/block_scout_web/assets/js/lib/network_selector.js b/apps/block_scout_web/assets/js/lib/network_selector.js new file mode 100644 index 0000000000..f7765329a0 --- /dev/null +++ b/apps/block_scout_web/assets/js/lib/network_selector.js @@ -0,0 +1,71 @@ +import $ from 'jquery' + +$(function () { + const mainBody = $('body') + const showNetworkSelector = $('.js-show-network-selector') + const hideNetworkSelector = $('.js-network-selector-close') + const networkSelector = $('.js-network-selector') + const networkSelectorOverlay = $('.js-network-selector-overlay') + const networkSelectorTab = $('.js-network-selector-tab') + const networkSelectorTabContent = $('.js-network-selector-tab-content') + const networkSelectorItemURL = $('.js-network-selector-item-url') + const FADE_IN_DELAY = 250 + + showNetworkSelector.on('click', (e) => { + e.preventDefault() + openNetworkSelector() + }) + + hideNetworkSelector.on('click', (e) => { + e.preventDefault() + closeNetworkSelector() + }) + + networkSelectorTab.on('click', function (e) { + e.preventDefault() + setNetworkTab($(this)) + }) + + networkSelectorItemURL.on('click', function (e) { + window.location = $(this).attr('network-selector-item-url') + }) + + let setNetworkTab = (currentTab) => { + if (currentTab.hasClass('active')) return + + networkSelectorTab.removeClass('active') + currentTab.addClass('active') + networkSelectorTabContent.removeClass('active') + $(`[network-selector-tab="${currentTab.attr('network-selector-tab-filter')}"]`).addClass('active') + } + + let openNetworkSelector = () => { + mainBody.addClass('network-selector-visible') + networkSelectorOverlay.fadeIn(FADE_IN_DELAY) + setNetworkSelectorVisiblePosition() + } + + let closeNetworkSelector = () => { + mainBody.removeClass('network-selector-visible') + networkSelectorOverlay.fadeOut(FADE_IN_DELAY) + setNetworkSelectorHiddenPosition() + } + + let getNetworkSelectorWidth = () => { + return parseInt(networkSelector.css('width')) || parseInt(networkSelector.css('max-width')) + } + + let setNetworkSelectorHiddenPosition = () => { + return networkSelector.css({ 'right': `-${getNetworkSelectorWidth()}px` }) + } + + let setNetworkSelectorVisiblePosition = () => { + return networkSelector.css({ 'right': '0' }) + } + + let init = () => { + setNetworkSelectorHiddenPosition() + } + + init() +}) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex index 042fc2135e..eadf1b4503 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex @@ -1,51 +1,55 @@ -
-
-
- - - -
-
-

<%= gettext("Change Network") %>

-

<%= gettext("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.") %>

-
-
- - - - -
-
-
<%= gettext("All") %>
-
<%= gettext("Mainnet") %>
-
<%= gettext("Testnet") %>
-
<%= gettext("Favorites") %>
-
-
-
- <%= for %{url: url, title: title} <- other_networks() do %> - <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Mainnet" %> - <% end %> +
+
+
+
+ + +
- <% main_nets = main_nets(other_networks()) %> -
- <%= for %{url: url, title: title} <- main_nets do %> - <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: assigns[:tab_type] %> - <% end %> +
+

<%= gettext("Change Network") %>

+

<%= gettext("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.") %>

- <% test_nets = test_nets(other_networks()) %> -
- <%= for %{url: url, title: title} <- test_nets do %> - <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: assigns[:tab_type] %> - <% end %> +
+ + + + +
+
+
<%= gettext("All") %>
+
<%= gettext("Mainnet") %>
+
<%= gettext("Testnet") %>
+
<%= gettext("Favorites") %>
-
- No content. +
+ <% main_nets = main_nets(other_networks()) %> + <% test_nets = test_nets(other_networks()) %> +
+ <%= for %{url: url, title: title} <- main_nets do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Mainnet" %> + <% end %> + <%= for %{url: url, title: title} <- test_nets do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Testnet" %> + <% end %> +
+
+ <%= for %{url: url, title: title} <- main_nets do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Mainnet" %> + <% end %> +
+
+ <%= for %{url: url, title: title} <- test_nets do %> + <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Testnet" %> + <% end %> +
+
+
No content.
+
+
+
+
- -
-
-
\ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex index 2636542e4e..a798178455 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex @@ -1,5 +1,5 @@
-
From 094b46f7cb775fb73a4202d1c8943373acc87a4c Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Tue, 28 May 2019 14:15:35 -0300 Subject: [PATCH 03/81] (update) changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34eaca672a..fdb6bdfc16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Current ### Features +- [#2044](https://github.com/poanetwork/blockscout/pull/2044) - New network selector. - [#1963](https://github.com/poanetwork/blockscout/pull/1963), [#1959](https://github.com/poanetwork/blockscout/pull/1959), [#1948](https://github.com/poanetwork/blockscout/pull/1948), [#1936](https://github.com/poanetwork/blockscout/pull/1936), [#1925](https://github.com/poanetwork/blockscout/pull/1925), [#1922](https://github.com/poanetwork/blockscout/pull/1922), [#1903](https://github.com/poanetwork/blockscout/pull/1903), [#1874](https://github.com/poanetwork/blockscout/pull/1874), [#1895](https://github.com/poanetwork/blockscout/pull/1895), [#2031](https://github.com/poanetwork/blockscout/pull/2031) - added new themes and logos for poa, eth, rinkeby, goerli, ropsten, kovan, sokol, xdai, etc, rsk - [#2010](https://github.com/poanetwork/blockscout/pull/2010) - added "block not found" and "tx not found pages" - [#1928](https://github.com/poanetwork/blockscout/pull/1928) - pagination styles were updated From 8ae7e32ed7372601d6825bd0867c11489354ddb5 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Tue, 28 May 2019 14:17:00 -0300 Subject: [PATCH 04/81] (update) internationalization --- apps/block_scout_web/priv/gettext/default.pot | 44 +++++++++++++++++-- .../priv/gettext/en/LC_MESSAGES/default.po | 44 +++++++++++++++++-- 2 files changed, 80 insertions(+), 8 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index c7c75a3770..6c35a0f4a4 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -674,8 +675,8 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:97 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 msgid "Search" msgstr "" @@ -1540,8 +1541,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:91 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:95 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1720,3 +1721,38 @@ msgstr "" #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:17 msgid "There are no token transfers for this transaction" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 +msgid "Show More Networks" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 844c8db298..f97921888d 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -674,8 +675,8 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:97 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 msgid "Search" msgstr "" @@ -1540,8 +1541,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:91 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:95 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1720,3 +1721,38 @@ msgstr "" #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:17 msgid "There are no token transfers for this transaction" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 +msgid "Show More Networks" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" From 4462646c903806cbb66bb289a70a7460009fa414 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 3 Jun 2019 10:38:04 -0300 Subject: [PATCH 05/81] (update) internationalization files --- apps/block_scout_web/priv/gettext/default.pot | 44 +++++++++++++++++-- .../priv/gettext/en/LC_MESSAGES/default.po | 44 +++++++++++++++++-- 2 files changed, 80 insertions(+), 8 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 2caf439866..53ae7cdbb1 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -675,8 +676,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:97 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 msgid "Search" msgstr "" @@ -1541,8 +1542,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:91 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:95 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1726,3 +1727,38 @@ msgstr "" #: lib/block_scout_web/templates/address_logs/index.html.eex:12 msgid "Topic" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 +msgid "Show More Networks" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 6bbaa0f4b7..bb19f262ab 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -675,8 +676,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:97 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 msgid "Search" msgstr "" @@ -1541,8 +1542,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:91 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:95 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1726,3 +1727,38 @@ msgstr "" #: lib/block_scout_web/templates/address_logs/index.html.eex:12 msgid "Topic" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 +msgid "Show More Networks" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" From a88e3d42433015423733e7c08bc972ff3024672b Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 3 Jun 2019 12:47:59 -0300 Subject: [PATCH 06/81] (update) language files --- apps/block_scout_web/priv/gettext/default.pot | 44 ++++++++++++-- .../priv/gettext/en/LC_MESSAGES/default.po | 58 +++++++++++++++---- 2 files changed, 87 insertions(+), 15 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index c6d41cb84a..7dca514693 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -665,8 +666,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:97 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 msgid "Search" msgstr "" @@ -1481,8 +1482,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:91 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:95 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1694,3 +1695,38 @@ msgstr "" #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3 msgid "New Smart Contract Verification" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 +msgid "Show More Networks" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 59a612407d..12e0d15bb0 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -207,8 +208,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 -#: lib/block_scout_web/templates/address/overview.html.eex:142 -#: lib/block_scout_web/templates/address/overview.html.eex:150 +#: lib/block_scout_web/templates/address/overview.html.eex:144 +#: lib/block_scout_web/templates/address/overview.html.eex:152 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:114 msgid "Close" @@ -624,7 +625,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:33 -#: lib/block_scout_web/templates/address/overview.html.eex:141 +#: lib/block_scout_web/templates/address/overview.html.eex:143 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:35 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:105 msgid "QR Code" @@ -665,8 +666,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:97 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 msgid "Search" msgstr "" @@ -1481,8 +1482,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:91 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:95 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1667,12 +1668,12 @@ msgstr "" msgid "ABI-encoded Constructor Arguments (if required by the contract)" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:87 msgid "Enter the Solidity Contract Code" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:127 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:149 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:171 @@ -1681,7 +1682,7 @@ msgstr "" msgid "Library Address" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:117 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161 @@ -1690,7 +1691,42 @@ msgstr "" msgid "Library Name" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3 msgid "New Smart Contract Verification" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 +msgid "Show More Networks" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" From 82a977033cf643365eebd01cf5bf2ef3e3003bb7 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 3 Jun 2019 12:53:53 -0300 Subject: [PATCH 07/81] (fix) main container position when the network selector is showing --- .../assets/css/components/_network-selector.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/block_scout_web/assets/css/components/_network-selector.scss b/apps/block_scout_web/assets/css/components/_network-selector.scss index e4305befb9..4b1068fab4 100644 --- a/apps/block_scout_web/assets/css/components/_network-selector.scss +++ b/apps/block_scout_web/assets/css/components/_network-selector.scss @@ -8,7 +8,11 @@ $network-selector-tab-active-border-color: $primary !default; $network-selector-item-icon-dimensions: 30px !default; .network-selector-visible { + bottom: 0; + left: 0; position: fixed; + right: 0; + top: 0; } .network-selector-overlay { From 1d90f370d502a15a8677e2842dc1fc20ed947f80 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 5 Jun 2019 13:33:27 +0300 Subject: [PATCH 08/81] add prototype to export transactions as csv --- .../chain/address_transaction_csv_exporter.ex | 72 +++++++++++++++++++ apps/explorer/mix.exs | 2 + .../address_transaction_csv_exporter_test.exs | 43 +++++++++++ mix.lock | 2 + 4 files changed, 119 insertions(+) create mode 100644 apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex create mode 100644 apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex new file mode 100644 index 0000000000..66d47bba5b --- /dev/null +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -0,0 +1,72 @@ +defmodule Explorer.Chain.AddressTransactionCsvExporter do + alias Explorer.Chain + alias Explorer.Chain.{Address, Transaction} + + @necessity_by_association [ + necessity_by_association: %{ + [created_contract_address: :names] => :optional, + [from_address: :names] => :optional, + [to_address: :names] => :optional, + [token_transfers: :token] => :optional, + [token_transfers: :to_address] => :optional, + [token_transfers: :from_address] => :optional, + [token_transfers: :token_contract_address] => :optional, + :block => :required + } + ] + + def export(address) do + address + |> Chain.address_to_transactions_with_rewards(@necessity_by_association) + |> to_csv_format(address) + |> dump_data_to_csv() + end + + defp dump_data_to_csv(transactions) do + {:ok, path} = Briefly.create() + + transactions + |> NimbleCSV.RFC4180.dump_to_stream() + |> Stream.into(File.stream!(path)) + |> Enum.to_list() + + path + end + + defp to_csv_format(transactions, address) do + # , "ETHCurrentPrice", "ETHPriceAtTxDate", "TxFee", "Status", "ErrCode"] + row_names = [ + "TxHash", + "BlockNumber", + "UnixTimestamp", + "FromAddress", + "ToAddress", + "ContractAddress", + "Type", + "Value" + ] + + transaction_lists = + transactions + |> Stream.map(fn transaction -> + [ + to_string(transaction.hash), + transaction.block_number, + transaction.block.timestamp, + to_string(transaction.from_address), + to_string(transaction.to_address), + to_string(transaction.created_contract_address), + type(transaction, address), + 1 + ] + end) + + Stream.concat([row_names], transaction_lists) + end + + defp type(%Transaction{from_address_hash: from_address}, %Address{hash: from_address}), do: "OUT" + + defp type(%Transaction{to_address_hash: to_address}, %Address{hash: to_address}), do: "IN" + + defp type(_, _), do: "" +end diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs index ee233e3386..2e0bd82138 100644 --- a/apps/explorer/mix.exs +++ b/apps/explorer/mix.exs @@ -65,6 +65,7 @@ defmodule Explorer.Mixfile do {:benchee, "~> 0.13.1", only: :test}, # CSV output for benchee {:benchee_csv, "~> 0.8.0", only: :test}, + {:briefly, "~> 0.4", github: "CargoSense/briefly"}, {:bypass, "~> 1.0", only: :test}, {:comeonin, "~> 4.0"}, {:credo, "1.0.0", only: :test, runtime: false}, @@ -91,6 +92,7 @@ defmodule Explorer.Mixfile do {:math, "~> 0.3.0"}, {:mock, "~> 0.3.0", only: [:test], runtime: false}, {:mox, "~> 0.4", only: [:test]}, + {:nimble_csv, "~> 0.6.0"}, {:poison, "~> 3.1"}, {:postgrex, ">= 0.0.0"}, # For compatibility with `prometheus_process_collector`, which hasn't been updated yet diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs new file mode 100644 index 0000000000..40987e1afc --- /dev/null +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -0,0 +1,43 @@ +defmodule Explorer.Chain.AddressTransactionCsvExporterTest do + use Explorer.DataCase + + alias Explorer.Chain.AddressTransactionCsvExporter + + describe "export/1" do + test "exports address transactions to csv" do + address = insert(:address) + + transaction = + :transaction + |> insert(from_address: address) + |> with_block() + |> Repo.preload(:token_transfers) + + [result] = + address + |> AddressTransactionCsvExporter.export() + |> File.stream!() + |> NimbleCSV.RFC4180.parse_stream() + |> Stream.map(fn [hash, block_number, timestamp, from_address, to_address, created_address, type, value] -> + %{ + hash: hash, + block_number: block_number, + timestamp: timestamp, + from_address: from_address, + to_address: to_address, + created_address: created_address, + type: type, + value: value + } + end) + |> Enum.to_list() + + assert result.block_number == to_string(transaction.block_number) + assert result.created_address == to_string(transaction.created_contract_address_hash) + assert result.from_address == to_string(transaction.from_address) + assert result.to_address == to_string(transaction.to_address) + assert result.hash == to_string(transaction.hash) + assert result.type == "OUT" + end + end +end diff --git a/mix.lock b/mix.lock index df1be8c242..efc77457a2 100644 --- a/mix.lock +++ b/mix.lock @@ -11,6 +11,7 @@ "benchee": {:hex, :benchee, "0.13.2", "30cd4ff5f593fdd218a9b26f3c24d580274f297d88ad43383afe525b1543b165", [:mix], [{:deep_merge, "~> 0.1", [hex: :deep_merge, repo: "hexpm", optional: false]}], "hexpm"}, "benchee_csv": {:hex, :benchee_csv, "0.8.0", "0ca094677d6e2b2f601b7ee7864b754789ef9d24d079432e5e3d6f4fb83a4d80", [:mix], [{:benchee, "~> 0.12", [hex: :benchee, optional: false]}, {:csv, "~> 2.0", [hex: :csv, optional: false]}]}, "binary": {:hex, :binary, "0.0.5", "20d816f7274ea34f1b673b4cff2fdb9ebec9391a7a68c349070d515c66b1b2cf", [:mix], []}, + "briefly": {:git, "https://github.com/CargoSense/briefly.git", "2526e9674a4e6996137e066a1295ea60962712b8", []}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], []}, "bypass": {:hex, :bypass, "1.0.0", "b78b3dcb832a71aca5259c1a704b2e14b55fd4e1327ff942598b4e7d1a7ad83d", [:mix], [{:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}], "hexpm"}, "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, @@ -72,6 +73,7 @@ "mock": {:hex, :mock, "0.3.2", "e98e998fd76c191c7e1a9557c8617912c53df3d4a6132f561eb762b699ef59fa", [:mix], [{:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, "mox": {:hex, :mox, "0.4.0", "7f120840f7d626184a3d65de36189ca6f37d432e5d63acd80045198e4c5f7e6e", [:mix], [], "hexpm"}, "msgpax": {:hex, :msgpax, "2.2.2", "559a07806bbe5fdd31e4597455be030bd96356f7a621ca9eed832747c83bfb67", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"}, + "nimble_csv": {:hex, :nimble_csv, "0.6.0", "a3673f26d41f986774fe6060e309615343d3cb83a6d435754d8b1fdbd5764879", [:mix], [], "hexpm"}, "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, "optimal": {:hex, :optimal, "0.3.6", "46bbf52fbbbd238cda81e02560caa84f93a53c75620f1fe19e81e4ae7b07d1dd", [:mix], [], "hexpm"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], []}, From b2b0be905e63bcbcb3acfb5d8ec082a780b549e0 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 5 Jun 2019 15:22:38 +0300 Subject: [PATCH 09/81] fetch all transactions for csv export --- .../chain/address_transaction_csv_exporter.ex | 24 +++++++++++++- .../address_transaction_csv_exporter_test.exs | 33 +++++++++++++++++++ apps/indexer/mix.exs | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 66d47bba5b..01dccaf3e2 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -1,6 +1,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do alias Explorer.Chain alias Explorer.Chain.{Address, Transaction} + alias Explorer.PagingOptions @necessity_by_association [ necessity_by_association: %{ @@ -15,13 +16,34 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do } ] + @page_size 150 + + @paging_options %PagingOptions{page_size: @page_size + 1} + def export(address) do address - |> Chain.address_to_transactions_with_rewards(@necessity_by_association) + |> fetch_all_transactions(@paging_options) |> to_csv_format(address) |> dump_data_to_csv() end + defp fetch_all_transactions(address, paging_options, acc \\ []) do + options = Keyword.merge(@necessity_by_association, paging_options: paging_options) + + transactions = Chain.address_to_transactions_with_rewards(address, options) + + new_acc = transactions ++ acc + + case Enum.split(transactions, @page_size) do + {_, _transactions, [%Transaction{block_number: block_number, index: index}]} -> + new_paging_options = %{@paging_options | key: {block_number, index}} + fetch_all_transactions(address, new_paging_options, new_acc) + + {_, []} -> + new_acc + end + end + defp dump_data_to_csv(transactions) do {:ok, path} = Briefly.create() diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index 40987e1afc..ddff5e6dea 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -39,5 +39,38 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do assert result.hash == to_string(transaction.hash) assert result.type == "OUT" end + + test "fetches all transactions" do + address = insert(:address) + + 1..200 + |> Enum.map(fn _ -> + :transaction + |> insert(from_address: address) + |> with_block() + end) + |> Enum.count() + + result = + address + |> AddressTransactionCsvExporter.export() + |> File.stream!() + |> NimbleCSV.RFC4180.parse_stream() + |> Stream.map(fn [hash, block_number, timestamp, from_address, to_address, created_address, type, value] -> + %{ + hash: hash, + block_number: block_number, + timestamp: timestamp, + from_address: from_address, + to_address: to_address, + created_address: created_address, + type: type, + value: value + } + end) + |> Enum.to_list() + + assert Enum.count(result) == 200 + end end end diff --git a/apps/indexer/mix.exs b/apps/indexer/mix.exs index 9b8bd4d6ed..f70d758912 100644 --- a/apps/indexer/mix.exs +++ b/apps/indexer/mix.exs @@ -49,7 +49,7 @@ defmodule Indexer.MixProject do # JSONRPC access to Parity for `Explorer.Indexer` {:ethereum_jsonrpc, in_umbrella: true}, # RLP encoding - {:ex_rlp, "~> 0.3"}, + {:ex_rlp, "~> 0.5.2"}, # Code coverage {:excoveralls, "~> 0.10.0", only: [:test], github: "KronicDeth/excoveralls", branch: "circle-workflows"}, # Importing to database From ac56c61784950778bcdc7f8fcaac2569767f0da1 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 5 Jun 2019 15:37:12 +0300 Subject: [PATCH 10/81] fix pattern matching --- .../lib/explorer/chain/address_transaction_csv_exporter.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 01dccaf3e2..bb0ef9f636 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -35,7 +35,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do new_acc = transactions ++ acc case Enum.split(transactions, @page_size) do - {_, _transactions, [%Transaction{block_number: block_number, index: index}]} -> + {_transactions, [%Transaction{block_number: block_number, index: index}]} -> new_paging_options = %{@paging_options | key: {block_number, index}} fetch_all_transactions(address, new_paging_options, new_acc) From 78a501066231a25696f6a0c4920b6eda4db8193c Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 5 Jun 2019 15:44:03 +0300 Subject: [PATCH 11/81] fix credo --- .../chain/address_transaction_csv_exporter.ex | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index bb0ef9f636..54bf38df6f 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -1,7 +1,11 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do - alias Explorer.Chain + @moduledoc """ + Exports transactions to a csv file. + """ + + alias Explorer.{Chain, PagingOptions} alias Explorer.Chain.{Address, Transaction} - alias Explorer.PagingOptions + alias NimbleCSV.RFC4180 @necessity_by_association [ necessity_by_association: %{ @@ -20,6 +24,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do @paging_options %PagingOptions{page_size: @page_size + 1} + @spec export(Address.t()) :: String.t() def export(address) do address |> fetch_all_transactions(@paging_options) @@ -47,10 +52,11 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do defp dump_data_to_csv(transactions) do {:ok, path} = Briefly.create() - transactions - |> NimbleCSV.RFC4180.dump_to_stream() - |> Stream.into(File.stream!(path)) - |> Enum.to_list() + _ = + transactions + |> RFC4180.dump_to_stream() + |> Stream.into(File.stream!(path)) + |> Enum.to_list() path end From 4ea5e97306562523411b13049cbbcd221b843762 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 5 Jun 2019 16:23:01 +0300 Subject: [PATCH 12/81] add additional fields to csv file --- .../chain/address_transaction_csv_exporter.ex | 8 +++-- .../address_transaction_csv_exporter_test.exs | 32 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 54bf38df6f..e115827865 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -71,7 +71,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do "ToAddress", "ContractAddress", "Type", - "Value" + "Value", + "Status", + "ErrCode" ] transaction_lists = @@ -85,7 +87,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do to_string(transaction.to_address), to_string(transaction.created_contract_address), type(transaction, address), - 1 + 1, + transaction.status, + transaction.error ] end) diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index ddff5e6dea..10a6f60833 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -18,7 +18,18 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do |> AddressTransactionCsvExporter.export() |> File.stream!() |> NimbleCSV.RFC4180.parse_stream() - |> Stream.map(fn [hash, block_number, timestamp, from_address, to_address, created_address, type, value] -> + |> Stream.map(fn [ + hash, + block_number, + timestamp, + from_address, + to_address, + created_address, + type, + value, + status, + error + ] -> %{ hash: hash, block_number: block_number, @@ -27,7 +38,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do to_address: to_address, created_address: created_address, type: type, - value: value + value: value, + status: status, + error: error } end) |> Enum.to_list() @@ -38,6 +51,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do assert result.to_address == to_string(transaction.to_address) assert result.hash == to_string(transaction.hash) assert result.type == "OUT" + assert result.value == "1" + assert result.status == to_string(transaction.status) + assert result.error == to_string(transaction.error) end test "fetches all transactions" do @@ -56,18 +72,6 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do |> AddressTransactionCsvExporter.export() |> File.stream!() |> NimbleCSV.RFC4180.parse_stream() - |> Stream.map(fn [hash, block_number, timestamp, from_address, to_address, created_address, type, value] -> - %{ - hash: hash, - block_number: block_number, - timestamp: timestamp, - from_address: from_address, - to_address: to_address, - created_address: created_address, - type: type, - value: value - } - end) |> Enum.to_list() assert Enum.count(result) == 200 From 228a77db4870932c7a9e293f173651e2386fe8c4 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 5 Jun 2019 16:29:32 +0300 Subject: [PATCH 13/81] add real transaction value --- .../lib/explorer/chain/address_transaction_csv_exporter.ex | 4 ++-- .../explorer/chain/address_transaction_csv_exporter_test.exs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index e115827865..1c6c7c82d9 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -4,7 +4,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do """ alias Explorer.{Chain, PagingOptions} - alias Explorer.Chain.{Address, Transaction} + alias Explorer.Chain.{Address, Transaction, Wei} alias NimbleCSV.RFC4180 @necessity_by_association [ @@ -87,7 +87,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do to_string(transaction.to_address), to_string(transaction.created_contract_address), type(transaction, address), - 1, + Wei.to(transaction.value, :wei), transaction.status, transaction.error ] diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index 10a6f60833..0f84ee3d8e 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -1,7 +1,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do use Explorer.DataCase - alias Explorer.Chain.AddressTransactionCsvExporter + alias Explorer.Chain.{AddressTransactionCsvExporter, Wei} describe "export/1" do test "exports address transactions to csv" do @@ -51,7 +51,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do assert result.to_address == to_string(transaction.to_address) assert result.hash == to_string(transaction.hash) assert result.type == "OUT" - assert result.value == "1" + assert result.value == transaction.value |> Wei.to(:wei) |> to_string() assert result.status == to_string(transaction.status) assert result.error == to_string(transaction.error) end From ba8ae89db69fd14c4b259603a413d0cb3330e43f Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 10:40:00 +0300 Subject: [PATCH 14/81] add fee --- .../chain/address_transaction_csv_exporter.ex | 11 +++++++++++ .../chain/address_transaction_csv_exporter_test.exs | 3 +++ 2 files changed, 14 insertions(+) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 1c6c7c82d9..0486e9a6c7 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -72,6 +72,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do "ContractAddress", "Type", "Value", + "Fee", "Status", "ErrCode" ] @@ -88,6 +89,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do to_string(transaction.created_contract_address), type(transaction, address), Wei.to(transaction.value, :wei), + fee(transaction), transaction.status, transaction.error ] @@ -101,4 +103,13 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do defp type(%Transaction{to_address_hash: to_address}, %Address{hash: to_address}), do: "IN" defp type(_, _), do: "" + + defp fee(transaction) do + transaction + |> Chain.fee(:wei) + |> case do + {:actual, value} -> value + {:maximum, value} -> "Max of #{value}" + end + end end diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index 0f84ee3d8e..b87737e1d2 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -27,6 +27,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do created_address, type, value, + fee, status, error ] -> @@ -39,6 +40,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do created_address: created_address, type: type, value: value, + fee: fee, status: status, error: error } @@ -52,6 +54,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do assert result.hash == to_string(transaction.hash) assert result.type == "OUT" assert result.value == transaction.value |> Wei.to(:wei) |> to_string() + assert result.fee assert result.status == to_string(transaction.status) assert result.error == to_string(transaction.error) end From e96d53a752244a6d93816698faf3cb1c58d5db10 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 10:57:38 +0300 Subject: [PATCH 15/81] add current token price --- .../chain/address_transaction_csv_exporter.ex | 15 ++++++++++----- .../address_transaction_csv_exporter_test.exs | 7 +++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 0486e9a6c7..6590f8e3b6 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -3,8 +3,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do Exports transactions to a csv file. """ - alias Explorer.{Chain, PagingOptions} + alias Explorer.{Chain, Market, PagingOptions} alias Explorer.Chain.{Address, Transaction, Wei} + alias Explorer.ExchangeRates.Token alias NimbleCSV.RFC4180 @necessity_by_association [ @@ -26,9 +27,11 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do @spec export(Address.t()) :: String.t() def export(address) do + exchange_rate = Market.get_exchange_rate(Explorer.coin()) || Token.null() + address |> fetch_all_transactions(@paging_options) - |> to_csv_format(address) + |> to_csv_format(address, exchange_rate) |> dump_data_to_csv() end @@ -61,7 +64,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do path end - defp to_csv_format(transactions, address) do + defp to_csv_format(transactions, address, exchange_rate) do # , "ETHCurrentPrice", "ETHPriceAtTxDate", "TxFee", "Status", "ErrCode"] row_names = [ "TxHash", @@ -74,7 +77,8 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do "Value", "Fee", "Status", - "ErrCode" + "ErrCode", + "CurrentPrice" ] transaction_lists = @@ -91,7 +95,8 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do Wei.to(transaction.value, :wei), fee(transaction), transaction.status, - transaction.error + transaction.error, + exchange_rate.usd_value ] end) diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index b87737e1d2..a450cc7f87 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -29,7 +29,8 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do value, fee, status, - error + error, + cur_price ] -> %{ hash: hash, @@ -42,7 +43,8 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do value: value, fee: fee, status: status, - error: error + error: error, + current_price: cur_price } end) |> Enum.to_list() @@ -57,6 +59,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do assert result.fee assert result.status == to_string(transaction.status) assert result.error == to_string(transaction.error) + assert result.current_price end test "fetches all transactions" do From 4bfc37ba2c4d76e6758f1e0587e541d8ce99f10c Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 11:41:49 +0300 Subject: [PATCH 16/81] add opening and closing prices --- .../chain/address_transaction_csv_exporter.ex | 33 +++++++++++++++++-- .../address_transaction_csv_exporter_test.exs | 11 +++++-- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 6590f8e3b6..4bdd965579 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -3,7 +3,13 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do Exports transactions to a csv file. """ - alias Explorer.{Chain, Market, PagingOptions} + import Ecto.Query, + only: [ + from: 2 + ] + + alias Explorer.{Chain, Market, PagingOptions, Repo} + alias Explorer.Market.MarketHistory alias Explorer.Chain.{Address, Transaction, Wei} alias Explorer.ExchangeRates.Token alias NimbleCSV.RFC4180 @@ -78,12 +84,16 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do "Fee", "Status", "ErrCode", - "CurrentPrice" + "CurrentPrice", + "TxDateOpeningPrice", + "TxDateClosingPrice" ] transaction_lists = transactions |> Stream.map(fn transaction -> + {opening_price, closing_price} = price_at_date(transaction.block.timestamp) + [ to_string(transaction.hash), transaction.block_number, @@ -96,7 +106,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do fee(transaction), transaction.status, transaction.error, - exchange_rate.usd_value + exchange_rate.usd_value, + opening_price, + closing_price ] end) @@ -117,4 +129,19 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do {:maximum, value} -> "Max of #{value}" end end + + defp price_at_date(datetime) do + date = DateTime.to_date(datetime) + + query = + from( + mh in MarketHistory, + where: mh.date == ^date + ) + + case Repo.one(query) do + nil -> {nil, nil} + price -> {price.opening_price, price.closing_price} + end + end end diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index a450cc7f87..1150434a40 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -30,7 +30,9 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do fee, status, error, - cur_price + cur_price, + op_price, + cl_price ] -> %{ hash: hash, @@ -44,12 +46,15 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do fee: fee, status: status, error: error, - current_price: cur_price + current_price: cur_price, + opening_price: op_price, + closing_price: cl_price } end) |> Enum.to_list() assert result.block_number == to_string(transaction.block_number) + assert result.timestamp assert result.created_address == to_string(transaction.created_contract_address_hash) assert result.from_address == to_string(transaction.from_address) assert result.to_address == to_string(transaction.to_address) @@ -60,6 +65,8 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do assert result.status == to_string(transaction.status) assert result.error == to_string(transaction.error) assert result.current_price + assert result.opening_price + assert result.closing_price end test "fetches all transactions" do From f984c9129edebf266e0912efad3e7af992448f37 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 14:03:04 +0300 Subject: [PATCH 17/81] create endpoing with csv --- .../address_transaction_controller.ex | 21 ++++ .../lib/block_scout_web/router.ex | 2 + .../address_transaction_controller_test.exs | 18 ++++ .../chain/address_transaction_csv_exporter.ex | 100 ++++++++---------- .../address_transaction_csv_exporter_test.exs | 52 +++++---- 5 files changed, 118 insertions(+), 75 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex index da22b8c042..fe3681cf3e 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex @@ -10,6 +10,7 @@ defmodule BlockScoutWeb.AddressTransactionController do alias BlockScoutWeb.TransactionView alias Explorer.{Chain, Market} + alias Explorer.Chain.AddressTransactionCsvExporter alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -106,4 +107,24 @@ defmodule BlockScoutWeb.AddressTransactionController do not_found(conn) end end + + def transactions_csv(conn, %{"address_id" => address_hash_string}) do + with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), + {:ok, address} <- Chain.hash_to_address(address_hash) do + address + |> AddressTransactionCsvExporter.export() + |> Enum.into( + conn + |> put_resp_content_type("application/csv") + |> put_resp_header("content-disposition", "attachment; filename=transactions.csv") + |> send_chunked(200) + ) + else + :error -> + unprocessable_entity(conn) + + {:error, :not_found} -> + not_found(conn) + end + end end diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index aa19725811..8d9d057c3f 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -240,6 +240,8 @@ defmodule BlockScoutWeb.Router do get("/search_logs", AddressLogsController, :search_logs) + get("/transactions_csv", AddressTransactionController, :transactions_csv) + get("/token_autocomplete", ChainController, :token_autocomplete) get("/chain_blocks", ChainController, :chain_blocks, as: :chain_blocks) diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs index 028387501a..b5b6e7280b 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs @@ -132,4 +132,22 @@ defmodule BlockScoutWeb.AddressTransactionControllerTest do end) end end + + describe "GET transactions_csv/2" do + test "download csv file with transactions", %{conn: conn} do + address = insert(:address) + + :transaction + |> insert(from_address: address) + |> with_block() + + :transaction + |> insert(from_address: address) + |> with_block() + + conn = get(conn, "/transactions_csv", %{"address_id" => to_string(address.hash)}) + + assert conn.resp_body |> String.split("\n") |> Enum.count() == 3 + end + end end diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 4bdd965579..09d0b83dbc 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -31,14 +31,14 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do @paging_options %PagingOptions{page_size: @page_size + 1} - @spec export(Address.t()) :: String.t() + @spec export(Address.t()) :: Enumerable.t() def export(address) do exchange_rate = Market.get_exchange_rate(Explorer.coin()) || Token.null() address |> fetch_all_transactions(@paging_options) |> to_csv_format(address, exchange_rate) - |> dump_data_to_csv() + |> dump_to_stream() end defp fetch_all_transactions(address, paging_options, acc \\ []) do @@ -58,61 +58,53 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do end end - defp dump_data_to_csv(transactions) do - {:ok, path} = Briefly.create() - - _ = - transactions - |> RFC4180.dump_to_stream() - |> Stream.into(File.stream!(path)) - |> Enum.to_list() - - path + defp dump_to_stream(transactions) do + transactions + |> RFC4180.dump_to_stream() end defp to_csv_format(transactions, address, exchange_rate) do - # , "ETHCurrentPrice", "ETHPriceAtTxDate", "TxFee", "Status", "ErrCode"] - row_names = [ - "TxHash", - "BlockNumber", - "UnixTimestamp", - "FromAddress", - "ToAddress", - "ContractAddress", - "Type", - "Value", - "Fee", - "Status", - "ErrCode", - "CurrentPrice", - "TxDateOpeningPrice", - "TxDateClosingPrice" - ] - - transaction_lists = - transactions - |> Stream.map(fn transaction -> - {opening_price, closing_price} = price_at_date(transaction.block.timestamp) - - [ - to_string(transaction.hash), - transaction.block_number, - transaction.block.timestamp, - to_string(transaction.from_address), - to_string(transaction.to_address), - to_string(transaction.created_contract_address), - type(transaction, address), - Wei.to(transaction.value, :wei), - fee(transaction), - transaction.status, - transaction.error, - exchange_rate.usd_value, - opening_price, - closing_price - ] - end) - - Stream.concat([row_names], transaction_lists) + # row_names = [ + # "TxHash", + # "BlockNumber", + # "UnixTimestamp", + # "FromAddress", + # "ToAddress", + # "ContractAddress", + # "Type", + # "Value", + # "Fee", + # "Status", + # "ErrCode", + # "CurrentPrice", + # "TxDateOpeningPrice", + # "TxDateClosingPrice" + # ] + + # transaction_lists = + transactions + |> Stream.map(fn transaction -> + {opening_price, closing_price} = price_at_date(transaction.block.timestamp) + + [ + to_string(transaction.hash), + transaction.block_number, + transaction.block.timestamp, + to_string(transaction.from_address), + to_string(transaction.to_address), + to_string(transaction.created_contract_address), + type(transaction, address), + Wei.to(transaction.value, :wei), + fee(transaction), + transaction.status, + transaction.error, + exchange_rate.usd_value, + opening_price, + closing_price + ] + end) + + # Stream.concat([row_names], transaction_lists) end defp type(%Transaction{from_address_hash: from_address}, %Address{hash: from_address}), do: "OUT" diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index 1150434a40..a198b59625 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -16,24 +16,37 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do [result] = address |> AddressTransactionCsvExporter.export() - |> File.stream!() - |> NimbleCSV.RFC4180.parse_stream() - |> Stream.map(fn [ - hash, - block_number, - timestamp, - from_address, - to_address, - created_address, - type, - value, - fee, - status, - error, - cur_price, - op_price, - cl_price - ] -> + |> Enum.to_list() + |> Enum.map(fn [ + hash, + _, + block_number, + _, + timestamp, + _, + from_address, + _, + to_address, + _, + created_address, + _, + type, + _, + value, + _, + fee, + _, + status, + _, + error, + _, + cur_price, + _, + op_price, + _, + cl_price, + _ + ] -> %{ hash: hash, block_number: block_number, @@ -51,7 +64,6 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do closing_price: cl_price } end) - |> Enum.to_list() assert result.block_number == to_string(transaction.block_number) assert result.timestamp @@ -83,8 +95,6 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do result = address |> AddressTransactionCsvExporter.export() - |> File.stream!() - |> NimbleCSV.RFC4180.parse_stream() |> Enum.to_list() assert Enum.count(result) == 200 From 36218f0a6651defb35db01fd2ab4a35e8c59f393 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 14:20:52 +0300 Subject: [PATCH 18/81] add button in UI to download csv --- .../block_scout_web/templates/address_transaction/index.html.eex | 1 + apps/explorer/mix.exs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index 11b4de110c..87ab7eba56 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -6,6 +6,7 @@
<%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %>
+ to_string(@address.hash)}) %>><%= gettext("Download all transactions as csv") %>
<%= gettext "Connection Lost, click to load newer transactions" %> diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs index 2e0bd82138..cddef9e45d 100644 --- a/apps/explorer/mix.exs +++ b/apps/explorer/mix.exs @@ -65,7 +65,6 @@ defmodule Explorer.Mixfile do {:benchee, "~> 0.13.1", only: :test}, # CSV output for benchee {:benchee_csv, "~> 0.8.0", only: :test}, - {:briefly, "~> 0.4", github: "CargoSense/briefly"}, {:bypass, "~> 1.0", only: :test}, {:comeonin, "~> 4.0"}, {:credo, "1.0.0", only: :test, runtime: false}, From d210249a748e90829136758435f0ba1758080a5a Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 14:27:59 +0300 Subject: [PATCH 19/81] add column names --- .../address_transaction_controller_test.exs | 2 +- .../chain/address_transaction_csv_exporter.ex | 82 +++++++++---------- .../address_transaction_csv_exporter_test.exs | 2 + 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs index b5b6e7280b..94ac9a982a 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs @@ -147,7 +147,7 @@ defmodule BlockScoutWeb.AddressTransactionControllerTest do conn = get(conn, "/transactions_csv", %{"address_id" => to_string(address.hash)}) - assert conn.resp_body |> String.split("\n") |> Enum.count() == 3 + assert conn.resp_body |> String.split("\n") |> Enum.count() == 4 end end end diff --git a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex index 09d0b83dbc..32028e02d3 100644 --- a/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_transaction_csv_exporter.ex @@ -64,47 +64,47 @@ defmodule Explorer.Chain.AddressTransactionCsvExporter do end defp to_csv_format(transactions, address, exchange_rate) do - # row_names = [ - # "TxHash", - # "BlockNumber", - # "UnixTimestamp", - # "FromAddress", - # "ToAddress", - # "ContractAddress", - # "Type", - # "Value", - # "Fee", - # "Status", - # "ErrCode", - # "CurrentPrice", - # "TxDateOpeningPrice", - # "TxDateClosingPrice" - # ] - - # transaction_lists = - transactions - |> Stream.map(fn transaction -> - {opening_price, closing_price} = price_at_date(transaction.block.timestamp) - - [ - to_string(transaction.hash), - transaction.block_number, - transaction.block.timestamp, - to_string(transaction.from_address), - to_string(transaction.to_address), - to_string(transaction.created_contract_address), - type(transaction, address), - Wei.to(transaction.value, :wei), - fee(transaction), - transaction.status, - transaction.error, - exchange_rate.usd_value, - opening_price, - closing_price - ] - end) - - # Stream.concat([row_names], transaction_lists) + row_names = [ + "TxHash", + "BlockNumber", + "UnixTimestamp", + "FromAddress", + "ToAddress", + "ContractAddress", + "Type", + "Value", + "Fee", + "Status", + "ErrCode", + "CurrentPrice", + "TxDateOpeningPrice", + "TxDateClosingPrice" + ] + + transaction_lists = + transactions + |> Stream.map(fn transaction -> + {opening_price, closing_price} = price_at_date(transaction.block.timestamp) + + [ + to_string(transaction.hash), + transaction.block_number, + transaction.block.timestamp, + to_string(transaction.from_address), + to_string(transaction.to_address), + to_string(transaction.created_contract_address), + type(transaction, address), + Wei.to(transaction.value, :wei), + fee(transaction), + transaction.status, + transaction.error, + exchange_rate.usd_value, + opening_price, + closing_price + ] + end) + + Stream.concat([row_names], transaction_lists) end defp type(%Transaction{from_address_hash: from_address}, %Address{hash: from_address}), do: "OUT" diff --git a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs index a198b59625..1f722abf87 100644 --- a/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_transaction_csv_exporter_test.exs @@ -17,6 +17,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do address |> AddressTransactionCsvExporter.export() |> Enum.to_list() + |> Enum.drop(1) |> Enum.map(fn [ hash, _, @@ -96,6 +97,7 @@ defmodule Explorer.Chain.AddressTransactionCsvExporterTest do address |> AddressTransactionCsvExporter.export() |> Enum.to_list() + |> Enum.drop(1) assert Enum.count(result) == 200 end From 5bd771c3d36e4d5d66ad5b020f48568b000194d4 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 6 Jun 2019 14:32:51 +0300 Subject: [PATCH 20/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 19 +++++++---- .../priv/gettext/en/LC_MESSAGES/default.po | 33 +++++++++++-------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index c6d41cb84a..90c5b8751b 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -111,7 +111,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:24 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -244,7 +244,7 @@ msgid "Connection Lost, click to load newer internal transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:11 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:12 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:15 #: lib/block_scout_web/templates/transaction/index.html.eex:15 msgid "Connection Lost, click to load newer transactions" @@ -404,7 +404,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:44 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:40 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:41 #: lib/block_scout_web/views/address_internal_transaction_view.ex:7 #: lib/block_scout_web/views/address_transaction_view.ex:7 msgid "From" @@ -742,7 +742,7 @@ msgid "There are no tokens." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:62 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:63 msgid "There are no transactions for this address." msgstr "" @@ -763,7 +763,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:33 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:29 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:30 #: lib/block_scout_web/views/address_internal_transaction_view.ex:6 #: lib/block_scout_web/views/address_transaction_view.ex:6 msgid "To" @@ -867,7 +867,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:3 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:15 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:16 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/chain/show.html.eex:108 @@ -1211,7 +1211,7 @@ msgstr "" #: lib/block_scout_web/templates/address_logs/index.html.eex:21 #: lib/block_scout_web/templates/address_token/index.html.eex:13 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:57 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:58 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 #: lib/block_scout_web/templates/block_transaction/index.html.eex:23 #: lib/block_scout_web/templates/chain/show.html.eex:91 @@ -1694,3 +1694,8 @@ msgstr "" #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3 msgid "New Smart Contract Verification" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_transaction/index.html.eex:9 +msgid "Download all transactions as csv" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 59a612407d..6ffe74c683 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -111,7 +111,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:24 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -207,8 +207,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 -#: lib/block_scout_web/templates/address/overview.html.eex:142 -#: lib/block_scout_web/templates/address/overview.html.eex:150 +#: lib/block_scout_web/templates/address/overview.html.eex:144 +#: lib/block_scout_web/templates/address/overview.html.eex:152 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:114 msgid "Close" @@ -244,7 +244,7 @@ msgid "Connection Lost, click to load newer internal transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:11 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:12 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:15 #: lib/block_scout_web/templates/transaction/index.html.eex:15 msgid "Connection Lost, click to load newer transactions" @@ -404,7 +404,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:44 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:40 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:41 #: lib/block_scout_web/views/address_internal_transaction_view.ex:7 #: lib/block_scout_web/views/address_transaction_view.ex:7 msgid "From" @@ -624,7 +624,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:33 -#: lib/block_scout_web/templates/address/overview.html.eex:141 +#: lib/block_scout_web/templates/address/overview.html.eex:143 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:35 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:105 msgid "QR Code" @@ -742,7 +742,7 @@ msgid "There are no tokens." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:62 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:63 msgid "There are no transactions for this address." msgstr "" @@ -763,7 +763,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:33 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:29 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:30 #: lib/block_scout_web/views/address_internal_transaction_view.ex:6 #: lib/block_scout_web/views/address_transaction_view.ex:6 msgid "To" @@ -867,7 +867,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:3 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:15 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:16 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/chain/show.html.eex:108 @@ -1211,7 +1211,7 @@ msgstr "" #: lib/block_scout_web/templates/address_logs/index.html.eex:21 #: lib/block_scout_web/templates/address_token/index.html.eex:13 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:57 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:58 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 #: lib/block_scout_web/templates/block_transaction/index.html.eex:23 #: lib/block_scout_web/templates/chain/show.html.eex:91 @@ -1667,12 +1667,12 @@ msgstr "" msgid "ABI-encoded Constructor Arguments (if required by the contract)" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:87 msgid "Enter the Solidity Contract Code" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:127 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:149 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:171 @@ -1681,7 +1681,7 @@ msgstr "" msgid "Library Address" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:117 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161 @@ -1690,7 +1690,12 @@ msgstr "" msgid "Library Name" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3 msgid "New Smart Contract Verification" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_transaction/index.html.eex:9 +msgid "Download all transactions as csv" +msgstr "" From 1b009499ed68ab170cb5535104edc98c08b86eb1 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 11 Jun 2019 14:28:32 +0300 Subject: [PATCH 21/81] export token transfers to csv file --- .../address_token_transfer_csv_exporter.ex | 119 ++++++++++++++++++ apps/explorer/mix.exs | 1 + ...dress_token_transfer_csv_exporter_test.exs | 72 +++++++++++ mix.lock | 1 + 4 files changed, 193 insertions(+) create mode 100644 apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex create mode 100644 apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs diff --git a/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex new file mode 100644 index 0000000000..2292a23c22 --- /dev/null +++ b/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex @@ -0,0 +1,119 @@ +defmodule Explorer.Chain.AddressTokenTransferCsvExporter do + @moduledoc """ + Exports token transfers to a csv file. + """ + + alias Explorer.{Chain, PagingOptions} + alias Explorer.Chain.{Address, Transaction, TokenTransfer} + alias NimbleCSV.RFC4180 + + @necessity_by_association [ + necessity_by_association: %{ + [created_contract_address: :names] => :optional, + [from_address: :names] => :optional, + [to_address: :names] => :optional, + [token_transfers: :token] => :optional, + [token_transfers: :to_address] => :optional, + [token_transfers: :from_address] => :optional, + [token_transfers: :token_contract_address] => :optional, + :block => :required + } + ] + + @page_size 150 + @paging_options %PagingOptions{page_size: @page_size + 1} + + def export(address) do + address + |> fetch_all_transactions(@paging_options) + |> to_token_transfers() + |> to_csv_format(address) + |> dump_to_stream() + end + + defp fetch_all_transactions(address, paging_options, acc \\ []) do + options = Keyword.merge(@necessity_by_association, paging_options: paging_options) + + transactions = + address + |> Chain.address_to_transactions_with_rewards(options) + |> Enum.filter(fn transaction -> Enum.count(transaction.token_transfers) > 0 end) + + new_acc = transactions ++ acc + + case Enum.split(transactions, @page_size) do + {_transactions, [%Transaction{block_number: block_number, index: index}]} -> + new_paging_options = %{@paging_options | key: {block_number, index}} + fetch_all_transactions(address, new_paging_options, new_acc) + + {_, []} -> + new_acc + end + end + + defp to_token_transfers(transactions) do + transactions + |> Enum.flat_map(fn transaction -> + transaction.token_transfers + |> Enum.map(fn transfer -> %{transfer | transaction: transaction} end) + end) + end + + defp dump_to_stream(transactions) do + transactions + |> RFC4180.dump_to_stream() + end + + defp to_csv_format(token_transfers, address) do + row_names = [ + "TxHash", + "BlockNumber", + "UnixTimestamp", + "FromAddress", + "ToAddress", + "TokenContractAddress", + "Type", + "TokenSymbol", + "TokensTransferred", + "TransactionFee", + "Status", + "ErrCode" + ] + + token_transfer_lists = + token_transfers + |> Stream.map(fn token_transfer -> + [ + to_string(token_transfer.transaction_hash), + token_transfer.transaction.block_number, + token_transfer.transaction.block.timestamp, + to_string(token_transfer.from_address), + to_string(token_transfer.to_address), + to_string(token_transfer.token_contract_address), + type(token_transfer, address), + token_transfer.token.symbol, + token_transfer.amount, + fee(token_transfer.transaction), + token_transfer.transaction.status, + token_transfer.transaction.error + ] + end) + + Stream.concat([row_names], token_transfer_lists) + end + + defp type(%TokenTransfer{from_address_hash: from_address}, %Address{hash: from_address}), do: "OUT" + + defp type(%TokenTransfer{to_address_hash: to_address}, %Address{hash: to_address}), do: "IN" + + defp type(_, _), do: "" + + defp fee(transaction) do + transaction + |> Chain.fee(:wei) + |> case do + {:actual, value} -> value + {:maximum, value} -> "Max of #{value}" + end + end +end diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs index 09257b9aee..d73e0a9920 100644 --- a/apps/explorer/mix.exs +++ b/apps/explorer/mix.exs @@ -92,6 +92,7 @@ defmodule Explorer.Mixfile do {:mock, "~> 0.3.0", only: [:test], runtime: false}, {:mox, "~> 0.4", only: [:test]}, {:poison, "~> 3.1"}, + {:nimble_csv, "~> 0.6.0"}, {:postgrex, ">= 0.0.0"}, # For compatibility with `prometheus_process_collector`, which hasn't been updated yet {:prometheus, "~> 4.0", override: true}, diff --git a/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs new file mode 100644 index 0000000000..9989290264 --- /dev/null +++ b/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs @@ -0,0 +1,72 @@ +defmodule Explorer.Chain.AddressTokenTransferCsvExporterTest do + use Explorer.DataCase + + alias Explorer.Chain.AddressTokenTransferCsvExporter + + describe "export/1" do + test "exports token transfers to csv" do + address = insert(:address) + + transaction = + :transaction + |> insert(from_address: address) + |> with_block() + + token_transfer = insert(:token_transfer, transaction: transaction, from_address: address) + + [result] = + address + |> AddressTokenTransferCsvExporter.export() + |> Enum.to_list() + |> Enum.drop(1) + |> Enum.map(fn [ + tx_hash, + _, + block_number, + _, + timestamp, + _, + from_address, + _, + to_address, + _, + token_contract_address, + _, + type, + _, + token_symbol, + _, + tokens_transferred, + _, + transaction_fee, + _, + status, + _, + err_code, + _ + ] -> + %{ + tx_hash: tx_hash, + block_number: block_number, + timestamp: timestamp, + from_address: from_address, + to_address: to_address, + token_contract_address: token_contract_address, + type: type, + token_symbol: token_symbol, + tokens_transferred: tokens_transferred, + transaction_fee: transaction_fee, + status: status, + err_code: err_code + } + end) + + assert result.block_number == to_string(transaction.block_number) + assert result.tx_hash == to_string(transaction.hash) + assert result.from_address == to_string(token_transfer.from_address_hash) + assert result.to_address == to_string(token_transfer.to_address_hash) + assert result.timestamp == to_string(transaction.block.timestamp) + assert result.type == "OUT" + end + end +end diff --git a/mix.lock b/mix.lock index 5bcd8cacf1..d1011c206b 100644 --- a/mix.lock +++ b/mix.lock @@ -73,6 +73,7 @@ "mock": {:hex, :mock, "0.3.2", "e98e998fd76c191c7e1a9557c8617912c53df3d4a6132f561eb762b699ef59fa", [:mix], [{:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, "mox": {:hex, :mox, "0.4.0", "7f120840f7d626184a3d65de36189ca6f37d432e5d63acd80045198e4c5f7e6e", [:mix], [], "hexpm"}, "msgpax": {:hex, :msgpax, "2.2.2", "559a07806bbe5fdd31e4597455be030bd96356f7a621ca9eed832747c83bfb67", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"}, + "nimble_csv": {:hex, :nimble_csv, "0.6.0", "a3673f26d41f986774fe6060e309615343d3cb83a6d435754d8b1fdbd5764879", [:mix], [], "hexpm"}, "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, "optimal": {:hex, :optimal, "0.3.6", "46bbf52fbbbd238cda81e02560caa84f93a53c75620f1fe19e81e4ae7b07d1dd", [:mix], [], "hexpm"}, "parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], []}, From 3b29b6b04908010b3075efbba5d08ceb0cb8009a Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 11 Jun 2019 14:35:46 +0300 Subject: [PATCH 22/81] fix credo --- .../lib/explorer/chain/address_token_transfer_csv_exporter.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex index 2292a23c22..4073245383 100644 --- a/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex @@ -4,7 +4,7 @@ defmodule Explorer.Chain.AddressTokenTransferCsvExporter do """ alias Explorer.{Chain, PagingOptions} - alias Explorer.Chain.{Address, Transaction, TokenTransfer} + alias Explorer.Chain.{Address, TokenTransfer, Transaction} alias NimbleCSV.RFC4180 @necessity_by_association [ From e5f92472543e3dcd72202cddd7426fa94c4ee163 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 11 Jun 2019 14:48:49 +0300 Subject: [PATCH 23/81] fix test --- .../chain/address_token_transfer_csv_exporter_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs b/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs index 9989290264..24bd9d7f04 100644 --- a/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs +++ b/apps/explorer/test/explorer/chain/address_token_transfer_csv_exporter_test.exs @@ -63,8 +63,8 @@ defmodule Explorer.Chain.AddressTokenTransferCsvExporterTest do assert result.block_number == to_string(transaction.block_number) assert result.tx_hash == to_string(transaction.hash) - assert result.from_address == to_string(token_transfer.from_address_hash) - assert result.to_address == to_string(token_transfer.to_address_hash) + assert result.from_address == token_transfer.from_address_hash |> to_string() |> String.downcase() + assert result.to_address == token_transfer.to_address_hash |> to_string() |> String.downcase() assert result.timestamp == to_string(transaction.block.timestamp) assert result.type == "OUT" end From 5f77a6a879e143a5fe3369d56cb317fd07229633 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 11 Jun 2019 14:57:51 +0300 Subject: [PATCH 24/81] add token transfers csv endpoint --- .../address_transaction_controller.ex | 21 +++++++++++++++++++ .../lib/block_scout_web/router.ex | 2 ++ .../address_transaction_controller_test.exs | 18 ++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex index da22b8c042..808d470dde 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex @@ -10,6 +10,7 @@ defmodule BlockScoutWeb.AddressTransactionController do alias BlockScoutWeb.TransactionView alias Explorer.{Chain, Market} + alias Explorer.Chain.AddressTokenTransferCsvExporter alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -106,4 +107,24 @@ defmodule BlockScoutWeb.AddressTransactionController do not_found(conn) end end + + def token_transfers_csv(conn, %{"address_id" => address_hash_string}) do + with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), + {:ok, address} <- Chain.hash_to_address(address_hash) do + address + |> AddressTokenTransferCsvExporter.export() + |> Enum.into( + conn + |> put_resp_content_type("application/csv") + |> put_resp_header("content-disposition", "attachment; filename=transactions.csv") + |> send_chunked(200) + ) + else + :error -> + unprocessable_entity(conn) + + {:error, :not_found} -> + not_found(conn) + end + end end diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index 786c77cdff..b1a4ecc8d2 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -244,6 +244,8 @@ defmodule BlockScoutWeb.Router do get("/token_autocomplete", ChainController, :token_autocomplete) + get("/token_transfers_csv", AddressTransactionController, :token_transfers_csv) + get("/chain_blocks", ChainController, :chain_blocks, as: :chain_blocks) get("/api_docs", APIDocsController, :index) diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs index 028387501a..1f94a7b8ea 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs @@ -132,4 +132,22 @@ defmodule BlockScoutWeb.AddressTransactionControllerTest do end) end end + + describe "GET token_transfers_csv/2" do + test "exports token transfers to csv", %{conn: conn} do + address = insert(:address) + + transaction = + :transaction + |> insert(from_address: address) + |> with_block() + + insert(:token_transfer, transaction: transaction, from_address: address) + insert(:token_transfer, transaction: transaction, to_address: address) + + conn = get(conn, "/token_transfers_csv", %{"address_id" => to_string(address.hash)}) + + assert conn.resp_body |> String.split("\n") |> Enum.count() == 4 + end + end end From 2e986c3aff97fa46b7ad93737c965e687d55b01f Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 11 Jun 2019 15:28:20 +0300 Subject: [PATCH 25/81] add download button --- .../controllers/address_transaction_controller.ex | 2 +- .../block_scout_web/templates/address_token/index.html.eex | 1 + .../explorer/chain/address_token_transfer_csv_exporter.ex | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex index 808d470dde..193d03f9c5 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex @@ -116,7 +116,7 @@ defmodule BlockScoutWeb.AddressTransactionController do |> Enum.into( conn |> put_resp_content_type("application/csv") - |> put_resp_header("content-disposition", "attachment; filename=transactions.csv") + |> put_resp_header("content-disposition", "attachment; filename=token_transfers.csv") |> send_chunked(200) ) else diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex index 43457d3bc1..fa9dc12bd7 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex @@ -5,6 +5,7 @@
<%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %>
+ to_string(@address.hash)}) %>><%= gettext("Download all token transfers as csv") %>

<%= gettext "Tokens" %>

<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> diff --git a/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex b/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex index 4073245383..96bd56afef 100644 --- a/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex +++ b/apps/explorer/lib/explorer/chain/address_token_transfer_csv_exporter.ex @@ -87,9 +87,9 @@ defmodule Explorer.Chain.AddressTokenTransferCsvExporter do to_string(token_transfer.transaction_hash), token_transfer.transaction.block_number, token_transfer.transaction.block.timestamp, - to_string(token_transfer.from_address), - to_string(token_transfer.to_address), - to_string(token_transfer.token_contract_address), + token_transfer.from_address |> to_string() |> String.downcase(), + token_transfer.to_address |> to_string() |> String.downcase(), + token_transfer.token_contract_address |> to_string() |> String.downcase(), type(token_transfer, address), token_transfer.token.symbol, token_transfer.amount, From 06906b2f20cc1fbab81990260bfb63a275c99560 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 11 Jun 2019 15:34:49 +0300 Subject: [PATCH 26/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 11 ++++++++--- .../priv/gettext/en/LC_MESSAGES/default.po | 13 +++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index e9763e2287..f71be7b3dd 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -732,7 +732,7 @@ msgid "There are no token transfers for this address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_token/index.html.eex:18 +#: lib/block_scout_web/templates/address_token/index.html.eex:19 msgid "There are no tokens for this address." msgstr "" @@ -810,7 +810,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:8 -#: lib/block_scout_web/templates/address_token/index.html.eex:8 +#: lib/block_scout_web/templates/address_token/index.html.eex:9 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9 #: lib/block_scout_web/views/address_view.ex:304 msgid "Tokens" @@ -1207,7 +1207,7 @@ msgstr "" #: lib/block_scout_web/templates/address_coin_balance/index.html.eex:34 #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:61 #: lib/block_scout_web/templates/address_logs/index.html.eex:21 -#: lib/block_scout_web/templates/address_token/index.html.eex:13 +#: lib/block_scout_web/templates/address_token/index.html.eex:14 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 #: lib/block_scout_web/templates/address_transaction/index.html.eex:57 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 @@ -1697,3 +1697,8 @@ msgstr "" #: lib/block_scout_web/templates/transaction/overview.html.eex:178 msgid " Token Transfer" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_token/index.html.eex:8 +msgid "Download all token transfers as csv" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 654a848278..6d0d199372 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -732,7 +732,7 @@ msgid "There are no token transfers for this address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_token/index.html.eex:18 +#: lib/block_scout_web/templates/address_token/index.html.eex:19 msgid "There are no tokens for this address." msgstr "" @@ -810,7 +810,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:8 -#: lib/block_scout_web/templates/address_token/index.html.eex:8 +#: lib/block_scout_web/templates/address_token/index.html.eex:9 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9 #: lib/block_scout_web/views/address_view.ex:304 msgid "Tokens" @@ -1207,7 +1207,7 @@ msgstr "" #: lib/block_scout_web/templates/address_coin_balance/index.html.eex:34 #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:61 #: lib/block_scout_web/templates/address_logs/index.html.eex:21 -#: lib/block_scout_web/templates/address_token/index.html.eex:13 +#: lib/block_scout_web/templates/address_token/index.html.eex:14 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 #: lib/block_scout_web/templates/address_transaction/index.html.eex:57 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 @@ -1693,7 +1693,12 @@ msgstr "" msgid "New Smart Contract Verification" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/transaction/overview.html.eex:178 msgid " Token Transfer" msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_token/index.html.eex:8 +msgid "Download all token transfers as csv" +msgstr "" From ec2719936fad336cc5e2f25000f2a8774820bcfc Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 13:08:34 +0300 Subject: [PATCH 27/81] show all token transfers --- .../templates/transaction/overview.html.eex | 8 +++++--- .../lib/block_scout_web/views/transaction_view.ex | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex index 396b8dd7c0..ca188ea231 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex @@ -170,18 +170,20 @@
<%= case token_transfer_type(@transaction) do %> - <% {type, token_transfer} -> %> + <% {type, transaction_with_transfers} when is_atom(type) -> %>

<%= if type == :erc20, do: gettext("ERC-20"), else: gettext("ERC-721")%><%= gettext " Token Transfer" %>

+ <%= for transfer <- transaction_with_transfers.token_transfers do %>

- <%= token_transfer_amount(token_transfer) %> - <%= link(token_symbol(token_transfer.token), to: token_path(BlockScoutWeb.Endpoint, :show, token_transfer.token.contract_address_hash)) %> + <%= token_transfer_amount(transfer) %> + <%= link(token_symbol(transfer.token), to: token_path(BlockScoutWeb.Endpoint, :show, transfer.token.contract_address_hash)) %>

+ <% end %>
<% _ -> %> diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex index 026147ac3e..a012e138a0 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex @@ -3,7 +3,7 @@ defmodule BlockScoutWeb.TransactionView do alias BlockScoutWeb.{AddressView, BlockView, TabHelpers} alias Cldr.Number - alias Explorer.Chain + alias Explorer.{Chain, Repo} alias Explorer.Chain.Block.Reward alias Explorer.Chain.{Address, Block, InternalTransaction, Transaction, Wei} alias Explorer.ExchangeRates.Token @@ -33,7 +33,9 @@ defmodule BlockScoutWeb.TransactionView do def value_transfer?(_), do: false def token_transfer_type(transaction) do - Chain.transaction_token_transfer_type(transaction) + transaction_with_transfers = Repo.preload(transaction, token_transfers: :token) + + {Chain.transaction_token_transfer_type(transaction), transaction_with_transfers} end def processing_time_duration(%Transaction{block: nil}) do From 9470d33a50463c9002f513fa4e86d52758e2be8d Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 13:08:46 +0300 Subject: [PATCH 28/81] token transfer type fixes --- apps/explorer/lib/explorer/chain.ex | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index c40c2a492b..72b907d552 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -2907,8 +2907,6 @@ defmodule Explorer.Chain do ) do zero_wei = %Wei{value: Decimal.new(0)} - transaction = Repo.preload(transaction, token_transfers: :token) - # https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L35 case {to_string(input), value} do # transferFrom(address,address,uint256) @@ -2932,6 +2930,9 @@ defmodule Explorer.Chain do find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + {"0xf907fc5b" <> _params, ^zero_wei} -> + :erc20 + # check for ERC 20 or for old ERC 721 token versions {unquote(TokenTransfer.transfer_function_signature()) <> params, ^zero_wei} -> types = [:address, {:uint, 256}] @@ -2957,22 +2958,23 @@ defmodule Explorer.Chain do token_transfer.from_address_hash.bytes == from_address && token_transfer.to_address_hash.bytes == to_address end) - if token_transfer, do: {:erc721, token_transfer} + if token_transfer, do: :erc721 end defp find_erc721_or_erc20_token_transfer(token_transfers, {address, decimal_value}) do token_transfer = Enum.find(token_transfers, fn token_transfer -> - token_transfer.to_address_hash.bytes == address && - (token_transfer.amount == decimal_value || token_transfer.token_id) + token_transfer.to_address_hash.bytes == address && token_transfer.amount == decimal_value end) if token_transfer do case token_transfer.token do - %Token{type: "ERC-20"} -> {:erc20, token_transfer} - %Token{type: "ERC-721"} -> {:erc721, token_transfer} + %Token{type: "ERC-20"} -> :erc20 + %Token{type: "ERC-721"} -> :erc721 _ -> nil end + else + :erc20 end end From 2790cf5f88e65eaf5fefe1b718097a45b868dc88 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 13:25:52 +0300 Subject: [PATCH 29/81] add generic title for token transfers --- .../templates/transaction/overview.html.eex | 2 +- .../lib/block_scout_web/views/transaction_view.ex | 11 ++++++++++- apps/explorer/lib/explorer/chain.ex | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex index ca188ea231..b168045fe1 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex @@ -175,7 +175,7 @@
-

<%= if type == :erc20, do: gettext("ERC-20"), else: gettext("ERC-721")%><%= gettext " Token Transfer" %>

+

<%= token_type_name(type)%><%= gettext " Token Transfer" %>

<%= for transfer <- transaction_with_transfers.token_transfers do %>

diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex index a012e138a0..1ed50d28ab 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex @@ -35,7 +35,16 @@ defmodule BlockScoutWeb.TransactionView do def token_transfer_type(transaction) do transaction_with_transfers = Repo.preload(transaction, token_transfers: :token) - {Chain.transaction_token_transfer_type(transaction), transaction_with_transfers} + type = Chain.transaction_token_transfer_type(transaction) + if type, do: {type, transaction_with_transfers} + end + + def token_type_name(type) do + case type do + :erc20 -> gettext("ERC-20 ") + :erc721 -> gettext("ERC-721 ") + :token_transfer -> "" + end end def processing_time_duration(%Transaction{block: nil}) do diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 72b907d552..e24db3ef89 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -2943,6 +2943,9 @@ defmodule Explorer.Chain do find_erc721_or_erc20_token_transfer(transaction.token_transfers, {address, decimal_value}) + {_params, ^zero_wei} -> + if Enum.count(transaction.token_transfers) > 0, do: :token_transfer + _ -> nil end From 79bed238e919537e62b534320308cfc4a2ac8296 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 14:07:54 +0300 Subject: [PATCH 30/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 60 +++++++++--------- .../priv/gettext/en/LC_MESSAGES/default.po | 62 +++++++++---------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 4e05e8266f..01aa2921c3 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -49,7 +49,7 @@ msgid "%{subnetwork} Explorer - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:133 +#: lib/block_scout_web/views/transaction_view.ex:144 msgid "(Awaiting internal transactions for status)" msgstr "" @@ -274,12 +274,12 @@ msgid "Contract Address Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:210 +#: lib/block_scout_web/views/transaction_view.ex:221 msgid "Contract Call" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:209 +#: lib/block_scout_web/views/transaction_view.ex:220 msgid "Contract Creation" msgstr "" @@ -362,12 +362,12 @@ msgid "Error trying to fetch balances." msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:137 +#: lib/block_scout_web/views/transaction_view.ex:148 msgid "Error: %{reason}" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:135 +#: lib/block_scout_web/views/transaction_view.ex:146 msgid "Error: (Awaiting internal transactions for reason)" msgstr "" @@ -377,7 +377,7 @@ msgstr "" #: lib/block_scout_web/templates/layout/app.html.eex:55 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_tile.html.eex:30 -#: lib/block_scout_web/templates/transaction/overview.html.eex:192 +#: lib/block_scout_web/templates/transaction/overview.html.eex:194 #: lib/block_scout_web/views/wei_helpers.ex:78 msgid "Ether" msgstr "" @@ -472,7 +472,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/views/address_view.ex:306 -#: lib/block_scout_web/views/transaction_view.ex:263 +#: lib/block_scout_web/views/transaction_view.ex:274 msgid "Internal Transactions" msgstr "" @@ -489,7 +489,7 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:220 +#: lib/block_scout_web/templates/transaction/overview.html.eex:222 msgid "Limit" msgstr "" @@ -499,7 +499,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/views/address_view.ex:312 -#: lib/block_scout_web/views/transaction_view.ex:264 +#: lib/block_scout_web/views/transaction_view.ex:275 msgid "Logs" msgstr "" @@ -511,7 +511,7 @@ msgid "Market Cap" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:118 +#: lib/block_scout_web/views/transaction_view.ex:129 msgid "Max of" msgstr "" @@ -601,8 +601,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:44 -#: lib/block_scout_web/views/transaction_view.ex:132 -#: lib/block_scout_web/views/transaction_view.ex:166 +#: lib/block_scout_web/views/transaction_view.ex:143 +#: lib/block_scout_web/views/transaction_view.ex:177 msgid "Pending" msgstr "" @@ -689,7 +689,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 -#: lib/block_scout_web/views/transaction_view.ex:134 +#: lib/block_scout_web/views/transaction_view.ex:145 msgid "Success" msgstr "" @@ -794,7 +794,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:5 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:4 -#: lib/block_scout_web/views/transaction_view.ex:208 +#: lib/block_scout_web/views/transaction_view.ex:219 msgid "Token Transfer" msgstr "" @@ -804,7 +804,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:4 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 #: lib/block_scout_web/views/tokens/overview_view.ex:35 -#: lib/block_scout_web/views/transaction_view.ex:262 +#: lib/block_scout_web/views/transaction_view.ex:273 msgid "Token Transfers" msgstr "" @@ -844,7 +844,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:3 -#: lib/block_scout_web/views/transaction_view.ex:211 +#: lib/block_scout_web/views/transaction_view.ex:222 msgid "Transaction" msgstr "" @@ -906,7 +906,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:214 +#: lib/block_scout_web/templates/transaction/overview.html.eex:216 msgid "Used" msgstr "" @@ -926,7 +926,7 @@ msgid "Validations" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:192 +#: lib/block_scout_web/templates/transaction/overview.html.eex:194 msgid "Value" msgstr "" @@ -1519,16 +1519,6 @@ msgstr "" msgid "Optimization runs" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:178 -msgid "ERC-20" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:178 -msgid "ERC-721" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/index.html.eex:4 msgid "API Documentation" @@ -1545,14 +1535,14 @@ msgid "View All Transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:210 +#: lib/block_scout_web/templates/transaction/overview.html.eex:212 msgid "Gas" msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 -#: lib/block_scout_web/views/transaction_view.ex:265 +#: lib/block_scout_web/views/transaction_view.ex:276 msgid "Raw Trace" msgstr "" @@ -1702,3 +1692,13 @@ msgstr "" #: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 msgid "There is no decompilded contracts for this address." msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:44 +msgid "ERC-20 " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:45 +msgid "ERC-721 " +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 142aec2b37..b90f812c34 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -49,7 +49,7 @@ msgid "%{subnetwork} Explorer - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:133 +#: lib/block_scout_web/views/transaction_view.ex:144 msgid "(Awaiting internal transactions for status)" msgstr "" @@ -274,12 +274,12 @@ msgid "Contract Address Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:210 +#: lib/block_scout_web/views/transaction_view.ex:221 msgid "Contract Call" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:209 +#: lib/block_scout_web/views/transaction_view.ex:220 msgid "Contract Creation" msgstr "" @@ -362,12 +362,12 @@ msgid "Error trying to fetch balances." msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:137 +#: lib/block_scout_web/views/transaction_view.ex:148 msgid "Error: %{reason}" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:135 +#: lib/block_scout_web/views/transaction_view.ex:146 msgid "Error: (Awaiting internal transactions for reason)" msgstr "" @@ -377,7 +377,7 @@ msgstr "" #: lib/block_scout_web/templates/layout/app.html.eex:55 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_tile.html.eex:30 -#: lib/block_scout_web/templates/transaction/overview.html.eex:192 +#: lib/block_scout_web/templates/transaction/overview.html.eex:194 #: lib/block_scout_web/views/wei_helpers.ex:78 msgid "Ether" msgstr "POA" @@ -472,7 +472,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/views/address_view.ex:306 -#: lib/block_scout_web/views/transaction_view.ex:263 +#: lib/block_scout_web/views/transaction_view.ex:274 msgid "Internal Transactions" msgstr "" @@ -489,7 +489,7 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:220 +#: lib/block_scout_web/templates/transaction/overview.html.eex:222 msgid "Limit" msgstr "" @@ -499,7 +499,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/views/address_view.ex:312 -#: lib/block_scout_web/views/transaction_view.ex:264 +#: lib/block_scout_web/views/transaction_view.ex:275 msgid "Logs" msgstr "" @@ -511,7 +511,7 @@ msgid "Market Cap" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:118 +#: lib/block_scout_web/views/transaction_view.ex:129 msgid "Max of" msgstr "" @@ -601,8 +601,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:44 -#: lib/block_scout_web/views/transaction_view.ex:132 -#: lib/block_scout_web/views/transaction_view.ex:166 +#: lib/block_scout_web/views/transaction_view.ex:143 +#: lib/block_scout_web/views/transaction_view.ex:177 msgid "Pending" msgstr "" @@ -689,7 +689,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 -#: lib/block_scout_web/views/transaction_view.ex:134 +#: lib/block_scout_web/views/transaction_view.ex:145 msgid "Success" msgstr "" @@ -794,7 +794,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:5 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:4 -#: lib/block_scout_web/views/transaction_view.ex:208 +#: lib/block_scout_web/views/transaction_view.ex:219 msgid "Token Transfer" msgstr "" @@ -804,7 +804,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:4 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 #: lib/block_scout_web/views/tokens/overview_view.ex:35 -#: lib/block_scout_web/views/transaction_view.ex:262 +#: lib/block_scout_web/views/transaction_view.ex:273 msgid "Token Transfers" msgstr "" @@ -844,7 +844,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:3 -#: lib/block_scout_web/views/transaction_view.ex:211 +#: lib/block_scout_web/views/transaction_view.ex:222 msgid "Transaction" msgstr "" @@ -906,7 +906,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:214 +#: lib/block_scout_web/templates/transaction/overview.html.eex:216 msgid "Used" msgstr "" @@ -926,7 +926,7 @@ msgid "Validations" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:192 +#: lib/block_scout_web/templates/transaction/overview.html.eex:194 msgid "Value" msgstr "" @@ -1519,16 +1519,6 @@ msgstr "" msgid "Optimization runs" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:178 -msgid "ERC-20" -msgstr "" - -#, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:178 -msgid "ERC-721" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/index.html.eex:4 msgid "API Documentation" @@ -1545,14 +1535,14 @@ msgid "View All Transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:210 +#: lib/block_scout_web/templates/transaction/overview.html.eex:212 msgid "Gas" msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 -#: lib/block_scout_web/views/transaction_view.ex:265 +#: lib/block_scout_web/views/transaction_view.ex:276 msgid "Raw Trace" msgstr "" @@ -1698,7 +1688,17 @@ msgstr "" msgid " Token Transfer" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 msgid "There is no decompilded contracts for this address." msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/views/transaction_view.ex:44 +msgid "ERC-20 " +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/views/transaction_view.ex:45 +msgid "ERC-721 " +msgstr "" From 20140b0fcb272309f4a1e7710c2d9979d52e0128 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 14:09:01 +0300 Subject: [PATCH 31/81] fix dialyzer --- apps/explorer/lib/explorer/chain.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index e24db3ef89..8284a0e2ac 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -2896,7 +2896,7 @@ defmodule Explorer.Chain do end @spec transaction_token_transfer_type(Transaction.t()) :: - {:erc20, TokenTransfer.t()} | {:erc721, TokenTransfer.t()} | nil + :erc20 | :erc721 | :token_transfer | nil def transaction_token_transfer_type( %Transaction{ status: :ok, From 33eb12091054995f7b9be9c694d7e2cdd24186ef Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 14:48:30 +0300 Subject: [PATCH 32/81] fix tests --- apps/explorer/test/explorer/chain_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/explorer/test/explorer/chain_test.exs b/apps/explorer/test/explorer/chain_test.exs index 442d051e0d..2cc8273adf 100644 --- a/apps/explorer/test/explorer/chain_test.exs +++ b/apps/explorer/test/explorer/chain_test.exs @@ -3954,7 +3954,7 @@ defmodule Explorer.ChainTest do insert(:token_transfer, from_address: from_address, to_address: to_address, transaction: transaction) - assert {:erc721, _found_token_transfer} = Chain.transaction_token_transfer_type(transaction) + assert :erc721 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_trasfers)) end test "detects erc20 token transfer" do @@ -3980,7 +3980,7 @@ defmodule Explorer.ChainTest do amount: 8_025_000_000_000_000_000_000 ) - assert {:erc20, _found_token_transfer} = Chain.transaction_token_transfer_type(transaction) + assert :erc20 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_trasfers)) end end From 96bfe828fb7e8f161562c7f6798e122d71400860 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 14:56:14 +0300 Subject: [PATCH 33/81] fix typo --- apps/explorer/test/explorer/chain_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/explorer/test/explorer/chain_test.exs b/apps/explorer/test/explorer/chain_test.exs index 2cc8273adf..5e7472bae1 100644 --- a/apps/explorer/test/explorer/chain_test.exs +++ b/apps/explorer/test/explorer/chain_test.exs @@ -3954,7 +3954,7 @@ defmodule Explorer.ChainTest do insert(:token_transfer, from_address: from_address, to_address: to_address, transaction: transaction) - assert :erc721 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_trasfers)) + assert :erc721 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_transfers)) end test "detects erc20 token transfer" do @@ -3980,7 +3980,7 @@ defmodule Explorer.ChainTest do amount: 8_025_000_000_000_000_000_000 ) - assert :erc20 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_trasfers)) + assert :erc20 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_transfers)) end end From 0ac8d0e10a331dc6caed54cf1b5b3658bf9763da Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 15:04:59 +0300 Subject: [PATCH 34/81] preload token --- apps/explorer/test/explorer/chain_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/explorer/test/explorer/chain_test.exs b/apps/explorer/test/explorer/chain_test.exs index 5e7472bae1..f789a883ea 100644 --- a/apps/explorer/test/explorer/chain_test.exs +++ b/apps/explorer/test/explorer/chain_test.exs @@ -3954,7 +3954,7 @@ defmodule Explorer.ChainTest do insert(:token_transfer, from_address: from_address, to_address: to_address, transaction: transaction) - assert :erc721 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_transfers)) + assert :erc721 = Chain.transaction_token_transfer_type(Repo.preload(transaction, token_transfers: :token)) end test "detects erc20 token transfer" do @@ -3980,7 +3980,7 @@ defmodule Explorer.ChainTest do amount: 8_025_000_000_000_000_000_000 ) - assert :erc20 = Chain.transaction_token_transfer_type(Repo.preload(transaction, :token_transfers)) + assert :erc20 = Chain.transaction_token_transfer_type(Repo.preload(transaction, token_transfers: :token)) end end From b30ff3de25f9540e629bcee8751a10ee3797b4af Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 15:16:46 +0300 Subject: [PATCH 35/81] add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0a5f0898..487e4d6266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Current ### Features +- [#2190](https://github.com/poanetwork/blockscout/pull/2190) - show all token transfers - [#2109](https://github.com/poanetwork/blockscout/pull/2109) - use bigger updates instead of `Multi` transactions in BlocksTransactionsMismatch - [#2075](https://github.com/poanetwork/blockscout/pull/2075) - add blocks cache - [#2151](https://github.com/poanetwork/blockscout/pull/2151) - hide dropdown menu then other networks list is empty From 99d0a98fd37e0d5fd150c942072b6d60ed17c919 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 18 Jun 2019 15:18:00 +0300 Subject: [PATCH 36/81] fix CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 487e4d6266..891517bd5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ## Current +### Features + - [#2190](https://github.com/poanetwork/blockscout/pull/2190) - show all token transfers ### Features -- [#2190](https://github.com/poanetwork/blockscout/pull/2190) - show all token transfers - [#2109](https://github.com/poanetwork/blockscout/pull/2109) - use bigger updates instead of `Multi` transactions in BlocksTransactionsMismatch - [#2075](https://github.com/poanetwork/blockscout/pull/2075) - add blocks cache - [#2151](https://github.com/poanetwork/blockscout/pull/2151) - hide dropdown menu then other networks list is empty From c66ec8018c6973752d96b074760c3af6065d663e Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Wed, 19 Jun 2019 16:37:41 +0300 Subject: [PATCH 37/81] search network input functionality, add to favorites functionality --- .../css/components/_network-selector.scss | 3 +- apps/block_scout_web/assets/js/app.js | 2 + .../assets/js/pages/favorites.js | 41 +++++++++++++++++++ .../assets/js/pages/network-search.js | 21 ++++++++++ .../layout/_network_selector.html.eex | 6 +-- .../layout/_network_selector_item.html.eex | 4 +- 6 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 apps/block_scout_web/assets/js/pages/favorites.js create mode 100644 apps/block_scout_web/assets/js/pages/network-search.js diff --git a/apps/block_scout_web/assets/css/components/_network-selector.scss b/apps/block_scout_web/assets/css/components/_network-selector.scss index 4b1068fab4..3086639050 100644 --- a/apps/block_scout_web/assets/css/components/_network-selector.scss +++ b/apps/block_scout_web/assets/css/components/_network-selector.scss @@ -41,7 +41,7 @@ $network-selector-item-icon-dimensions: 30px !default; margin-left: auto; max-width: 398px; min-width: 0; - padding: 28px 0 35px; + padding-top: 28px; position: relative; transition: right 0.25s ease-out; } @@ -266,7 +266,6 @@ $network-selector-item-icon-dimensions: 30px !default; .network-selector-networks-container { flex-grow: 1; flex-shrink: 1; - margin: 0 0 30px; min-height: 100px; overflow: auto; padding: 0 $network-selector-horizontal-padding; diff --git a/apps/block_scout_web/assets/js/app.js b/apps/block_scout_web/assets/js/app.js index 25745125e2..fe0fd5250d 100644 --- a/apps/block_scout_web/assets/js/app.js +++ b/apps/block_scout_web/assets/js/app.js @@ -31,6 +31,8 @@ import './pages/chain' import './pages/pending_transactions' import './pages/transaction' import './pages/transactions' +import './pages/favorites' +import './pages/network-search' import './pages/admin/tasks.js' diff --git a/apps/block_scout_web/assets/js/pages/favorites.js b/apps/block_scout_web/assets/js/pages/favorites.js new file mode 100644 index 0000000000..56cbe04d4f --- /dev/null +++ b/apps/block_scout_web/assets/js/pages/favorites.js @@ -0,0 +1,41 @@ +import $ from 'jquery' + +var favoritesQuantity = 0, + favoritesContainer = $(".js-favorites-tab"), + favoritesNetworksUrls = []; + +$(document).on("change", ".network-selector-item-favorite input[type='checkbox']", function () { + + var networkUrl = $(this).attr("data-url"), + thisStatus = $(this).is(":checked"), + parent = $(".network-selector-item[data-url='" + networkUrl +"'").clone(), + workWith = $(".network-selector-item[data-url='" + networkUrl +"'"); + + // Add new checkbox status to same network in another tabs + $(".network-selector-item-favorite input[data-url='" + networkUrl +"']").prop("checked", thisStatus); + + // Push or remove favorite networks to array + var found = $.inArray(networkUrl, favoritesNetworksUrls); + if (found < 0 && thisStatus == true) { + favoritesNetworksUrls.push(networkUrl); + } else { + var index = favoritesNetworksUrls.indexOf(networkUrl); + if(index!=-1){ + favoritesNetworksUrls.splice(index, 1); + } + } + console.log(favoritesNetworksUrls); + // Append or remove item from 'favorites' tab + + if (thisStatus == true) { + favoritesContainer.append(parent[0]); + $(".js-favorites-tab .network-selector-tab-content-empty").hide(); + } else { + var willRemoved = favoritesContainer.find(workWith); + willRemoved.remove(); + if (favoritesNetworksUrls.length == 0) { + $(".js-favorites-tab .network-selector-tab-content-empty").show(); + } + } + +}); \ No newline at end of file diff --git a/apps/block_scout_web/assets/js/pages/network-search.js b/apps/block_scout_web/assets/js/pages/network-search.js new file mode 100644 index 0000000000..e508bbe91b --- /dev/null +++ b/apps/block_scout_web/assets/js/pages/network-search.js @@ -0,0 +1,21 @@ +import $ from 'jquery' + +var networkSearchInput = $(".network-selector-search-input"), + networkSearchInputVal = ""; + +$(networkSearchInput).on("input", function() { + networkSearchInputVal = $(this).val(); + + $.expr[":"].Contains = $.expr.createPseudo(function(arg) { + return function( elem ) { + return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0; + }; + }); + + if (networkSearchInputVal == "") { + $(".network-selector-item").show(); + } else { + $(".network-selector-item").hide(); + $(".network-selector-item:Contains('" + networkSearchInputVal + "')").show(); + } +}); \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex index eadf1b4503..044d8790bc 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex @@ -43,13 +43,13 @@ <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Testnet" %> <% end %>

-
+
No content.
-
+
\ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex index a798178455..11f3c83dfe 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex @@ -1,4 +1,4 @@ -
+
-
\ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex index 11f3c83dfe..af6d8df375 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex @@ -5,7 +5,7 @@ - .png');"> + .png');"> <%= @title %> diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 7dca514693..1b22f7969c 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1721,11 +1721,6 @@ msgstr "" msgid "Search network" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:51 -msgid "Show More Networks" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 msgid "Testnet" From 1393edbaae43d0c827d8213745f1937dabbb89cc Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 20 Jun 2019 11:06:55 +0300 Subject: [PATCH 43/81] jslint test fix --- apps/block_scout_web/assets/js/pages/favorites.js | 6 +++--- apps/block_scout_web/assets/js/pages/network-search.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/block_scout_web/assets/js/pages/favorites.js b/apps/block_scout_web/assets/js/pages/favorites.js index 38d4da45ee..9f9d8f39cc 100644 --- a/apps/block_scout_web/assets/js/pages/favorites.js +++ b/apps/block_scout_web/assets/js/pages/favorites.js @@ -11,9 +11,9 @@ if (localStorage.getItem('favoritesNetworksUrls') === null) { $(document).on('change', ".network-selector-item-favorite input[type='checkbox']", function () { var networkUrl = $(this).attr('data-url') - var thisStatus = $(this).is(':checked'); - var parent = $(".network-selector-item[data-url='" + networkUrl + "'").clone(); - var workWith = $(".network-selector-item[data-url='" + networkUrl + "'"); + var thisStatus = $(this).is(':checked') + var parent = $(".network-selector-item[data-url='" + networkUrl + "'").clone() + var workWith = $(".network-selector-item[data-url='" + networkUrl + "'") // Add new checkbox status to same network in another tabs $(".network-selector-item-favorite input[data-url='" + networkUrl + "']").prop('checked', thisStatus) diff --git a/apps/block_scout_web/assets/js/pages/network-search.js b/apps/block_scout_web/assets/js/pages/network-search.js index b73ea635b9..36b7e02348 100644 --- a/apps/block_scout_web/assets/js/pages/network-search.js +++ b/apps/block_scout_web/assets/js/pages/network-search.js @@ -1,7 +1,7 @@ import $ from 'jquery' var networkSearchInput = $('.network-selector-search-input') -var networkSearchInputVal = "" +var networkSearchInputVal = '' $(networkSearchInput).on('input', function () { networkSearchInputVal = $(this).val() From a1eaa412804fad347e8e142bb290699bd407a84c Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 20 Jun 2019 15:51:38 +0300 Subject: [PATCH 44/81] added styles for download transactions csv button --- .../assets/css/components/_transaction.scss | 50 +++++++++++++++++++ .../address_transaction/index.html.eex | 14 ++++-- apps/block_scout_web/priv/gettext/default.pot | 19 +++---- 3 files changed, 69 insertions(+), 14 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_transaction.scss b/apps/block_scout_web/assets/css/components/_transaction.scss index 5214b0b301..b949e0f055 100644 --- a/apps/block_scout_web/assets/css/components/_transaction.scss +++ b/apps/block_scout_web/assets/css/components/_transaction.scss @@ -4,3 +4,53 @@ line-height: 1.2; margin: 0 0 12px; } + +.transaction-top-panel, .transaction-bottom-panel { + display: flex; + justify-content: space-between; + flex-direction: column; + @media (min-width: 500px) { + flex-direction: row; + } +} + +.transaction-top-panel { + .pagination-container { + margin-top: 30px; + } + @media (min-width: 500px) { + align-items: flex-start; + .pagination-container { + margin-top: 0; + } + } +} + +.transaction-bottom-panel { + @media (min-width: 500px) { + align-items: flex-end; + } +} + +.download-csv { + display: inline-block; + height: 24px; + background: #f5f6fa; + border-radius: 2px; + outline: none; + font-family: Nunito, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 12px; + line-height: 25px; + padding: 0 10px; + font-weight: 600; + cursor: pointer; + color: #a3a9b5; + text-align: center; + transition: .1s ease-in; + text-decoration: none !important; + &:hover { + background-color: $primary; + color: #fff; + border-color: $primary; + } +} \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index 87ab7eba56..5c1552e943 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -6,7 +6,6 @@
<%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %> - - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
+ to_string(@address.hash)}) %>><%= gettext("Download All Transactions as CSV") %> + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
- - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + +
+ to_string(@address.hash)}) %>><%= gettext("Download All Transactions as CSV") %> + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 90c5b8751b..e498b3dbfb 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -111,7 +111,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:24 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:23 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -244,7 +244,7 @@ msgid "Connection Lost, click to load newer internal transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:12 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:11 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:15 #: lib/block_scout_web/templates/transaction/index.html.eex:15 msgid "Connection Lost, click to load newer transactions" @@ -404,7 +404,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:44 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:41 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:40 #: lib/block_scout_web/views/address_internal_transaction_view.ex:7 #: lib/block_scout_web/views/address_transaction_view.ex:7 msgid "From" @@ -742,7 +742,7 @@ msgid "There are no tokens." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:63 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:64 msgid "There are no transactions for this address." msgstr "" @@ -763,7 +763,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:33 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:30 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:29 #: lib/block_scout_web/views/address_internal_transaction_view.ex:6 #: lib/block_scout_web/views/address_transaction_view.ex:6 msgid "To" @@ -867,7 +867,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:3 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:16 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:15 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/chain/show.html.eex:108 @@ -1211,7 +1211,7 @@ msgstr "" #: lib/block_scout_web/templates/address_logs/index.html.eex:21 #: lib/block_scout_web/templates/address_token/index.html.eex:13 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:58 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:59 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 #: lib/block_scout_web/templates/block_transaction/index.html.eex:23 #: lib/block_scout_web/templates/chain/show.html.eex:91 @@ -1696,6 +1696,7 @@ msgid "New Smart Contract Verification" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:9 -msgid "Download all transactions as csv" +#: lib/block_scout_web/templates/address_transaction/index.html.eex:54 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:71 +msgid "Download All Transactions as CSV" msgstr "" From 2024c0691846cb8f599cb8b04b9cc95df77f2580 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Thu, 20 Jun 2019 15:55:08 +0300 Subject: [PATCH 45/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08b3987ac2..e16b56929c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - [#2064](https://github.com/poanetwork/blockscout/pull/2064) - feat: add fields to tx apis, small cleanups ### Fixes +- [#2206](https://github.com/poanetwork/blockscout/pull/2206) - added styles for 'Download All Transactions as CSV' button - [#2099](https://github.com/poanetwork/blockscout/pull/2099) - logs search input width - [#2098](https://github.com/poanetwork/blockscout/pull/2098) - nav dropdown issue, logo size issue - [#2082](https://github.com/poanetwork/blockscout/pull/2082) - dropdown styles, tooltip gap fix, 404 page added From f8966e259c3503797e50a887e86def511e592c70 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 20 Jun 2019 17:31:22 +0300 Subject: [PATCH 46/81] redesigned 'download csv' button --- .../assets/css/components/_transaction.scss | 73 +++++++------------ .../address_transaction/index.html.eex | 20 +++-- apps/block_scout_web/priv/gettext/default.pot | 5 +- 3 files changed, 42 insertions(+), 56 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_transaction.scss b/apps/block_scout_web/assets/css/components/_transaction.scss index b949e0f055..1fd1c6241e 100644 --- a/apps/block_scout_web/assets/css/components/_transaction.scss +++ b/apps/block_scout_web/assets/css/components/_transaction.scss @@ -1,56 +1,35 @@ -.transaction-details-address { - font-size: 12px; - font-weight: bold; - line-height: 1.2; - margin: 0 0 12px; -} - -.transaction-top-panel, .transaction-bottom-panel { +.transaction-bottom-panel { display: flex; - justify-content: space-between; flex-direction: column; - @media (min-width: 500px) { - flex-direction: row; + @media (min-width: 768px) { + flex-direction: row; + justify-content: space-between; + align-items: flex-end; } } -.transaction-top-panel { - .pagination-container { - margin-top: 30px; +.download-all-transactions { + text-align: center; + color: #a3a9b5; + font-size: 14px; + margin-top: 10px; + @media (min-width: 768px) { + margin-top: 0; } - @media (min-width: 500px) { - align-items: flex-start; - .pagination-container { - margin-top: 0; + .download-all-transactions-link { + text-decoration: none; + svg { + position: relative; + margin-left: 2px; + top: -3px; + path { + fill: $primary; + } + } + &:hover { + span { + text-decoration: underline; + } } } -} - -.transaction-bottom-panel { - @media (min-width: 500px) { - align-items: flex-end; - } -} - -.download-csv { - display: inline-block; - height: 24px; - background: #f5f6fa; - border-radius: 2px; - outline: none; - font-family: Nunito, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - font-size: 12px; - line-height: 25px; - padding: 0 10px; - font-weight: 600; - cursor: pointer; - color: #a3a9b5; - text-align: center; - transition: .1s ease-in; - text-decoration: none !important; - &:hover { - background-color: $primary; - color: #fff; - border-color: $primary; - } } \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index 5c1552e943..a24df921c6 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -50,10 +50,10 @@
-
- to_string(@address.hash)}) %>><%= gettext("Download All Transactions as CSV") %> - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> -
+ + + + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
- +
- to_string(@address.hash)}) %>><%= gettext("Download All Transactions as CSV") %> + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index e498b3dbfb..baa5de07df 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1696,7 +1696,6 @@ msgid "New Smart Contract Verification" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:54 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:71 -msgid "Download All Transactions as CSV" +#: lib/block_scout_web/templates/address_transaction/index.html.eex:74 +msgid "CSV" msgstr "" From faabdbbbe6c8efd21410374bbc608fc7a7cb619d Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Thu, 20 Jun 2019 17:35:39 +0300 Subject: [PATCH 47/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e16b56929c..315009fd25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - [#2064](https://github.com/poanetwork/blockscout/pull/2064) - feat: add fields to tx apis, small cleanups ### Fixes +- [#2207](https://github.com/poanetwork/blockscout/pull/2207) - new 'download csv' button design - [#2206](https://github.com/poanetwork/blockscout/pull/2206) - added styles for 'Download All Transactions as CSV' button - [#2099](https://github.com/poanetwork/blockscout/pull/2099) - logs search input width - [#2098](https://github.com/poanetwork/blockscout/pull/2098) - nav dropdown issue, logo size issue From 7a733e66b575839e59526fdb030c745664fa6acd Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Fri, 21 Jun 2019 09:52:21 -0300 Subject: [PATCH 48/81] (update) internationalization files --- apps/block_scout_web/priv/gettext/default.pot | 39 +++++++++++++++-- .../priv/gettext/en/LC_MESSAGES/default.po | 43 ++++++++++++++++--- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 4ca9c47102..1cf4275fcf 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -666,8 +667,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:116 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:133 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:102 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:119 msgid "Search" msgstr "" @@ -1480,8 +1481,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:110 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:96 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:100 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1748,3 +1749,33 @@ msgstr "" #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 msgid "here." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index a78a1ce9e8..b1e80dd1ac 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -112,6 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -666,8 +667,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/index.html.eex:14 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:116 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:133 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:102 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:119 msgid "Search" msgstr "" @@ -1480,8 +1481,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:110 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:114 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:96 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:100 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" @@ -1714,7 +1715,7 @@ msgstr "" msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 msgid "ETH RPC API Documentation" msgstr "" @@ -1744,7 +1745,37 @@ msgstr "" msgid "custom RPC" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 msgid "here." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +msgid "Change Network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +msgid "Favorites" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +msgid "Mainnet" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +msgid "Search network" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +msgid "Testnet" +msgstr "" From 368b08ec457a72ad2cdaecd2c6dc502ac2302a51 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Mon, 24 Jun 2019 16:14:14 +0300 Subject: [PATCH 49/81] Update favorites.js --- apps/block_scout_web/assets/js/pages/favorites.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/block_scout_web/assets/js/pages/favorites.js b/apps/block_scout_web/assets/js/pages/favorites.js index 9f9d8f39cc..e5c7627575 100644 --- a/apps/block_scout_web/assets/js/pages/favorites.js +++ b/apps/block_scout_web/assets/js/pages/favorites.js @@ -12,12 +12,14 @@ if (localStorage.getItem('favoritesNetworksUrls') === null) { $(document).on('change', ".network-selector-item-favorite input[type='checkbox']", function () { var networkUrl = $(this).attr('data-url') var thisStatus = $(this).is(':checked') - var parent = $(".network-selector-item[data-url='" + networkUrl + "'").clone() var workWith = $(".network-selector-item[data-url='" + networkUrl + "'") // Add new checkbox status to same network in another tabs $(".network-selector-item-favorite input[data-url='" + networkUrl + "']").prop('checked', thisStatus) + // Clone + var parent = $(".network-selector-item[data-url='" + networkUrl + "'").clone() + // Push or remove favorite networks to array var found = $.inArray(networkUrl, favoritesNetworksUrls) if (found < 0 && thisStatus === true) { @@ -29,6 +31,10 @@ $(document).on('change', ".network-selector-item-favorite input[type='checkbox'] } } + // Push to localstorage + var willBePushed = JSON.stringify(favoritesNetworksUrls) + localStorage.setItem('favoritesNetworksUrls', willBePushed) + // Append or remove item from 'favorites' tab if (thisStatus === true) { favoritesContainer.append(parent[0]) @@ -41,15 +47,12 @@ $(document).on('change', ".network-selector-item-favorite input[type='checkbox'] } } - // Push to localstorage - var willBePushed = JSON.stringify(favoritesNetworksUrls) - localStorage.setItem('favoritesNetworksUrls', willBePushed) }) if (favoritesNetworksUrls.length > 0) { $('.js-favorites-tab .network-selector-tab-content-empty').hide() for (var i = 0; i < favoritesNetworksUrls.length + 1; i++) { - $(".network-selector-item[data-url='" + favoritesNetworksUrls[i] + "'").find('input').prop('checked', true) + $(".network-selector-item[data-url='" + favoritesNetworksUrls[i] + "'").find('input[data-url]').prop('checked', true) var parent = $(".network-selector-item[data-url='" + favoritesNetworksUrls[i] + "'").clone() favoritesContainer.append(parent[0]) } From c947a8d67bcb01d0ce19b2816c093b19fed4dc0f Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Mon, 24 Jun 2019 16:15:24 +0300 Subject: [PATCH 50/81] Update _network_selector_item.html.eex --- .../templates/layout/_network_selector_item.html.eex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex index af6d8df375..55ea7a6023 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector_item.html.eex @@ -1,7 +1,7 @@
-
\ No newline at end of file +
From f6c48f01f02b8ce1acc7aaf2202e5b413b0293a2 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Mon, 24 Jun 2019 16:18:04 +0300 Subject: [PATCH 51/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c1aa2d25..7dc1eb29a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - [#2064](https://github.com/poanetwork/blockscout/pull/2064) - feat: add fields to tx apis, small cleanups ### Fixes +- [#2228](https://github.com/poanetwork/blockscout/pull/2228) - favorites duplication issues, active radio issue - [#2082](https://github.com/poanetwork/blockscout/pull/2082) - dropdown styles, tooltip gap fix, 404 page added - [#2077](https://github.com/poanetwork/blockscout/pull/2077) - ui issues - [#2072](https://github.com/poanetwork/blockscout/pull/2072) - Fixed checkmarks not showing correctly in tabs. From f6a284cf6b9f1ead52763bfc0f83a037d9c8397d Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Mon, 24 Jun 2019 16:24:20 +0300 Subject: [PATCH 52/81] Update favorites.js --- apps/block_scout_web/assets/js/pages/favorites.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/block_scout_web/assets/js/pages/favorites.js b/apps/block_scout_web/assets/js/pages/favorites.js index e5c7627575..055cac8c0f 100644 --- a/apps/block_scout_web/assets/js/pages/favorites.js +++ b/apps/block_scout_web/assets/js/pages/favorites.js @@ -46,7 +46,6 @@ $(document).on('change', ".network-selector-item-favorite input[type='checkbox'] $('.js-favorites-tab .network-selector-tab-content-empty').show() } } - }) if (favoritesNetworksUrls.length > 0) { From 91f33e2f38f9dfb154f861f3c48f2cfc8e1b72a5 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 10:33:49 +0300 Subject: [PATCH 53/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 57 +++++++++++++- .../priv/gettext/en/LC_MESSAGES/default.po | 77 ++++++++++++++++--- 2 files changed, 122 insertions(+), 12 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index b6fcc69fcc..d21d2703bd 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1692,4 +1692,59 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 msgid "There is no decompilded contracts for this address." -msgstr "" \ No newline at end of file +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 +msgid " is recommended." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 +msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:44 +msgid "ERC-20 " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:45 +msgid "ERC-721 " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 +msgid "ETH RPC API Documentation" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +msgid "Eth RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:11 +msgid "However, in general, the" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 +msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:10 +msgid "This is useful to allow sending requests to blockscout without having to change anything about the request." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:12 +msgid "custom RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 +msgid "here." +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index be7eb43b58..ee32dea6ce 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -105,7 +105,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/index.html.eex:4 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:59 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:60 msgid "Addresses" msgstr "" @@ -210,8 +210,8 @@ msgstr "" #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 #: lib/block_scout_web/templates/address/overview.html.eex:144 #: lib/block_scout_web/templates/address/overview.html.eex:152 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:114 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115 msgid "Close" msgstr "" @@ -626,8 +626,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:33 #: lib/block_scout_web/templates/address/overview.html.eex:143 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:35 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:105 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 msgid "QR Code" msgstr "" @@ -684,7 +684,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:34 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:37 msgid "Show QR Code" msgstr "" @@ -834,7 +834,7 @@ msgid "Total Difficulty" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:74 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:75 msgid "Total Supply" msgstr "" @@ -881,7 +881,7 @@ msgid "Transactions sent" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:60 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:61 msgid "Transfers" msgstr "" @@ -943,7 +943,7 @@ msgid "Verify & publish" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:54 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:55 msgid "View Contract" msgstr "" @@ -1048,7 +1048,7 @@ msgid "Self-Destruct" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:62 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:63 msgid "Decimals" msgstr "" @@ -1692,4 +1692,59 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 msgid "There is no decompilded contracts for this address." -msgstr "" \ No newline at end of file +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 +msgid " is recommended." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 +msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:44 +msgid "ERC-20 " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:45 +msgid "ERC-721 " +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 +msgid "ETH RPC API Documentation" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +msgid "Eth RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:11 +msgid "However, in general, the" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 +msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:10 +msgid "This is useful to allow sending requests to blockscout without having to change anything about the request." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:12 +msgid "custom RPC" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 +msgid "here." +msgstr "" From 7cb662d09999b76443ecb16640d401110ea5d10f Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 10:44:47 +0300 Subject: [PATCH 54/81] fix unidentified token transfers --- apps/explorer/lib/explorer/chain.ex | 61 +++++++++++++++-------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 4834a20adf..01a44e1cbe 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -2935,47 +2935,50 @@ defmodule Explorer.Chain do zero_wei = %Wei{value: Decimal.new(0)} # https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L35 - case {to_string(input), value} do - # transferFrom(address,address,uint256) - {"0x23b872dd" <> params, ^zero_wei} -> - types = [:address, :address, {:uint, 256}] - [from_address, to_address, _value] = decode_params(params, types) + result = + case {to_string(input), value} do + # transferFrom(address,address,uint256) + {"0x23b872dd" <> params, ^zero_wei} -> + types = [:address, :address, {:uint, 256}] + [from_address, to_address, _value] = decode_params(params, types) - find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) - # safeTransferFrom(address,address,uint256) - {"0x42842e0e" <> params, ^zero_wei} -> - types = [:address, :address, {:uint, 256}] - [from_address, to_address, _value] = decode_params(params, types) + # safeTransferFrom(address,address,uint256) + {"0x42842e0e" <> params, ^zero_wei} -> + types = [:address, :address, {:uint, 256}] + [from_address, to_address, _value] = decode_params(params, types) - find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) - # safeTransferFrom(address,address,uint256,bytes) - {"0xb88d4fde" <> params, ^zero_wei} -> - types = [:address, :address, {:uint, 256}, :bytes] - [from_address, to_address, _value, _data] = decode_params(params, types) + # safeTransferFrom(address,address,uint256,bytes) + {"0xb88d4fde" <> params, ^zero_wei} -> + types = [:address, :address, {:uint, 256}, :bytes] + [from_address, to_address, _value, _data] = decode_params(params, types) - find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) - {"0xf907fc5b" <> _params, ^zero_wei} -> - :erc20 + {"0xf907fc5b" <> _params, ^zero_wei} -> + :erc20 - # check for ERC 20 or for old ERC 721 token versions - {unquote(TokenTransfer.transfer_function_signature()) <> params, ^zero_wei} -> - types = [:address, {:uint, 256}] + # check for ERC 20 or for old ERC 721 token versions + {unquote(TokenTransfer.transfer_function_signature()) <> params, ^zero_wei} -> + types = [:address, {:uint, 256}] - [address, value] = decode_params(params, types) + [address, value] = decode_params(params, types) - decimal_value = Decimal.new(value) + decimal_value = Decimal.new(value) - find_erc721_or_erc20_token_transfer(transaction.token_transfers, {address, decimal_value}) + find_erc721_or_erc20_token_transfer(transaction.token_transfers, {address, decimal_value}) - {_params, ^zero_wei} -> - if Enum.count(transaction.token_transfers) > 0, do: :token_transfer + {_params, ^zero_wei} -> + if Enum.count(transaction.token_transfers) > 0, do: :token_transfer - _ -> - nil - end + _ -> + nil + end + + if is_nil(result) && Enum.count(transaction.token_transfers) > 0, do: :token_transfer, else: result rescue _ -> nil end From d8f904f063c9628a2eb08f3e2015aadf8a865337 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 11:04:26 +0300 Subject: [PATCH 55/81] fix spaces --- .../block_scout_web/templates/transaction/overview.html.eex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex index b168045fe1..fe347ee904 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex @@ -176,14 +176,16 @@

<%= token_type_name(type)%><%= gettext " Token Transfer" %>

- <%= for transfer <- transaction_with_transfers.token_transfers do %>
+ <%= for transfer <- transaction_with_transfers.token_transfers do %> +

<%= token_transfer_amount(transfer) %> <%= link(token_symbol(transfer.token), to: token_path(BlockScoutWeb.Endpoint, :show, transfer.token.contract_address_hash)) %>

-
+ <% end %> +
<% _ -> %> From 41b069c1e1fd09137ee09cb04557cf4676de1aca Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 11:11:22 +0300 Subject: [PATCH 56/81] fix credo --- apps/explorer/lib/explorer/chain.ex | 75 +++++++++++++++-------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 01a44e1cbe..e4416030b0 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -2933,58 +2933,61 @@ defmodule Explorer.Chain do } = transaction ) do zero_wei = %Wei{value: Decimal.new(0)} + result = find_token_transfer_type(transaction, input, value) - # https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L35 - result = - case {to_string(input), value} do - # transferFrom(address,address,uint256) - {"0x23b872dd" <> params, ^zero_wei} -> - types = [:address, :address, {:uint, 256}] - [from_address, to_address, _value] = decode_params(params, types) + if is_nil(result) && Enum.count(transaction.token_transfers) > 0 && value == zero_wei, + do: :token_transfer, + else: result + rescue + _ -> nil + end + + def transaction_token_transfer_type(_), do: nil - find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + defp find_token_transfer_type(transaction, input, value) do + zero_wei = %Wei{value: Decimal.new(0)} - # safeTransferFrom(address,address,uint256) - {"0x42842e0e" <> params, ^zero_wei} -> - types = [:address, :address, {:uint, 256}] - [from_address, to_address, _value] = decode_params(params, types) + # https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L35 + case {to_string(input), value} do + # transferFrom(address,address,uint256) + {"0x23b872dd" <> params, ^zero_wei} -> + types = [:address, :address, {:uint, 256}] + [from_address, to_address, _value] = decode_params(params, types) - find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) - # safeTransferFrom(address,address,uint256,bytes) - {"0xb88d4fde" <> params, ^zero_wei} -> - types = [:address, :address, {:uint, 256}, :bytes] - [from_address, to_address, _value, _data] = decode_params(params, types) + # safeTransferFrom(address,address,uint256) + {"0x42842e0e" <> params, ^zero_wei} -> + types = [:address, :address, {:uint, 256}] + [from_address, to_address, _value] = decode_params(params, types) - find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) + find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) - {"0xf907fc5b" <> _params, ^zero_wei} -> - :erc20 + # safeTransferFrom(address,address,uint256,bytes) + {"0xb88d4fde" <> params, ^zero_wei} -> + types = [:address, :address, {:uint, 256}, :bytes] + [from_address, to_address, _value, _data] = decode_params(params, types) - # check for ERC 20 or for old ERC 721 token versions - {unquote(TokenTransfer.transfer_function_signature()) <> params, ^zero_wei} -> - types = [:address, {:uint, 256}] + find_erc721_token_transfer(transaction.token_transfers, {from_address, to_address}) - [address, value] = decode_params(params, types) + {"0xf907fc5b" <> _params, ^zero_wei} -> + :erc20 - decimal_value = Decimal.new(value) + # check for ERC 20 or for old ERC 721 token versions + {unquote(TokenTransfer.transfer_function_signature()) <> params, ^zero_wei} -> + types = [:address, {:uint, 256}] - find_erc721_or_erc20_token_transfer(transaction.token_transfers, {address, decimal_value}) + [address, value] = decode_params(params, types) - {_params, ^zero_wei} -> - if Enum.count(transaction.token_transfers) > 0, do: :token_transfer + decimal_value = Decimal.new(value) - _ -> - nil - end + find_erc721_or_erc20_token_transfer(transaction.token_transfers, {address, decimal_value}) - if is_nil(result) && Enum.count(transaction.token_transfers) > 0, do: :token_transfer, else: result - rescue - _ -> nil + _ -> + nil + end end - def transaction_token_transfer_type(_), do: nil - defp find_erc721_token_transfer(token_transfers, {from_address, to_address}) do token_transfer = Enum.find(token_transfers, fn token_transfer -> From 6d2e355ece5007f8c86edbcb840633d0f0a0aeb0 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 11:12:00 +0300 Subject: [PATCH 57/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 10 +++++----- .../priv/gettext/en/LC_MESSAGES/default.po | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index d21d2703bd..5a0edf2bfe 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -378,7 +378,7 @@ msgstr "" #: lib/block_scout_web/templates/layout/app.html.eex:55 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_tile.html.eex:30 -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 +#: lib/block_scout_web/templates/transaction/overview.html.eex:196 #: lib/block_scout_web/views/wei_helpers.ex:78 msgid "Ether" msgstr "" @@ -490,7 +490,7 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:222 +#: lib/block_scout_web/templates/transaction/overview.html.eex:224 msgid "Limit" msgstr "" @@ -907,7 +907,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:216 +#: lib/block_scout_web/templates/transaction/overview.html.eex:218 msgid "Used" msgstr "" @@ -927,7 +927,7 @@ msgid "Validations" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 +#: lib/block_scout_web/templates/transaction/overview.html.eex:196 msgid "Value" msgstr "" @@ -1536,7 +1536,7 @@ msgid "View All Transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:212 +#: lib/block_scout_web/templates/transaction/overview.html.eex:214 msgid "Gas" msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index ee32dea6ce..45a2e7d8de 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -378,7 +378,7 @@ msgstr "" #: lib/block_scout_web/templates/layout/app.html.eex:55 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_tile.html.eex:30 -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 +#: lib/block_scout_web/templates/transaction/overview.html.eex:196 #: lib/block_scout_web/views/wei_helpers.ex:78 msgid "Ether" msgstr "POA" @@ -490,7 +490,7 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:222 +#: lib/block_scout_web/templates/transaction/overview.html.eex:224 msgid "Limit" msgstr "" @@ -907,7 +907,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:216 +#: lib/block_scout_web/templates/transaction/overview.html.eex:218 msgid "Used" msgstr "" @@ -927,7 +927,7 @@ msgid "Validations" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 +#: lib/block_scout_web/templates/transaction/overview.html.eex:196 msgid "Value" msgstr "" @@ -1536,7 +1536,7 @@ msgid "View All Transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:212 +#: lib/block_scout_web/templates/transaction/overview.html.eex:214 msgid "Gas" msgstr "" @@ -1714,7 +1714,7 @@ msgstr "" msgid "ERC-721 " msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 msgid "ETH RPC API Documentation" msgstr "" @@ -1744,7 +1744,7 @@ msgstr "" msgid "custom RPC" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 msgid "here." msgstr "" From 5f9caa80636a35af989f05f95c316fec14c4e433 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 16:49:11 +0300 Subject: [PATCH 58/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 57 +++++++++++++- .../priv/gettext/en/LC_MESSAGES/default.po | 77 ++++++++++++++++--- 2 files changed, 122 insertions(+), 12 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index a62c9c0844..a566768750 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1697,4 +1697,59 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/overview.html.eex:178 msgid " Token Transfer" -msgstr "" \ No newline at end of file +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 +msgid " is recommended." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 +msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_token/index.html.eex:8 +msgid "Download all token transfers as csv" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 +msgid "ETH RPC API Documentation" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +msgid "Eth RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:11 +msgid "However, in general, the" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 +msgid "There is no decompilded contracts for this address." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 +msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:10 +msgid "This is useful to allow sending requests to blockscout without having to change anything about the request." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:12 +msgid "custom RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 +msgid "here." +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 5e193fdeeb..f114a87464 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -105,7 +105,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/index.html.eex:4 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:59 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:60 msgid "Addresses" msgstr "" @@ -210,8 +210,8 @@ msgstr "" #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 #: lib/block_scout_web/templates/address/overview.html.eex:144 #: lib/block_scout_web/templates/address/overview.html.eex:152 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:114 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115 msgid "Close" msgstr "" @@ -626,8 +626,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:33 #: lib/block_scout_web/templates/address/overview.html.eex:143 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:35 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:105 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 msgid "QR Code" msgstr "" @@ -684,7 +684,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:34 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:37 msgid "Show QR Code" msgstr "" @@ -834,7 +834,7 @@ msgid "Total Difficulty" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:74 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:75 msgid "Total Supply" msgstr "" @@ -881,7 +881,7 @@ msgid "Transactions sent" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:60 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:61 msgid "Transfers" msgstr "" @@ -943,7 +943,7 @@ msgid "Verify & publish" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:54 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:55 msgid "View Contract" msgstr "" @@ -1048,7 +1048,7 @@ msgid "Self-Destruct" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:62 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:63 msgid "Decimals" msgstr "" @@ -1697,4 +1697,59 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/overview.html.eex:178 msgid " Token Transfer" -msgstr "" \ No newline at end of file +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 +msgid " is recommended." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 +msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_token/index.html.eex:8 +msgid "Download all token transfers as csv" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 +msgid "ETH RPC API Documentation" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +msgid "Eth RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:11 +msgid "However, in general, the" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 +msgid "There is no decompilded contracts for this address." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 +msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:10 +msgid "This is useful to allow sending requests to blockscout without having to change anything about the request." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:12 +msgid "custom RPC" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 +msgid "here." +msgstr "" From 5b8c1f882c288e82fe679a6825694fc5a1869ded Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 25 Jun 2019 16:59:40 +0300 Subject: [PATCH 59/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 62 +++++++++++- .../priv/gettext/en/LC_MESSAGES/default.po | 96 +++++++++++++++---- 2 files changed, 139 insertions(+), 19 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index fec78a8778..95780b61dc 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1692,4 +1692,64 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3 msgid "New Smart Contract Verification" -msgstr "" \ No newline at end of file +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/transaction/overview.html.eex:178 +msgid " Token Transfer" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 +msgid " is recommended." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 +msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_transaction/index.html.eex:74 +msgid "CSV" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 +msgid "ETH RPC API Documentation" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +msgid "Eth RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:11 +msgid "However, in general, the" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 +msgid "There is no decompilded contracts for this address." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 +msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:10 +msgid "This is useful to allow sending requests to blockscout without having to change anything about the request." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:12 +msgid "custom RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 +msgid "here." +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 5b9551710a..96ec21b201 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -105,13 +105,13 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/index.html.eex:4 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:59 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:60 msgid "Addresses" msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:24 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:23 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -210,8 +210,8 @@ msgstr "" #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 #: lib/block_scout_web/templates/address/overview.html.eex:144 #: lib/block_scout_web/templates/address/overview.html.eex:152 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:114 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115 msgid "Close" msgstr "" @@ -245,7 +245,7 @@ msgid "Connection Lost, click to load newer internal transactions" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:12 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:11 #: lib/block_scout_web/templates/pending_transaction/index.html.eex:15 #: lib/block_scout_web/templates/transaction/index.html.eex:15 msgid "Connection Lost, click to load newer transactions" @@ -405,7 +405,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:44 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:41 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:40 #: lib/block_scout_web/views/address_internal_transaction_view.ex:7 #: lib/block_scout_web/views/address_transaction_view.ex:7 msgid "From" @@ -626,8 +626,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:33 #: lib/block_scout_web/templates/address/overview.html.eex:143 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:35 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:105 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 msgid "QR Code" msgstr "" @@ -684,7 +684,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/overview.html.eex:34 -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:37 msgid "Show QR Code" msgstr "" @@ -743,7 +743,7 @@ msgid "There are no tokens." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:63 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:64 msgid "There are no transactions for this address." msgstr "" @@ -764,7 +764,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:33 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:30 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:29 #: lib/block_scout_web/views/address_internal_transaction_view.ex:6 #: lib/block_scout_web/views/address_transaction_view.ex:6 msgid "To" @@ -834,7 +834,7 @@ msgid "Total Difficulty" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:74 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:75 msgid "Total Supply" msgstr "" @@ -866,7 +866,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:3 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:16 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:15 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/chain/show.html.eex:108 @@ -881,7 +881,7 @@ msgid "Transactions sent" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:60 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:61 msgid "Transfers" msgstr "" @@ -943,7 +943,7 @@ msgid "Verify & publish" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:54 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:55 msgid "View Contract" msgstr "" @@ -1048,7 +1048,7 @@ msgid "Self-Destruct" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:62 +#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:63 msgid "Decimals" msgstr "" @@ -1210,7 +1210,7 @@ msgstr "" #: lib/block_scout_web/templates/address_logs/index.html.eex:21 #: lib/block_scout_web/templates/address_token/index.html.eex:13 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:58 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:59 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 #: lib/block_scout_web/templates/block_transaction/index.html.eex:23 #: lib/block_scout_web/templates/chain/show.html.eex:91 @@ -1692,4 +1692,64 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3 msgid "New Smart Contract Verification" -msgstr "" \ No newline at end of file +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/transaction/overview.html.eex:178 +msgid " Token Transfer" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 +msgid " is recommended." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:15 +msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_transaction/index.html.eex:74 +msgid "CSV" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 +msgid "ETH RPC API Documentation" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/layout/_topnav.html.eex:78 +msgid "Eth RPC" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:11 +msgid "However, in general, the" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 +msgid "There is no decompilded contracts for this address." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 +msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:10 +msgid "This is useful to allow sending requests to blockscout without having to change anything about the request." +msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:12 +msgid "custom RPC" +msgstr "" + +#, elixir-format, fuzzy +#: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 +msgid "here." +msgstr "" From c9dca5a319c97e2e9961867e89a1d1e1c01451b4 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Tue, 25 Jun 2019 17:18:25 +0300 Subject: [PATCH 60/81] added styles for 'download csv' button --- .../assets/css/components/_transaction.scss | 36 +++++++++++++++++++ .../templates/address_token/index.html.eex | 15 ++++++-- apps/block_scout_web/priv/gettext/default.pot | 10 +++--- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_transaction.scss b/apps/block_scout_web/assets/css/components/_transaction.scss index 5214b0b301..81bf95b9ee 100644 --- a/apps/block_scout_web/assets/css/components/_transaction.scss +++ b/apps/block_scout_web/assets/css/components/_transaction.scss @@ -4,3 +4,39 @@ line-height: 1.2; margin: 0 0 12px; } + +.transaction-bottom-panel { + display: flex; + flex-direction: column; + @media (min-width: 768px) { + flex-direction: row; + justify-content: space-between; + align-items: flex-end; + } +} + +.download-all-transactions { + text-align: center; + color: #a3a9b5; + font-size: 13px; + margin-top: 10px; + @media (min-width: 768px) { + margin-top: 30px; + } + .download-all-transactions-link { + text-decoration: none; + svg { + position: relative; + margin-left: 2px; + top: -3px; + path { + fill: $primary; + } + } + &:hover { + span { + text-decoration: underline; + } + } + } +} \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex index fa9dc12bd7..ed5ffe2c0d 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex @@ -5,7 +5,6 @@
<%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %>
- to_string(@address.hash)}) %>><%= gettext("Download all token transfers as csv") %>

<%= gettext "Tokens" %>

<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> @@ -21,8 +20,18 @@
- - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + +
+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index f71be7b3dd..77f10d1581 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -732,7 +732,7 @@ msgid "There are no token transfers for this address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_token/index.html.eex:19 +#: lib/block_scout_web/templates/address_token/index.html.eex:18 msgid "There are no tokens for this address." msgstr "" @@ -810,7 +810,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:8 -#: lib/block_scout_web/templates/address_token/index.html.eex:9 +#: lib/block_scout_web/templates/address_token/index.html.eex:8 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9 #: lib/block_scout_web/views/address_view.ex:304 msgid "Tokens" @@ -1207,7 +1207,7 @@ msgstr "" #: lib/block_scout_web/templates/address_coin_balance/index.html.eex:34 #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:61 #: lib/block_scout_web/templates/address_logs/index.html.eex:21 -#: lib/block_scout_web/templates/address_token/index.html.eex:14 +#: lib/block_scout_web/templates/address_token/index.html.eex:13 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:20 #: lib/block_scout_web/templates/address_transaction/index.html.eex:57 #: lib/block_scout_web/templates/address_validation/index.html.eex:22 @@ -1699,6 +1699,6 @@ msgid " Token Transfer" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_token/index.html.eex:8 -msgid "Download all token transfers as csv" +#: lib/block_scout_web/templates/address_token/index.html.eex:27 +msgid "CSV" msgstr "" From 89260ab9f3c4ce178df2631640c6fa0cc6ceb618 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Tue, 25 Jun 2019 17:20:28 +0300 Subject: [PATCH 61/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf08d79d76..7f6a2ebb65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#2075](https://github.com/poanetwork/blockscout/pull/2075) - add blocks cache ### Fixes +- [#2242](https://github.com/poanetwork/blockscout/pull/2242) - added styles for 'download csv' button - [#2142](https://github.com/poanetwork/blockscout/pull/2142) - Removed posdao theme and logo, added 'page not found' image for goerli - [#2138](https://github.com/poanetwork/blockscout/pull/2138) - badge colors issue, api titles issue - [#2129](https://github.com/poanetwork/blockscout/pull/2129) - Fix for width of explorer elements From 073c52f8295ba4b660a6e49e56028358e019f54c Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Wed, 26 Jun 2019 10:32:48 +0300 Subject: [PATCH 62/81] gettext fix --- .../lib/block_scout_web/templates/address_token/index.html.eex | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex index ed5ffe2c0d..4e78daee2f 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex @@ -32,6 +32,7 @@
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + From 3b06941b60396225783089764ff7f9bc3ee06e48 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Wed, 26 Jun 2019 10:46:10 +0300 Subject: [PATCH 63/81] new pot generated --- .../templates/address_token/index.html.eex | 5 ++--- apps/block_scout_web/priv/gettext/default.pot | 12 +++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex index 4e78daee2f..4b180fa761 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex @@ -23,8 +23,7 @@ - + diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 2821aa97b4..a0c6482690 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1700,8 +1700,6 @@ msgid " Token Transfer" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_token/index.html.eex:27 -msgid "CSV" #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:14 msgid " is recommended." msgstr "" @@ -1711,11 +1709,6 @@ msgstr "" msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_token/index.html.eex:8 -msgid "Download all token transfers as csv" -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 msgid "ETH RPC API Documentation" @@ -1755,3 +1748,8 @@ msgstr "" #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 msgid "here." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_token/index.html.eex:26 +msgid "CSV" +msgstr "" From 623be25cc208cd88924e6ca2c16e95877f29d989 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Wed, 26 Jun 2019 18:27:50 +0300 Subject: [PATCH 64/81] search length issue, tile link wrapping issue --- .../assets/css/components/_navbar.scss | 12 +++--------- .../templates/address/_responsive_hash.html.eex | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index 1058c529c6..b8855a63ae 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -151,19 +151,13 @@ $navbar-logo-width: auto !default; } @include media-breakpoint-up(xl) { - width: 280px; + width: 340px; } @media (min-width: 1366px) { - width: 330px; + width: 500px; } @media (min-width: 1440px) { - width: 380px; - } - @media (min-width: 1580px) { - width: 430px; - } - @media (min-width: 1800px) { - width: 520px; + width: 580px; } } .input-group-append { diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_responsive_hash.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_responsive_hash.html.eex index 22e0f76870..cad11f8ee6 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_responsive_hash.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_responsive_hash.html.eex @@ -5,8 +5,8 @@ <%= if assigns[:truncate] do %> <%= BlockScoutWeb.AddressView.trimmed_hash(@address.hash) %> <% else %> - <%= @address %> - <%= BlockScoutWeb.AddressView.trimmed_hash(@address.hash) %> + <%= @address %> + <%= BlockScoutWeb.AddressView.trimmed_hash(@address.hash) %> <% end %> <% end %> From baae13933d7913ab310b462bce7eb6f944042376 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Wed, 26 Jun 2019 18:31:01 +0300 Subject: [PATCH 65/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bba5170e0b..a578eab389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - [#2193](https://github.com/poanetwork/blockscout/pull/2193) - feat: add BLOCKSCOUT_HOST, and use it in API docs ### Fixes +- [#2254](https://github.com/poanetwork/blockscout/pull/2254) - search length issue, tile link wrapping issue - [#2238](https://github.com/poanetwork/blockscout/pull/2238) - header content alignment issue, hide navbar on outside click - [#2229](https://github.com/poanetwork/blockscout/pull/2229) - gap issue between qr and copy button in token transfers, top cards width and height issue - [#2201](https://github.com/poanetwork/blockscout/pull/2201) - footer columns fix From 5edc046dfccda270351806bc7cc4430480d4f14d Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 27 Jun 2019 10:10:12 +0300 Subject: [PATCH 66/81] use the latest version of chromedriver --- bin/install_chrome_headless.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_chrome_headless.sh b/bin/install_chrome_headless.sh index d27bb6f9d8..9721e84ea3 100755 --- a/bin/install_chrome_headless.sh +++ b/bin/install_chrome_headless.sh @@ -1,6 +1,6 @@ export DISPLAY=:99.0 sh -e /etc/init.d/xvfb start -export CHROMEDRIVER_VERSION=74.0.3729.6 +export CHROMEDRIVER_VERSION=`curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE` curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" unzip chromedriver_linux64.zip sudo chmod +x chromedriver From b9c10aaa7aae493bd52bd8fe30b30706cbb10808 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 27 Jun 2019 10:21:43 +0300 Subject: [PATCH 67/81] use the latest version of chromedriver --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a578eab389..20fe7af997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ ### Chore - [#2127](https://github.com/poanetwork/blockscout/pull/2127) - use previouse chromedriver version - [#2118](https://github.com/poanetwork/blockscout/pull/2118) - show only the last decompiled contract +- [#2256](https://github.com/poanetwork/blockscout/pull/2256) - use the latest version of chromedriver ### Chore From 9e1b6b3752ff0bcaf6cf86be6356caba8ead2356 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 27 Jun 2019 10:46:22 +0300 Subject: [PATCH 68/81] 'download csv' button added to different tabs --- .../address_internal_transaction/index.html.eex | 13 +++++++++++-- .../templates/address_transaction/index.html.eex | 13 +++++++++++-- .../templates/tokens/transfer/index.html.eex | 13 +++++++++++-- apps/block_scout_web/priv/gettext/default.pot | 3 +++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex index 3bc2e7fe9b..b3d92333a7 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex @@ -67,8 +67,17 @@
- - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + +
+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index 11b4de110c..0dff8dbb20 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -64,8 +64,17 @@
- - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + +
+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex index 980cc4b05a..8e12926fb9 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex @@ -27,8 +27,17 @@
- - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + +
+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> +
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index a0c6482690..1ce79f9565 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1750,6 +1750,9 @@ msgid "here." msgstr "" #, elixir-format +#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:73 #: lib/block_scout_web/templates/address_token/index.html.eex:26 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:70 +#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:33 msgid "CSV" msgstr "" From 9f82ea43f53a7f1b8ffc79149a2446667ea64811 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Thu, 27 Jun 2019 10:49:33 +0300 Subject: [PATCH 69/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c65d4c942..fdb24d1081 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [#2146](https://github.com/poanetwork/blockscout/pull/2146) - feat: add eth_getLogs rpc endpoint ### Fixes +- [#2257](https://github.com/poanetwork/blockscout/pull/2257) - 'download csv' button added to different tabs - [#2242](https://github.com/poanetwork/blockscout/pull/2242) - added styles for 'download csv' button - [#2238](https://github.com/poanetwork/blockscout/pull/2238) - header content alignment issue, hide navbar on outside click - [#2229](https://github.com/poanetwork/blockscout/pull/2229) - gap issue between qr and copy button in token transfers, top cards width and height issue From 830c30ae6afb20f3f7ba4225cb9a2afa152833a0 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 27 Jun 2019 14:45:24 +0300 Subject: [PATCH 70/81] hide csv button if there are no transactions --- apps/block_scout_web/assets/js/lib/async_listing_load.js | 8 ++++++++ .../templates/address_transaction/index.html.eex | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/async_listing_load.js b/apps/block_scout_web/assets/js/lib/async_listing_load.js index 3a3eb2fd6c..8610d901f6 100644 --- a/apps/block_scout_web/assets/js/lib/async_listing_load.js +++ b/apps/block_scout_web/assets/js/lib/async_listing_load.js @@ -219,6 +219,14 @@ export const elements = { $el.hide() } + }, + '[csv-download]': { + render ($el, state) { + if (state.emptyResponse) { + return $el.hide() + } + return $el.show() + } } } diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index a24df921c6..3750c772cd 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -50,8 +50,8 @@ - - + + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> @@ -66,9 +66,9 @@
- +
-
+
Download  to_string(@address.hash)}) %>> <%= gettext("CSV") %> From 3a7f4974d503dcfc23b786ef1fda501f933e0361 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 27 Jun 2019 14:53:42 +0300 Subject: [PATCH 71/81] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 16 ++++++++++++++- .../priv/gettext/en/LC_MESSAGES/default.po | 20 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index bf9db8c12b..6aec2d5849 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1699,7 +1699,6 @@ msgstr "" msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 msgid "ETH RPC API Documentation" @@ -1739,3 +1738,18 @@ msgstr "" #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 msgid "here." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_transaction/index.html.eex:74 +msgid "CSV" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:44 +msgid "ERC-20 " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:45 +msgid "ERC-721 " +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index d3d4e833d6..27af6d233c 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -1684,7 +1684,7 @@ msgstr "" msgid "New Smart Contract Verification" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/transaction/overview.html.eex:178 msgid " Token Transfer" msgstr "" @@ -1699,6 +1699,7 @@ msgstr "" msgid "Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences." msgstr "" +#, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:4 msgid "ETH RPC API Documentation" msgstr "" @@ -1713,7 +1714,7 @@ msgstr "" msgid "However, in general, the" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 msgid "There is no decompilded contracts for this address." msgstr "" @@ -1737,3 +1738,18 @@ msgstr "" #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:9 msgid "here." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/address_transaction/index.html.eex:74 +msgid "CSV" +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:44 +msgid "ERC-20 " +msgstr "" + +#, elixir-format +#: lib/block_scout_web/views/transaction_view.ex:45 +msgid "ERC-721 " +msgstr "" From eb544a3c0a80f000696aa8be7e2be486418269f7 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 27 Jun 2019 14:54:07 +0300 Subject: [PATCH 72/81] header logo aligned to the center properly --- apps/block_scout_web/assets/css/components/_navbar.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index b8855a63ae..48c6c50f02 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -217,6 +217,7 @@ $navbar-logo-width: auto !default; .navbar-brand { margin-left: 0; flex-shrink: 1; + display: inline-flex; .navbar-logo { max-width: 100%; } From 29471090d240ab1902acf61d18177c8ee2af80aa Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Thu, 27 Jun 2019 14:56:09 +0300 Subject: [PATCH 73/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db258a24ee..1e131d5af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - [#2193](https://github.com/poanetwork/blockscout/pull/2193) - feat: add BLOCKSCOUT_HOST, and use it in API docs ### Fixes +- [#2261](https://github.com/poanetwork/blockscout/pull/2261) - header logo aligned to the center properly - [#2254](https://github.com/poanetwork/blockscout/pull/2254) - search length issue, tile link wrapping issue - [#2238](https://github.com/poanetwork/blockscout/pull/2238) - header content alignment issue, hide navbar on outside click - [#2229](https://github.com/poanetwork/blockscout/pull/2229) - gap issue between qr and copy button in token transfers, top cards width and height issue From ffd966dd76219e239e978ba1d8fae1170daec1fa Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 27 Jun 2019 14:57:02 +0300 Subject: [PATCH 74/81] hide csv button --- apps/block_scout_web/assets/js/lib/async_listing_load.js | 8 ++++++++ .../templates/address_token/index.html.eex | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/async_listing_load.js b/apps/block_scout_web/assets/js/lib/async_listing_load.js index 3a3eb2fd6c..8610d901f6 100644 --- a/apps/block_scout_web/assets/js/lib/async_listing_load.js +++ b/apps/block_scout_web/assets/js/lib/async_listing_load.js @@ -219,6 +219,14 @@ export const elements = { $el.hide() } + }, + '[csv-download]': { + render ($el, state) { + if (state.emptyResponse) { + return $el.hide() + } + return $el.show() + } } } diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex index 4b180fa761..840d9cc1da 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token/index.html.eex @@ -20,9 +20,9 @@
- +
-
+
Download to_string(@address.hash)}) %>><%= gettext("CSV") %> From 76657e8dab35357e5fe8ee671126f6615219c9b5 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 27 Jun 2019 15:23:49 +0300 Subject: [PATCH 75/81] added an ability to close network selector on outside click --- .../assets/css/components/_network-selector.scss | 9 +++++++++ .../assets/js/lib/network_selector.js | 6 ++++++ .../templates/layout/_network_selector.html.eex | 1 + apps/block_scout_web/priv/gettext/default.pot | 14 +++++++------- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_network-selector.scss b/apps/block_scout_web/assets/css/components/_network-selector.scss index 3086639050..ad0864bf61 100644 --- a/apps/block_scout_web/assets/css/components/_network-selector.scss +++ b/apps/block_scout_web/assets/css/components/_network-selector.scss @@ -26,6 +26,14 @@ $network-selector-item-icon-dimensions: 30px !default; z-index: 123; } +.network-selector-overlay-close { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + .network-selector-wrapper { display: flex; height: 100%; @@ -44,6 +52,7 @@ $network-selector-item-icon-dimensions: 30px !default; padding-top: 28px; position: relative; transition: right 0.25s ease-out; + z-index: 2; } .network-selector-close { diff --git a/apps/block_scout_web/assets/js/lib/network_selector.js b/apps/block_scout_web/assets/js/lib/network_selector.js index f7765329a0..20c8e3d206 100644 --- a/apps/block_scout_web/assets/js/lib/network_selector.js +++ b/apps/block_scout_web/assets/js/lib/network_selector.js @@ -4,6 +4,7 @@ $(function () { const mainBody = $('body') const showNetworkSelector = $('.js-show-network-selector') const hideNetworkSelector = $('.js-network-selector-close') + const hideNetworkSelectorOverlay = $('.js-network-selector-overlay-close') const networkSelector = $('.js-network-selector') const networkSelectorOverlay = $('.js-network-selector-overlay') const networkSelectorTab = $('.js-network-selector-tab') @@ -21,6 +22,11 @@ $(function () { closeNetworkSelector() }) + hideNetworkSelectorOverlay.on('click', (e) => { + e.preventDefault() + closeNetworkSelector() + }) + networkSelectorTab.on('click', function (e) { e.preventDefault() setNetworkTab($(this)) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex index 41f990b589..4744d7d371 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex @@ -1,4 +1,5 @@
+
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 1cf4275fcf..21dc7d4afc 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -112,7 +112,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27 #: lib/block_scout_web/templates/address_transaction/index.html.eex:23 -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:20 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 #: lib/block_scout_web/views/address_internal_transaction_view.ex:8 #: lib/block_scout_web/views/address_transaction_view.ex:8 msgid "All" @@ -1751,31 +1751,31 @@ msgid "here." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:10 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 msgid "Change Network" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:24 msgid "Favorites" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:11 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:12 msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:21 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 msgid "Mainnet" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:17 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:18 msgid "Search network" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_network_selector.html.eex:22 +#: lib/block_scout_web/templates/layout/_network_selector.html.eex:23 msgid "Testnet" msgstr "" From 5c085b27e53757c120c29e09da93ab24d9897cea Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Thu, 27 Jun 2019 15:25:27 +0300 Subject: [PATCH 76/81] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7444ad265a..ac5dd3a500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#2146](https://github.com/poanetwork/blockscout/pull/2146) - feat: add eth_getLogs rpc endpoint ### Fixes +- [#2263](https://github.com/poanetwork/blockscout/pull/2263) - added an ability to close network selector on outside click - [#2201](https://github.com/poanetwork/blockscout/pull/2201) - footer columns fix - [#2179](https://github.com/poanetwork/blockscout/pull/2179) - fix docker build error - [#2165](https://github.com/poanetwork/blockscout/pull/2165) - sort blocks by timestamp when calculating average block time From da348dfc73ced9869b50f84143a292ace3ee2c69 Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Thu, 27 Jun 2019 15:30:27 +0300 Subject: [PATCH 77/81] commented 'download csv' button where is no logic --- .../templates/address_internal_transaction/index.html.eex | 6 +++--- .../templates/tokens/transfer/index.html.eex | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex index b3d92333a7..2b4fd18674 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex @@ -68,16 +68,16 @@
-
+ <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> -
+
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex index 8e12926fb9..66038da607 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/tokens/transfer/index.html.eex @@ -28,16 +28,16 @@
-
+ <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> -
+
From 8df146b4e621d999b308f0206287b0eb807d7d82 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 27 Jun 2019 17:34:50 +0300 Subject: [PATCH 78/81] Remove duplicate record from internalization files --- apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 0cc1ee30e2..ee5b704cba 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -1719,11 +1719,6 @@ msgstr "" msgid "There is no decompilded contracts for this address." msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:27 -msgid "There is no decompilded contracts for this address." -msgstr "" - #, elixir-format #: lib/block_scout_web/templates/api_docs/eth_rpc.html.eex:7 msgid "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " From de58a6f7e70a8f36b0c7cc7ab1281945d3d1a197 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 27 Jun 2019 17:45:20 +0300 Subject: [PATCH 79/81] Fix gettext and format tests --- apps/block_scout_web/priv/gettext/default.pot | 7 +------ .../controllers/address_transaction_controller_test.exs | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 700328ec74..660be028e5 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1742,16 +1742,11 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:73 #: lib/block_scout_web/templates/address_token/index.html.eex:26 -#: lib/block_scout_web/templates/address_transaction/index.html.eex:70 +#: lib/block_scout_web/templates/address_transaction/index.html.eex:72 #: lib/block_scout_web/templates/tokens/transfer/index.html.eex:33 msgid "CSV" msgstr "" -#, elixir-format -#: lib/block_scout_web/templates/address_transaction/index.html.eex:74 -msgid "CSV" -msgstr "" - #, elixir-format #: lib/block_scout_web/views/transaction_view.ex:44 msgid "ERC-20 " diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs index 5469ab6cc7..a29d6b9be6 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs @@ -147,6 +147,10 @@ defmodule BlockScoutWeb.AddressTransactionControllerTest do conn = get(conn, "/token_transfers_csv", %{"address_id" => to_string(address.hash)}) + assert conn.resp_body |> String.split("\n") |> Enum.count() == 4 + end + end + describe "GET transactions_csv/2" do test "download csv file with transactions", %{conn: conn} do address = insert(:address) From 9a301038cb848d2b890e93027106b9efb140d754 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 27 Jun 2019 17:51:33 +0300 Subject: [PATCH 80/81] credo test fix --- .../controllers/address_transaction_controller.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex index 8d144199c6..51503fd7c1 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex @@ -10,8 +10,7 @@ defmodule BlockScoutWeb.AddressTransactionController do alias BlockScoutWeb.TransactionView alias Explorer.{Chain, Market} - alias Explorer.Chain.AddressTokenTransferCsvExporter - alias Explorer.Chain.AddressTransactionCsvExporter + alias Explorer.Chain.{AddressTokenTransferCsvExporter, AddressTransactionCsvExporter} alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View From 0f1d8e1c51d0dbda2503bc61ac4c979423f518d3 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 27 Jun 2019 18:48:31 +0300 Subject: [PATCH 81/81] dropdown_main_nets and dropdown_test_nets to show only chains, that are not marked to hide in dropdown --- .../templates/layout/_network_selector.html.eex | 4 ++-- .../lib/block_scout_web/views/layout_view.ex | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex index 4744d7d371..1e31d205e1 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_network_selector.html.eex @@ -24,8 +24,8 @@
<%= gettext("Favorites") %>
- <% main_nets = main_nets(other_networks()) %> - <% test_nets = test_nets(other_networks()) %> + <% main_nets = dropdown_main_nets() %> + <% test_nets = dropdown_test_nets() %>
<%= for %{url: url, title: title} <- main_nets do %> <%= render BlockScoutWeb.LayoutView, "_network_selector_item.html", title: title, url: url, tab_type: "Mainnet" %> diff --git a/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex b/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex index 12df6d3f0a..b33b1dd4c2 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex @@ -198,6 +198,16 @@ defmodule BlockScoutWeb.LayoutView do |> Enum.reject(&Map.get(&1, :hide_in_dropdown?)) end + def dropdown_main_nets do + dropdown_nets() + |> main_nets() + end + + def dropdown_test_nets do + dropdown_nets() + |> test_nets() + end + def dropdown_head_main_nets do dropdown_nets() |> main_nets()