From ef7129b19732eab3b4e79ccfdff502b39e4fca89 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 1 Dec 2024 03:06:06 -0300 Subject: [PATCH 1/7] fix coins for faucet --- go.mod | 18 +++++++----- go.sum | 39 ++++++++++++------------- ignite/cmd/chain_debug.go | 2 +- ignite/cmd/chain_serve.go | 2 +- ignite/cmd/testnet_multi_node.go | 2 +- ignite/pkg/chaincmd/chaincmd.go | 6 ++-- ignite/pkg/chaincmd/runner/chain.go | 2 +- ignite/pkg/cosmosfaucet/cosmosfaucet.go | 2 +- ignite/pkg/cosmosfaucet/http_faucet.go | 8 ++--- ignite/pkg/cosmosfaucet/transfer.go | 3 +- 10 files changed, 43 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index d25299fb90..1277fc566c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ignite/cli/v29 -go 1.23.1 +go 1.23.3 // Cosmos SDK v0.52 integration replace ( @@ -38,9 +38,9 @@ require ( github.com/buger/jsonparser v1.1.1 github.com/cenkalti/backoff v2.2.1+incompatible github.com/charmbracelet/bubbles v0.7.6 - github.com/charmbracelet/bubbletea v0.23.2 + github.com/charmbracelet/bubbletea v1.2.4 github.com/charmbracelet/glow v1.4.1 - github.com/charmbracelet/lipgloss v0.6.0 + github.com/charmbracelet/lipgloss v1.0.0 github.com/cockroachdb/errors v1.11.3 github.com/cometbft/cometbft v1.0.0-rc1.0.20240908111210-ab0be101882f github.com/cometbft/cometbft/api v1.0.0-rc.1 @@ -87,7 +87,7 @@ require ( github.com/vektra/mockery/v2 v2.46.0 go.etcd.io/bbolt v1.4.0-alpha.1 golang.org/x/mod v0.21.0 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.9.0 golang.org/x/term v0.25.0 golang.org/x/text v0.19.0 golang.org/x/tools v0.25.0 @@ -171,6 +171,8 @@ require ( github.com/charithe/durationcheck v0.0.10 // indirect github.com/charmbracelet/charm v0.8.6 // indirect github.com/charmbracelet/glamour v0.2.1-0.20210402234443-abe9cda419ba // indirect + github.com/charmbracelet/x/ansi v0.4.5 // indirect + github.com/charmbracelet/x/term v0.2.1 // indirect github.com/chavacava/garif v0.1.0 // indirect github.com/chigopher/pathlib v0.19.1 // indirect github.com/chzyer/readline v1.5.1 // indirect @@ -183,7 +185,6 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v1.0.1 // indirect - github.com/containerd/console v1.0.4-0.20230508195404-8d3c090fd31c // indirect github.com/containerd/containerd v1.7.11 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect @@ -220,6 +221,7 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fatih/structs v1.1.0 // indirect @@ -361,7 +363,7 @@ require ( github.com/moricho/tparallel v0.3.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/gitcha v0.2.0 // indirect github.com/muesli/go-app-paths v0.2.1 // indirect @@ -397,7 +399,7 @@ require ( github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rs/zerolog v1.33.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryancurrah/gomodguard v1.3.3 // indirect @@ -477,7 +479,7 @@ require ( golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.27.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect diff --git a/go.sum b/go.sum index 82dd69ecbe..187ebbd5d2 100644 --- a/go.sum +++ b/go.sum @@ -154,7 +154,6 @@ github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5Fc github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY= github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aymanbagabas/go-osc52 v1.2.1/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= @@ -227,16 +226,20 @@ github.com/charmbracelet/bubbles v0.7.6 h1:SCAp4ZEUf2tBNEsufo+Xxxu2dvbFhYSDPrX45 github.com/charmbracelet/bubbles v0.7.6/go.mod h1:0D4XRYK0tjo8JMvflz1obpVcOikNZSG46SFauoZj22s= github.com/charmbracelet/bubbletea v0.12.2/go.mod h1:3gZkYELUOiEUOp0bTInkxguucy/xRbGSOcbMs1geLxg= github.com/charmbracelet/bubbletea v0.13.2/go.mod h1:okqaA5VF0aSpEZ2HB+L/cxVw2HthIDZ1dmWoRZs8/4g= -github.com/charmbracelet/bubbletea v0.23.2 h1:vuUJ9HJ7b/COy4I30e8xDVQ+VRDUEFykIjryPfgsdps= -github.com/charmbracelet/bubbletea v0.23.2/go.mod h1:FaP3WUivcTM0xOKNmhciz60M6I+weYLF76mr1JyI7sM= +github.com/charmbracelet/bubbletea v1.2.4 h1:KN8aCViA0eps9SCOThb2/XPIlea3ANJLUkv3KnQRNCE= +github.com/charmbracelet/bubbletea v1.2.4/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM= github.com/charmbracelet/charm v0.8.6 h1:/U6rxGj4J6zZ1Ex8+wTr4hNMr4ESBzNZbC1UyrJPVbg= github.com/charmbracelet/charm v0.8.6/go.mod h1:8dE3uX+TYSpa7Q6e/CmjN6WSd7koSAKNQTGWugFREx4= github.com/charmbracelet/glamour v0.2.1-0.20210402234443-abe9cda419ba h1:smKYYwwVPZyMK2LCirIi2WY25tZZW0IU7GYe1ASGCe4= github.com/charmbracelet/glamour v0.2.1-0.20210402234443-abe9cda419ba/go.mod h1:nHP5wEbsv2eOJ7XfiScQV3p5dpZSM051R0VkxnOIPgg= github.com/charmbracelet/glow v1.4.1 h1:mzspku+pWaYALabhJlExsSj7PORGfLjjprJCLI6IuUA= github.com/charmbracelet/glow v1.4.1/go.mod h1:zRTFgmRlLe+nkqyCKB+b8GZhycm0F7JuwdFmfeeJgqg= -github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= -github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= +github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= +github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= +github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM= +github.com/charmbracelet/x/ansi v0.4.5/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= +github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A= @@ -293,9 +296,6 @@ github.com/cometbft/cometbft-db v1.0.1/go.mod h1:EBrFs1GDRiTqrWXYi4v90Awf/gcdD5E github.com/cometbft/cometbft/api v1.0.0-rc.1 h1:GtdXwDGlqwHYs16A4egjwylfYOMYyEacLBrs3Zvpt7g= github.com/cometbft/cometbft/api v1.0.0-rc.1/go.mod h1:NDFKiBBD8HJC6QQLAoUI99YhsiRZtg2+FJWfk6A6m6o= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/console v1.0.4-0.20230508195404-8d3c090fd31c h1:sgmd9/Gm5SFfxHSVVD7HAaEQlaUJKdJ2VlQM8SwUxvs= -github.com/containerd/console v1.0.4-0.20230508195404-8d3c090fd31c/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -414,6 +414,8 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -908,7 +910,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= @@ -920,7 +921,6 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -974,8 +974,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34= -github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/gitcha v0.2.0 h1:+wOgT2dI9s2Tznj1t1rb/qkK5e0cb6qD8c4IX2TR/YY= @@ -992,8 +992,6 @@ github.com/muesli/sasquatch v0.0.0-20200811221207-66979d92330a/go.mod h1:+XG0ne5 github.com/muesli/termenv v0.7.2/go.mod h1:ct2L5N2lmix82RaY3bMWwVu/jUFc9Ule0KGDCiKYPh8= github.com/muesli/termenv v0.7.4/go.mod h1:pZ7qY9l3F7e5xsAOS0zCew2tME+p7bWeBkotCEcIIcc= github.com/muesli/termenv v0.8.1/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0= -github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/muesli/termenv v0.14.0/go.mod h1:kG/pF1E7fh949Xhe156crRUrHNyK221IuGO7Ez60Uc8= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= @@ -1119,8 +1117,9 @@ github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1489,8 +1488,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1534,6 +1533,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1542,7 +1542,6 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1559,8 +1558,8 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/ignite/cmd/chain_debug.go b/ignite/cmd/chain_debug.go index 773622a52c..6556be312a 100644 --- a/ignite/cmd/chain_debug.go +++ b/ignite/cmd/chain_debug.go @@ -79,7 +79,7 @@ func chainDebugHandler(cmd *cobra.Command, _ []string) error { if server { bus := session.EventBus() m := cmdmodel.NewChainDebug(cmd, bus, chainDebugCmd(cmd, session)) - _, err := tea.NewProgram(m).Run() + _, err := tea.NewProgram(m, tea.WithInput(cmd.InOrStdin())).Run() return err } diff --git a/ignite/cmd/chain_serve.go b/ignite/cmd/chain_serve.go index c95735cc9e..bf23a6575c 100644 --- a/ignite/cmd/chain_serve.go +++ b/ignite/cmd/chain_serve.go @@ -106,7 +106,7 @@ func chainServeHandler(cmd *cobra.Command, _ []string) error { // Render UI m := cmdmodel.NewChainServe(cmd, bus, chainServeCmd(cmd, session)) - _, err := tea.NewProgram(m).Run() + _, err := tea.NewProgram(m, tea.WithInput(cmd.InOrStdin())).Run() return err } diff --git a/ignite/cmd/testnet_multi_node.go b/ignite/cmd/testnet_multi_node.go index 0f0ef96c51..9de7d013f3 100644 --- a/ignite/cmd/testnet_multi_node.go +++ b/ignite/cmd/testnet_multi_node.go @@ -146,7 +146,7 @@ func testnetMultiNode(cmd *cobra.Command, session *cliui.Session) error { return err } - _, err = tea.NewProgram(model).Run() + _, err = tea.NewProgram(model, tea.WithInput(cmd.InOrStdin())).Run() return err } diff --git a/ignite/pkg/chaincmd/chaincmd.go b/ignite/pkg/chaincmd/chaincmd.go index 21f1682707..5f7869d37b 100644 --- a/ignite/pkg/chaincmd/chaincmd.go +++ b/ignite/pkg/chaincmd/chaincmd.go @@ -518,7 +518,7 @@ func BankSendWithFees(fee sdk.Coin) BankSendOption { } // BankSendCommand returns the command for transferring tokens. -func (c ChainCmd) BankSendCommand(fromAddress, toAddress, amount string, options ...BankSendOption) step.Option { +func (c ChainCmd) BankSendCommand(fromAddress, toAddress string, amount []string, options ...BankSendOption) step.Option { command := []string{ commandTx, } @@ -528,7 +528,9 @@ func (c ChainCmd) BankSendCommand(fromAddress, toAddress, amount string, options "send", fromAddress, toAddress, - amount, + ) + command = append(command, amount...) + command = append(command, optionBroadcastMode, flags.BroadcastSync, optionYes, ) diff --git a/ignite/pkg/chaincmd/runner/chain.go b/ignite/pkg/chaincmd/runner/chain.go index 6d08564ec3..f53461e34e 100644 --- a/ignite/pkg/chaincmd/runner/chain.go +++ b/ignite/pkg/chaincmd/runner/chain.go @@ -167,7 +167,7 @@ func (r Runner) Status(ctx context.Context) (NodeStatus, error) { } // BankSend sends amount from fromAccount to toAccount. -func (r Runner) BankSend(ctx context.Context, fromAccount, toAccount, amount string, options ...chaincmd.BankSendOption) (string, error) { +func (r Runner) BankSend(ctx context.Context, fromAccount, toAccount string, amount []string, options ...chaincmd.BankSendOption) (string, error) { b := newBuffer() opt := []step.Option{ r.chainCmd.BankSendCommand(fromAccount, toAccount, amount, options...), diff --git a/ignite/pkg/cosmosfaucet/cosmosfaucet.go b/ignite/pkg/cosmosfaucet/cosmosfaucet.go index 6b914bce54..0b70816fa8 100644 --- a/ignite/pkg/cosmosfaucet/cosmosfaucet.go +++ b/ignite/pkg/cosmosfaucet/cosmosfaucet.go @@ -6,7 +6,6 @@ import ( "time" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" @@ -155,6 +154,7 @@ func New(ctx context.Context, ccr chaincmdrunner.Runner, options ...Option) (Fau if len(f.coins) == 0 { Coin(sdkmath.NewInt(DefaultAmount), sdkmath.NewInt(DefaultMaxAmount), DefaultDenom)(&f) } + f.coins = f.coins.Sort() if f.limitRefreshWindow == 0 { RefreshWindow(DefaultRefreshWindow)(&f) diff --git a/ignite/pkg/cosmosfaucet/http_faucet.go b/ignite/pkg/cosmosfaucet/http_faucet.go index 5ae74c0f86..004437dd8a 100644 --- a/ignite/pkg/cosmosfaucet/http_faucet.go +++ b/ignite/pkg/cosmosfaucet/http_faucet.go @@ -17,7 +17,7 @@ type TransferRequest struct { // Coins that are requested. // default ones used when this one isn't provided. - Coins []string `json:"coins"` + Coins []string `json:"coins,omitempty"` } func NewTransferRequest(accountAddress string, coins []string) TransferRequest { @@ -78,16 +78,16 @@ func (f Faucet) faucetInfoHandler(w http.ResponseWriter, _ *http.Request) { // coinsFromRequest determines tokens to transfer from transfer request. func (f Faucet) coinsFromRequest(req TransferRequest) (sdk.Coins, error) { if len(req.Coins) == 0 { - return f.coins, nil + return f.coins.Sort(), nil } - var coins []sdk.Coin + coins := sdk.NewCoins() for _, c := range req.Coins { coin, err := sdk.ParseCoinNormalized(c) if err != nil { return nil, err } - coins = append(coins, coin) + coins = coins.Add(coin) } return coins, nil diff --git a/ignite/pkg/cosmosfaucet/transfer.go b/ignite/pkg/cosmosfaucet/transfer.go index 57536c787e..ac9d0c4eb6 100644 --- a/ignite/pkg/cosmosfaucet/transfer.go +++ b/ignite/pkg/cosmosfaucet/transfer.go @@ -2,7 +2,6 @@ package cosmosfaucet import ( "context" - "strings" "sync" "time" @@ -106,7 +105,7 @@ func (f *Faucet) Transfer(ctx context.Context, toAccountAddress string, coins sd if err != nil { return err } - txHash, err := f.runner.BankSend(ctx, fromAccount.Address, toAccountAddress, strings.Join(coinsStr, ","), chaincmd.BankSendWithFees(f.feeAmount)) + txHash, err := f.runner.BankSend(ctx, fromAccount.Address, toAccountAddress, coinsStr, chaincmd.BankSendWithFees(f.feeAmount)) if err != nil { return err } From e8ded4fe6fa89b75ffb272aaa1bb3e3a9262ad9e Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 1 Dec 2024 03:25:19 -0300 Subject: [PATCH 2/7] fix unit tests for faucet --- ignite/internal/plugin/testdata/execute_fail/go.mod | 11 ++++++----- ignite/internal/plugin/testdata/execute_ok/go.mod | 11 ++++++----- ignite/pkg/cliui/view/accountview/account_test.go | 4 ++-- ignite/pkg/cosmosfaucet/cosmosfaucet.go | 1 + 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ignite/internal/plugin/testdata/execute_fail/go.mod b/ignite/internal/plugin/testdata/execute_fail/go.mod index b34c9e73e7..eff3951e15 100644 --- a/ignite/internal/plugin/testdata/execute_fail/go.mod +++ b/ignite/internal/plugin/testdata/execute_fail/go.mod @@ -1,6 +1,6 @@ module execute_fail -go 1.23.1 +go 1.23.3 replace ( github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.2 @@ -19,7 +19,8 @@ require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/charmbracelet/lipgloss v0.6.0 // indirect + github.com/charmbracelet/lipgloss v1.0.0 // indirect + github.com/charmbracelet/x/ansi v0.4.5 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -72,7 +73,7 @@ require ( github.com/otiai10/copy v1.14.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect @@ -86,8 +87,8 @@ require ( golang.org/x/crypto v0.28.0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/tools v0.25.0 // indirect diff --git a/ignite/internal/plugin/testdata/execute_ok/go.mod b/ignite/internal/plugin/testdata/execute_ok/go.mod index 052c14ee1b..533815e834 100644 --- a/ignite/internal/plugin/testdata/execute_ok/go.mod +++ b/ignite/internal/plugin/testdata/execute_ok/go.mod @@ -1,6 +1,6 @@ module execute_ok -go 1.23.1 +go 1.23.3 replace ( github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-beta.2 @@ -19,7 +19,8 @@ require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/charmbracelet/lipgloss v0.6.0 // indirect + github.com/charmbracelet/lipgloss v1.0.0 // indirect + github.com/charmbracelet/x/ansi v0.4.5 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/cockroachdb/errors v1.11.3 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -72,7 +73,7 @@ require ( github.com/otiai10/copy v1.14.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect @@ -86,8 +87,8 @@ require ( golang.org/x/crypto v0.28.0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/tools v0.25.0 // indirect diff --git a/ignite/pkg/cliui/view/accountview/account_test.go b/ignite/pkg/cliui/view/accountview/account_test.go index 4eb383f843..c30a777481 100644 --- a/ignite/pkg/cliui/view/accountview/account_test.go +++ b/ignite/pkg/cliui/view/accountview/account_test.go @@ -17,12 +17,12 @@ func TestAccountString(t *testing.T) { { name: "new account (mnemonic available) to string is not idented", account: accountview.NewAccount("alice", "cosmos193he38n21khnmb2", accountview.WithMnemonic("person estate daughter box chimney clay bronze ring story truck make excess ring frame desk start food leader sleep predict item rifle stem boy")), - want: "✔ Added account \x1b[1malice\x1b[0m with address cosmos193he38n21khnmb2 and mnemonic:\nperson estate daughter box chimney clay bronze ring story truck make excess ring frame desk start food leader sleep predict item rifle stem boy\n", + want: "✔ Added account alice with address cosmos193he38n21khnmb2 and mnemonic:\nperson estate daughter box chimney clay bronze ring story truck make excess ring frame desk start food leader sleep predict item rifle stem boy\n", }, { name: "existent account to string is not idented", account: accountview.NewAccount("alice", "cosmos193he38n21khnmb2"), - want: "👤 \x1b[1malice\x1b[0m's account address: cosmos193he38n21khnmb2\n", + want: "👤 alice's account address: cosmos193he38n21khnmb2\n", }, } diff --git a/ignite/pkg/cosmosfaucet/cosmosfaucet.go b/ignite/pkg/cosmosfaucet/cosmosfaucet.go index 0b70816fa8..1827d6aba6 100644 --- a/ignite/pkg/cosmosfaucet/cosmosfaucet.go +++ b/ignite/pkg/cosmosfaucet/cosmosfaucet.go @@ -6,6 +6,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" From 36ea80720d3ed0d9a335f8e6333c8ab0d59215c2 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 1 Dec 2024 03:36:33 -0300 Subject: [PATCH 3/7] fix coin assertion --- integration/faucet/faucet_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index 2674632245..5058db9b1a 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -114,7 +114,9 @@ func checkAccountBalance(ctx context.Context, t *testing.T, c cosmosclient.Clien require.Len(t, resp.Balances, len(coins)) expectedCoins, err := sdk.ParseCoinsNormalized(strings.Join(coins, ",")) require.NoError(t, err) - require.True(t, resp.Balances.Equal(expectedCoins), - fmt.Sprintf("%s should be equals to %s", resp.Balances.String(), expectedCoins.String()), + expectedCoins = expectedCoins.Sort() + gotCoins := resp.Balances.Sort() + require.True(t, gotCoins.Equal(expectedCoins), + fmt.Sprintf("%s should be equals to %s", gotCoins.String(), expectedCoins.String()), ) } From f9aafed9a0916b5c589d62b5fdadc6dc15953df0 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 1 Dec 2024 04:05:55 -0300 Subject: [PATCH 4/7] remove unused case --- integration/faucet/faucet_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index 5058db9b1a..ed07ed16ac 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -101,7 +101,7 @@ func TestRequestCoinsFromFaucet(t *testing.T) { }) } require.NoError(t, g.Wait()) - checkAccountBalance(ctx, t, cosmosClient, addr, []string{"130token", "13stake"}) + checkAccountBalance(ctx, t, cosmosClient, addr, maxCoins) } func checkAccountBalance(ctx context.Context, t *testing.T, c cosmosclient.Client, accAddr string, coins []string) { From 025d01212ede317eb9b2e0930078209bd7f03c60 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 1 Dec 2024 11:10:50 -0300 Subject: [PATCH 5/7] wait txs done --- integration/faucet/faucet_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index ed07ed16ac..b47ad1a8a5 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -101,6 +101,7 @@ func TestRequestCoinsFromFaucet(t *testing.T) { }) } require.NoError(t, g.Wait()) + time.Sleep(time.Second * 2) checkAccountBalance(ctx, t, cosmosClient, addr, maxCoins) } From 3195c1faf3636418407054a8e8a3343949fec272 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 1 Dec 2024 23:50:52 -0300 Subject: [PATCH 6/7] fix api break --- ignite/pkg/chaincmd/chaincmd.go | 5 +++-- ignite/pkg/chaincmd/runner/chain.go | 2 +- ignite/pkg/cosmosfaucet/transfer.go | 7 +++---- integration/faucet/faucet_test.go | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ignite/pkg/chaincmd/chaincmd.go b/ignite/pkg/chaincmd/chaincmd.go index 5f7869d37b..b1eb6d0a9e 100644 --- a/ignite/pkg/chaincmd/chaincmd.go +++ b/ignite/pkg/chaincmd/chaincmd.go @@ -2,6 +2,7 @@ package chaincmd import ( "fmt" + "strings" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" @@ -518,7 +519,7 @@ func BankSendWithFees(fee sdk.Coin) BankSendOption { } // BankSendCommand returns the command for transferring tokens. -func (c ChainCmd) BankSendCommand(fromAddress, toAddress string, amount []string, options ...BankSendOption) step.Option { +func (c ChainCmd) BankSendCommand(fromAddress, toAddress, amount string, options ...BankSendOption) step.Option { command := []string{ commandTx, } @@ -529,7 +530,7 @@ func (c ChainCmd) BankSendCommand(fromAddress, toAddress string, amount []string fromAddress, toAddress, ) - command = append(command, amount...) + command = append(command, strings.Split(amount, ",")...) command = append(command, optionBroadcastMode, flags.BroadcastSync, optionYes, diff --git a/ignite/pkg/chaincmd/runner/chain.go b/ignite/pkg/chaincmd/runner/chain.go index f53461e34e..6d08564ec3 100644 --- a/ignite/pkg/chaincmd/runner/chain.go +++ b/ignite/pkg/chaincmd/runner/chain.go @@ -167,7 +167,7 @@ func (r Runner) Status(ctx context.Context) (NodeStatus, error) { } // BankSend sends amount from fromAccount to toAccount. -func (r Runner) BankSend(ctx context.Context, fromAccount, toAccount string, amount []string, options ...chaincmd.BankSendOption) (string, error) { +func (r Runner) BankSend(ctx context.Context, fromAccount, toAccount, amount string, options ...chaincmd.BankSendOption) (string, error) { b := newBuffer() opt := []step.Option{ r.chainCmd.BankSendCommand(fromAccount, toAccount, amount, options...), diff --git a/ignite/pkg/cosmosfaucet/transfer.go b/ignite/pkg/cosmosfaucet/transfer.go index ac9d0c4eb6..d5145428a3 100644 --- a/ignite/pkg/cosmosfaucet/transfer.go +++ b/ignite/pkg/cosmosfaucet/transfer.go @@ -70,8 +70,7 @@ func (f *Faucet) Transfer(ctx context.Context, toAccountAddress string, coins sd transferMutex.Lock() defer transferMutex.Unlock() - var coinsStr []string - + transfer := sdk.NewCoins() // check for each coin, the max transferred amount hasn't been reached for _, c := range coins { totalSent, err := f.TotalTransferredAmount(ctx, toAccountAddress, c.Denom) @@ -97,7 +96,7 @@ func (f *Faucet) Transfer(ctx context.Context, toAccountAddress string, coins sd } } - coinsStr = append(coinsStr, c.String()) + transfer = transfer.Add(c) } // perform transfer for all coins @@ -105,7 +104,7 @@ func (f *Faucet) Transfer(ctx context.Context, toAccountAddress string, coins sd if err != nil { return err } - txHash, err := f.runner.BankSend(ctx, fromAccount.Address, toAccountAddress, coinsStr, chaincmd.BankSendWithFees(f.feeAmount)) + txHash, err := f.runner.BankSend(ctx, fromAccount.Address, toAccountAddress, transfer.String(), chaincmd.BankSendWithFees(f.feeAmount)) if err != nil { return err } diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index b47ad1a8a5..33ec46d556 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -101,8 +101,7 @@ func TestRequestCoinsFromFaucet(t *testing.T) { }) } require.NoError(t, g.Wait()) - time.Sleep(time.Second * 2) - checkAccountBalance(ctx, t, cosmosClient, addr, maxCoins) + checkAccountBalance(ctx, t, cosmosClient, addr, []string{"3stake", "30token"}) } func checkAccountBalance(ctx context.Context, t *testing.T, c cosmosclient.Client, accAddr string, coins []string) { From 5e6aaa2723098dc8440a98df65d97db39a4e1f6b Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Mon, 2 Dec 2024 03:33:58 -0300 Subject: [PATCH 7/7] fix transfer test --- integration/faucet/faucet_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index 33ec46d556..2865762963 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "cosmossdk.io/math" banktypes "cosmossdk.io/x/bank/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -15,7 +16,6 @@ import ( "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" - "github.com/ignite/cli/v29/ignite/pkg/errors" "github.com/ignite/cli/v29/ignite/pkg/xurl" envtest "github.com/ignite/cli/v29/integration" ) @@ -32,7 +32,7 @@ var ( func TestRequestCoinsFromFaucet(t *testing.T) { var ( env = envtest.New(t) - app = env.Scaffold("github.com/test/faucet") + app = env.Scaffold("github.com/test/faucetapp") servers = app.RandomizeServerPorts() faucetURL = app.EnableFaucet(defaultCoins, maxCoins) ctx, cancel = context.WithTimeout(env.Ctx(), envtest.ServeTimeout) @@ -93,15 +93,17 @@ func TestRequestCoinsFromFaucet(t *testing.T) { for i := 0; i < 10; i++ { g.Go(func() error { c := faucetClient - _, err := c.Transfer(ctx, cosmosfaucet.NewTransferRequest(addr, nil)) - if err != nil && !errors.As(err, &cosmosfaucet.ErrTransferRequest{}) { - return err + index := i + 1 + coins := []string{ + sdk.NewCoin("token", math.NewInt(int64(index*2))).String(), + sdk.NewCoin("stake", math.NewInt(int64(index*3))).String(), } - return nil + _, err := c.Transfer(ctx, cosmosfaucet.NewTransferRequest(addr, coins)) + return err }) } require.NoError(t, g.Wait()) - checkAccountBalance(ctx, t, cosmosClient, addr, []string{"3stake", "30token"}) + checkAccountBalance(ctx, t, cosmosClient, addr, []string{"168stake", "140token"}) } func checkAccountBalance(ctx context.Context, t *testing.T, c cosmosclient.Client, accAddr string, coins []string) {