From 3ddd5eb81af28e4ef31fd02394f2bf3b47409228 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sat, 25 May 2024 11:00:11 -0500 Subject: [PATCH 01/19] https://github.com/liftedinit/manifest-ledger/issues/21 --- go.work.sum | 18 ++++++++++++++++++ keeper/keeper.go | 23 +++++++++++++++++++++-- keeper/keeper_test.go | 2 +- module/depinject.go | 4 +++- simapp/app.go | 1 + 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/go.work.sum b/go.work.sum index 700d280..b0e47fc 100644 --- a/go.work.sum +++ b/go.work.sum @@ -385,6 +385,7 @@ cloud.google.com/go/workflows v1.12.4/go.mod h1:yQ7HUqOkdJK4duVtMeBCAOPiN1ZF1E9p cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/api v0.7.1/go.mod h1:ure9edhcROIHsngavM6mBLilMGFnfjhV/AaYhEMUkdo= cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= cosmossdk.io/log v1.2.0/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= @@ -672,9 +673,11 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI= github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913151713-376c3ea7fd0c/go.mod h1:A4EWz1NvP6QHQf0y9+BpnB/0ruFrONnru+vEWwIX4DY= github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= +github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= github.com/cosmos/iavl v1.0.0-rc.1/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= @@ -1032,12 +1035,14 @@ github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFR github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= +github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= @@ -1275,6 +1280,7 @@ github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+ github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= github.com/linxGnu/grocksdb v1.8.4/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/linxGnu/grocksdb v1.8.6/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= @@ -1460,6 +1466,7 @@ github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQm github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/phpdave11/gofpdf v1.4.2 h1:KPKiIbfwbvC/wOncwhrpRdXVj2CZTCFlw4wnoyjtHfQ= @@ -1529,6 +1536,7 @@ github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+L github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= @@ -1539,6 +1547,7 @@ github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7 h1:cZC+usqsYgHtlBaGulVnZ1hfKAi8iWtujBnRLQE698c= github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7/go.mod h1:IToEjHuttnUzwZI5KBSM/LOOW3qLbbrHOEfp3SbECGY= github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= @@ -1851,6 +1860,7 @@ golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N0 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -1872,17 +1882,21 @@ golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5 h1:ObuXPmIgI4ZMyQLIz48cJYgSyWdjUXc2SZAdyJMwEAU= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1904,12 +1918,14 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1953,6 +1969,7 @@ google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0 google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= @@ -1965,6 +1982,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go. google.golang.org/genproto/googleapis/api v0.0.0-20240122161410-6c6643bf1457/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= google.golang.org/genproto/googleapis/bytestream v0.0.0-20231120223509-83a465c0220f h1:hL+1ptbhFoeL1HcROQ8OGXaqH0jYRRibgWQWco0/Ugc= google.golang.org/genproto/googleapis/bytestream v0.0.0-20231120223509-83a465c0220f/go.mod h1:iIgEblxoG4klcXsG0d9cpoxJ4xndv6+1FkDROCHhPRI= diff --git a/keeper/keeper.go b/keeper/keeper.go index 636bcaa..c8a2902 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -37,6 +37,8 @@ type Keeper struct { CachedBlockPower collections.Item[poa.PowerCache] AbsoluteChangedInBlockPower collections.Item[poa.PowerCache] + + authority string } // NewKeeper creates a new poa Keeper instance @@ -47,6 +49,7 @@ func NewKeeper( slk SlashingKeeper, bk BankKeeper, logger log.Logger, + adminAuthority string, ) Keeper { logger = logger.With(log.ModuleKey, "x/"+poa.ModuleName) @@ -66,6 +69,8 @@ func NewKeeper( CachedBlockPower: collections.NewItem(sb, poa.CachedPreviousBlockPowerKey, "cached_block", codec.CollValue[poa.PowerCache](cdc)), AbsoluteChangedInBlockPower: collections.NewItem(sb, poa.AbsoluteChangedInBlockPowerKey, "absolute_changed_power", codec.CollValue[poa.PowerCache](cdc)), + + authority: adminAuthority, } schema, err := sb.Build() @@ -103,7 +108,20 @@ func (k Keeper) GetAdmins(ctx context.Context) []string { return []string{} } - return p.Admins + admins := p.Admins + + found := false + for _, auth := range admins { + if auth == k.authority { + found = true + break + } + } + if !found { + admins = append(admins, k.authority) + } + + return admins } // IsAdmin checks if the given address is an admin. @@ -114,7 +132,8 @@ func (k Keeper) IsAdmin(ctx context.Context, fromAddr string) bool { } } - return false + // the main authority may already be in the GetAdmins list. If not, we check here. + return k.authority == fromAddr } // IsSenderValidator checks if the given sender address is the same address as the validator by bytes. diff --git a/keeper/keeper_test.go b/keeper/keeper_test.go index 3c7e389..7615537 100644 --- a/keeper/keeper_test.go +++ b/keeper/keeper_test.go @@ -90,7 +90,7 @@ func SetupTest(t *testing.T, baseValShares int64) *testFixture { registerBaseSDKModules(f, encCfg, storeService, logger, require) // Setup POA Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.stakingKeeper, f.slashingKeeper, f.bankkeeper, logger) + f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.stakingKeeper, f.slashingKeeper, f.bankkeeper, logger, "") f.msgServer = keeper.NewMsgServerImpl(f.k) f.queryServer = keeper.NewQueryServerImpl(f.k) f.appModule = poamodule.NewAppModule(encCfg.Codec, f.k) diff --git a/module/depinject.go b/module/depinject.go index ef2a016..9fdf469 100644 --- a/module/depinject.go +++ b/module/depinject.go @@ -43,6 +43,8 @@ type ModuleInputs struct { StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper BankKeeper bankkeeper.Keeper + + Authority string } type ModuleOutputs struct { @@ -53,7 +55,7 @@ type ModuleOutputs struct { } func ProvideModule(in ModuleInputs) ModuleOutputs { - k := keeper.NewKeeper(in.Cdc, in.StoreService, &in.StakingKeeper, in.SlashingKeeper, in.BankKeeper, log.NewLogger(os.Stderr)) + k := keeper.NewKeeper(in.Cdc, in.StoreService, &in.StakingKeeper, in.SlashingKeeper, in.BankKeeper, log.NewLogger(os.Stderr), in.Authority) m := NewAppModule(in.Cdc, k) return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} diff --git a/simapp/app.go b/simapp/app.go index 152c5f6..34565c0 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -321,6 +321,7 @@ func NewSimApp( app.SlashingKeeper, app.BankKeeper, logger, + govModAddress, ) // register the staking hooks From 955113dfe2d2e5c340257cd107435086641b695f Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 16 Jul 2024 13:54:24 -0500 Subject: [PATCH 02/19] refactor: only use authority as admin (no params) --- README.md | 2 +- api/v1/params.pulsar.go | 233 ++++-------------- client/cli/tx.go | 16 +- e2e/helpers/poa.go | 11 +- e2e/poa_gov_test.go | 13 +- errors.go | 12 +- keeper/genesis_test.go | 9 +- keeper/keeper.go | 31 +-- keeper/keeper_test.go | 36 +-- keeper/msg_server.go | 2 +- keeper/msg_server_test.go | 14 +- keeper/query_server_test.go | 24 -- params.go | 29 +-- params.pb.go | 131 +++------- .../strangelove_ventures/poa/v1/params.proto | 3 +- 15 files changed, 131 insertions(+), 435 deletions(-) diff --git a/README.md b/README.md index 6ec0ec1..a9568c4 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ poad tx poa set-power [validator] [amount] [--unsafe] # - any admin can modify the list at any time # - there must be at least one admin in the list at all times # - allow_validator_self_exit is a bool to allow validators to force remove themselves from the set. -poad tx poa update-params [admin1,admin2,admin3,...] [allow_validator_self_exit] +poad tx poa update-params [allow_validator_self_exit] # (admin) Update the staking module params # - unbondingTime is the time that a validator must wait to unbond (ex: 336h) diff --git a/api/v1/params.pulsar.go b/api/v1/params.pulsar.go index 483161b..7aa23b5 100644 --- a/api/v1/params.pulsar.go +++ b/api/v1/params.pulsar.go @@ -16,62 +16,14 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_Params_1_list)(nil) - -type _Params_1_list struct { - list *[]string -} - -func (x *_Params_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Params_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Params_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Params_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Params_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Params at list field Admins as it is not of Message kind")) -} - -func (x *_Params_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Params_1_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Params_1_list) IsValid() bool { - return x.list != nil -} - var ( md_Params protoreflect.MessageDescriptor - fd_Params_admins protoreflect.FieldDescriptor fd_Params_allow_validator_self_exit protoreflect.FieldDescriptor ) func init() { file_strangelove_ventures_poa_v1_params_proto_init() md_Params = File_strangelove_ventures_poa_v1_params_proto.Messages().ByName("Params") - fd_Params_admins = md_Params.Fields().ByName("admins") fd_Params_allow_validator_self_exit = md_Params.Fields().ByName("allow_validator_self_exit") } @@ -140,12 +92,6 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Admins) != 0 { - value := protoreflect.ValueOfList(&_Params_1_list{list: &x.Admins}) - if !f(fd_Params_admins, value) { - return - } - } if x.AllowValidatorSelfExit != false { value := protoreflect.ValueOfBool(x.AllowValidatorSelfExit) if !f(fd_Params_allow_validator_self_exit, value) { @@ -167,8 +113,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - return len(x.Admins) != 0 case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": return x.AllowValidatorSelfExit != false default: @@ -187,8 +131,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - x.Admins = nil case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": x.AllowValidatorSelfExit = false default: @@ -207,12 +149,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - if len(x.Admins) == 0 { - return protoreflect.ValueOfList(&_Params_1_list{}) - } - listValue := &_Params_1_list{list: &x.Admins} - return protoreflect.ValueOfList(listValue) case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": value := x.AllowValidatorSelfExit return protoreflect.ValueOfBool(value) @@ -236,10 +172,6 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - lv := value.List() - clv := lv.(*_Params_1_list) - x.Admins = *clv.list case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": x.AllowValidatorSelfExit = value.Bool() default: @@ -262,12 +194,6 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - if x.Admins == nil { - x.Admins = []string{} - } - value := &_Params_1_list{list: &x.Admins} - return protoreflect.ValueOfList(value) case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": panic(fmt.Errorf("field allow_validator_self_exit of message strangelove_ventures.poa.v1.Params is not mutable")) default: @@ -283,9 +209,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - list := []string{} - return protoreflect.ValueOfList(&_Params_1_list{list: &list}) case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": return protoreflect.ValueOfBool(false) default: @@ -357,12 +280,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.Admins) > 0 { - for _, s := range x.Admins { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.AllowValidatorSelfExit { n += 2 } @@ -405,15 +322,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x10 } - if len(x.Admins) > 0 { - for iNdEx := len(x.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Admins[iNdEx]) - copy(dAtA[i:], x.Admins[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admins[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -463,38 +371,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Admins = append(x.Admins, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowValidatorSelfExit", wireType) @@ -1276,8 +1152,6 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Array of addresses that are allowed to control the chains validators power. - Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. AllowValidatorSelfExit bool `protobuf:"varint,2,opt,name=allow_validator_self_exit,json=allowValidatorSelfExit,proto3" json:"allow_validator_self_exit,omitempty"` } @@ -1302,13 +1176,6 @@ func (*Params) Descriptor() ([]byte, []int) { return file_strangelove_ventures_poa_v1_params_proto_rawDescGZIP(), []int{0} } -func (x *Params) GetAdmins() []string { - if x != nil { - return x.Admins - } - return nil -} - func (x *Params) GetAllowValidatorSelfExit() bool { if x != nil { return x.AllowValidatorSelfExit @@ -1413,58 +1280,56 @@ var file_strangelove_ventures_poa_v1_params_proto_rawDesc = []byte{ 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x12, 0x39, 0x0a, - 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x53, 0x65, 0x6c, 0x66, 0x45, 0x78, 0x69, 0x74, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, - 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x70, 0x6f, 0x61, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0xa3, 0x03, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, - 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, - 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, - 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x65, 0x78, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x6c, 0x66, 0x45, 0x78, 0x69, 0x74, + 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x70, + 0x6f, 0x61, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xa3, 0x03, 0x0a, 0x0d, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, + 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, + 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, + 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, + 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, - 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, - 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, - 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x83, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, - 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, - 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, - 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, - 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, + 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x83, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, + 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, + 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, + 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, + 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, + 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/client/cli/tx.go b/client/cli/tx.go index e765b5c..0530548 100644 --- a/client/cli/tx.go +++ b/client/cli/tx.go @@ -161,29 +161,21 @@ func NewRemovePendingCmd() *cobra.Command { func NewUpdateParamsCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "update-params [admin1,admin2,admin3,...] [allow-validator-self-exit-bool]", + Use: "update-params [allow-validator-self-exit-bool]", Short: "update the PoA module params", - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - admins := strings.Split(args[0], ",") - for _, admin := range admins { - _, err = sdk.AccAddressFromBech32(admin) - if err != nil { - return fmt.Errorf("AccAddressFromBech32 failed: %w", err) - } - } - - allowGracefulExit, err := strconv.ParseBool(args[1]) + allowGracefulExit, err := strconv.ParseBool(args[0]) if err != nil { return fmt.Errorf("strconv.ParseBool failed: %w", err) } - p, err := poa.NewParams(admins, allowGracefulExit) + p, err := poa.NewParams(allowGracefulExit) if err != nil { return fmt.Errorf("NewParams failed: %w", err) } diff --git a/e2e/helpers/poa.go b/e2e/helpers/poa.go index dcf06a0..bf912ca 100644 --- a/e2e/helpers/poa.go +++ b/e2e/helpers/poa.go @@ -106,20 +106,13 @@ func GetPOAPending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) return res } -func POAUpdateParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, admins []string, gracefulExit bool) (TxResponse, error) { - // admin1,admin2,admin3 - adminList := "" - for _, admin := range admins { - adminList += admin + "," - } - adminList = adminList[:len(adminList)-1] - +func POAUpdateParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, gracefulExit bool) (TxResponse, error) { gracefulParam := "true" if !gracefulExit { gracefulParam = "false" } - cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "update-params", adminList, gracefulParam}, user.KeyName()) + cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "update-params", gracefulParam}, user.KeyName()) return ExecuteTransaction(ctx, chain, cmd) } diff --git a/e2e/poa_gov_test.go b/e2e/poa_gov_test.go index 94c0535..dc39301 100644 --- a/e2e/poa_gov_test.go +++ b/e2e/poa_gov_test.go @@ -60,7 +60,7 @@ func testGovernance(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain &poa.MsgUpdateParams{ Sender: GovModuleAddress, Params: poa.Params{ - Admins: []string{acc0.FormattedAddress(), GovModuleAddress, RandAcc}, + AllowValidatorSelfExit: false, }, }, } @@ -68,7 +68,7 @@ func testGovernance(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain propId := helpers.SubmitParamChangeProp(t, ctx, chain, acc0, updatedParams, GovModuleAddress, 25) helpers.ValidatorVote(t, ctx, chain, propId, cosmos.ProposalVoteYes, 30) - require.Len(t, helpers.GetPOAParams(t, ctx, chain).Admins, 3, "Admins should be 3") + require.True(t, helpers.GetPOAParams(t, ctx, chain).AllowValidatorSelfExit, "AllowValidatorSelfExit should be true") }) t.Run("success: gov proposal validator change", func(t *testing.T) { @@ -91,7 +91,7 @@ func testUpdatePOAParams(t *testing.T, ctx context.Context, chain *cosmos.Cosmos t.Log("\n===== TEST UPDATE POA PARAMS =====") t.Run("fail: update-params message from a non authorized user", func(t *testing.T) { - tx, err = helpers.POAUpdateParams(t, ctx, chain, incorrectUser, []string{incorrectUser.FormattedAddress()}, true) + tx, err = helpers.POAUpdateParams(t, ctx, chain, incorrectUser, true) if err != nil { t.Fatal(err) } @@ -140,8 +140,7 @@ func testUpdatePOAParams(t *testing.T, ctx context.Context, chain *cosmos.Cosmos }) t.Run("success: update-params message from an authorized user with cli.", func(t *testing.T) { - newAdmins := []string{acc0.FormattedAddress(), GovModuleAddress, RandAcc, incorrectUser.FormattedAddress()} - tx, err = helpers.POAUpdateParams(t, ctx, chain, acc0, newAdmins, true) + tx, err = helpers.POAUpdateParams(t, ctx, chain, acc0, true) if err != nil { t.Fatal(err) } @@ -151,9 +150,7 @@ func testUpdatePOAParams(t *testing.T, ctx context.Context, chain *cosmos.Cosmos require.EqualValues(t, txRes.Code, 0) p := helpers.GetPOAParams(t, ctx, chain) - for _, admin := range newAdmins { - require.Contains(t, p.Admins, admin) - } + require.False(t, p.AllowValidatorSelfExit) // TODO: check this }) } diff --git a/errors.go b/errors.go index a501b18..3c4e2e8 100644 --- a/errors.go +++ b/errors.go @@ -5,10 +5,10 @@ import ( ) var ( - ErrStakingActionNotAllowed = sdkerrors.Register(ModuleName, 1, "staking actions are now allowed on this chain") - ErrPowerBelowMinimum = sdkerrors.Register(ModuleName, 2, "power must be above 1_000_000") - ErrNotAnAuthority = sdkerrors.Register(ModuleName, 3, "not an authority") - ErrUnsafePower = sdkerrors.Register(ModuleName, 4, "unsafe: msg.Power is >30%% of total power, set unsafe=true to override") - ErrMustProvideAtLeastOneAddress = sdkerrors.Register(ModuleName, 5, "must provide at least one address") - ErrValidatorSelfRemoval = sdkerrors.Register(ModuleName, 6, "validator is not allowed to remove themselves") + ErrStakingActionNotAllowed = sdkerrors.Register(ModuleName, 1, "staking actions are now allowed on this chain") + ErrPowerBelowMinimum = sdkerrors.Register(ModuleName, 2, "power must be above 1_000_000") + ErrNotAnAuthority = sdkerrors.Register(ModuleName, 3, "not an authority") + ErrUnsafePower = sdkerrors.Register(ModuleName, 4, "unsafe: msg.Power is >30%% of total power, set unsafe=true to override") + // ErrMustProvideAtLeastOneAddress = sdkerrors.Register(ModuleName, 5, "must provide at least one address") + ErrValidatorSelfRemoval = sdkerrors.Register(ModuleName, 6, "validator is not allowed to remove themselves") ) diff --git a/keeper/genesis_test.go b/keeper/genesis_test.go index 1e2ecec..b3ce066 100644 --- a/keeper/genesis_test.go +++ b/keeper/genesis_test.go @@ -30,7 +30,7 @@ func TestInitGenesis(t *testing.T) { }) t.Run("custom params", func(t *testing.T) { - p, err := poa.NewParams([]string{fixture.addrs[0].String(), fixture.addrs[1].String()}, true) + p, err := poa.NewParams(true) require.NoError(err) data := &poa.GenesisState{ @@ -44,13 +44,8 @@ func TestInitGenesis(t *testing.T) { require.Equal(p, params) }) - t.Run("bad params", func(t *testing.T) { - _, err := poa.NewParams(nil, false) - require.Error(err) - }) - t.Run("pending validator export", func(t *testing.T) { - p, err := poa.NewParams([]string{fixture.addrs[0].String(), fixture.addrs[1].String()}, true) + p, err := poa.NewParams(true) require.NoError(err) acc := GenAcc() diff --git a/keeper/keeper.go b/keeper/keeper.go index c8a2902..04cb360 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -101,38 +101,13 @@ func (k Keeper) GetBankKeeper() BankKeeper { return k.bankKeeper } -// GetAdmins returns the module's administrators with delegation of power control. -func (k Keeper) GetAdmins(ctx context.Context) []string { - p, err := k.GetParams(ctx) - if err != nil { - return []string{} - } - - admins := p.Admins - - found := false - for _, auth := range admins { - if auth == k.authority { - found = true - break - } - } - if !found { - admins = append(admins, k.authority) - } - - return admins +// GetAdmin returns the module's administrators with delegation of power control (authority) +func (k Keeper) GetAdmin(ctx context.Context) string { + return k.authority } // IsAdmin checks if the given address is an admin. func (k Keeper) IsAdmin(ctx context.Context, fromAddr string) bool { - for _, auth := range k.GetAdmins(ctx) { - if auth == fromAddr { - return true - } - } - - // the main authority may already be in the GetAdmins list. If not, we check here. return k.authority == fromAddr } diff --git a/keeper/keeper_test.go b/keeper/keeper_test.go index 7615537..80e47bf 100644 --- a/keeper/keeper_test.go +++ b/keeper/keeper_test.go @@ -41,13 +41,16 @@ import ( poamodule "github.com/strangelove-ventures/poa/module" ) -var maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - minttypes.ModuleName: {authtypes.Minter}, - govtypes.ModuleName: {authtypes.Burner}, -} +var ( + authorityAddr = "cosmos15ky9du8a2wlstz6fpx3p4mqpjyrm5cgqjwl8sq" + maccPerms = map[string][]string{ + authtypes.FeeCollectorName: nil, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + minttypes.ModuleName: {authtypes.Minter}, + govtypes.ModuleName: {authtypes.Burner}, + } +) type testFixture struct { suite.Suite @@ -64,8 +67,8 @@ type testFixture struct { bankkeeper bankkeeper.BaseKeeper mintkeeper mintkeeper.Keeper - addrs []sdk.AccAddress - govModAddr string + addrs []sdk.AccAddress + authorityAddr string } func SetupTest(t *testing.T, baseValShares int64) *testFixture { @@ -77,7 +80,7 @@ func SetupTest(t *testing.T, baseValShares int64) *testFixture { logger := log.NewTestLogger(t) encCfg := moduletestutil.MakeTestEncodingConfig() - f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String() + f.authorityAddr = authorityAddr f.addrs = simtestutil.CreateIncrementalAccounts(3) key := storetypes.NewKVStoreKey(poa.ModuleName) @@ -90,7 +93,7 @@ func SetupTest(t *testing.T, baseValShares int64) *testFixture { registerBaseSDKModules(f, encCfg, storeService, logger, require) // Setup POA Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.stakingKeeper, f.slashingKeeper, f.bankkeeper, logger, "") + f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.stakingKeeper, f.slashingKeeper, f.bankkeeper, logger, authorityAddr) f.msgServer = keeper.NewMsgServerImpl(f.k) f.queryServer = keeper.NewQueryServerImpl(f.k) f.appModule = poamodule.NewAppModule(encCfg.Codec, f.k) @@ -117,7 +120,6 @@ func (f *testFixture) InitPoAGenesis(t *testing.T) { t.Helper() genState := poa.NewGenesisState() - genState.Params.Admins = []string{f.addrs[0].String(), f.govModAddr} require.NoError(t, f.k.InitGenesis(f.ctx, genState)) } @@ -134,7 +136,7 @@ func registerBaseSDKModules( authtypes.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, - f.govModAddr, + f.authorityAddr, ) // Bank Keeper. @@ -142,13 +144,13 @@ func registerBaseSDKModules( encCfg.Codec, storeService, f.accountkeeper, nil, - f.govModAddr, logger, + f.authorityAddr, logger, ) // Staking Keeper. f.stakingKeeper = stakingkeeper.NewKeeper( encCfg.Codec, storeService, - f.accountkeeper, f.bankkeeper, f.govModAddr, + f.accountkeeper, f.bankkeeper, f.authorityAddr, authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), ) @@ -159,7 +161,7 @@ func registerBaseSDKModules( f.slashingKeeper = slashingkeeper.NewKeeper( encCfg.Codec, encCfg.Amino, storeService, f.stakingKeeper, - f.govModAddr, + f.authorityAddr, ) err = f.slashingKeeper.SetParams(f.ctx, slashingtypes.DefaultParams()) require.NoError(err) @@ -169,7 +171,7 @@ func registerBaseSDKModules( f.mintkeeper = mintkeeper.NewKeeper( encCfg.Codec, storeService, f.stakingKeeper, f.accountkeeper, f.bankkeeper, - authtypes.FeeCollectorName, f.govModAddr, + authtypes.FeeCollectorName, f.authorityAddr, ) } diff --git a/keeper/msg_server.go b/keeper/msg_server.go index e15496f..db010df 100644 --- a/keeper/msg_server.go +++ b/keeper/msg_server.go @@ -28,7 +28,7 @@ func NewMsgServerImpl(keeper Keeper) poa.MsgServer { func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.MsgSetPowerResponse, error) { if isAdmin := ms.k.IsAdmin(ctx, msg.Sender); !isAdmin { - return nil, errorsmod.Wrapf(poa.ErrNotAnAuthority, "sender %s is not an authority. allowed: %+v", msg.Sender, ms.k.GetAdmins(ctx)) + return nil, errorsmod.Wrapf(poa.ErrNotAnAuthority, "sender %s is not an authority. allowed: %+v", msg.Sender, ms.k.GetAdmin(ctx)) } if err := msg.Validate(ms.k.GetValidatorAddressCodec()); err != nil { diff --git a/keeper/msg_server_test.go b/keeper/msg_server_test.go index a588c77..474af19 100644 --- a/keeper/msg_server_test.go +++ b/keeper/msg_server_test.go @@ -36,20 +36,12 @@ func TestUpdateParams(t *testing.T) { }, expectErrMsg: "not an authority", }, - { - name: "set invalid admins", - request: &poa.MsgUpdateParams{ - Sender: f.govModAddr, - Params: poa.Params{}, - }, - expectErrMsg: poa.ErrMustProvideAtLeastOneAddress.Error(), - }, { name: "set valid params", request: &poa.MsgUpdateParams{ - Sender: f.govModAddr, + Sender: f.authorityAddr, Params: poa.Params{ - Admins: []string{f.addrs[0].String()}, + AllowValidatorSelfExit: true, }, }, }, @@ -96,7 +88,7 @@ func TestUpdateStakingParams(t *testing.T) { { name: "set valid params", request: &poa.MsgUpdateStakingParams{ - Sender: f.govModAddr, + Sender: f.authorityAddr, Params: poa.DefaultStakingParams(), }, expectErrMsg: "", diff --git a/keeper/query_server_test.go b/keeper/query_server_test.go index 4c0b774..c44bd3e 100644 --- a/keeper/query_server_test.go +++ b/keeper/query_server_test.go @@ -67,30 +67,6 @@ func TestParamsQuery(t *testing.T) { }, expected: poa.DefaultParams(), }, - { - name: "two admins", - request: &poa.MsgUpdateParams{ - Sender: f.govModAddr, - Params: poa.Params{ - Admins: []string{f.govModAddr, f.addrs[0].String()}, - }, - }, - expected: poa.Params{ - Admins: []string{f.govModAddr, f.addrs[0].String()}, - }, - }, - { - name: "duplicate admins", - request: &poa.MsgUpdateParams{ - Sender: f.govModAddr, - Params: poa.Params{ - Admins: []string{f.govModAddr, f.govModAddr}, - }, - }, - expected: poa.Params{ - Admins: []string{f.govModAddr, f.govModAddr}, - }, - }, } for _, tc := range testCases { diff --git a/params.go b/params.go index 5f19568..3d9ccab 100644 --- a/params.go +++ b/params.go @@ -2,28 +2,20 @@ package poa import ( "encoding/json" - fmt "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // DefaultParams returns default module parameters. func DefaultParams() Params { - govModuleAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String() - return Params{ - Admins: []string{govModuleAddress}, AllowValidatorSelfExit: true, } } // NewParams returns a new POA Params. -func NewParams(admins []string, allowValSelfExit bool) (Params, error) { +func NewParams(allowValSelfExit bool) (Params, error) { p := Params{ - Admins: admins, AllowValidatorSelfExit: allowValSelfExit, } @@ -56,24 +48,5 @@ func (p Params) String() string { // Validate does the sanity check on the params. func (p Params) Validate() error { - return validateAdmins(p.Admins) -} - -func validateAdmins(i interface{}) error { - admins, ok := i.([]string) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if len(admins) == 0 { - return ErrMustProvideAtLeastOneAddress - } - - for _, auth := range admins { - if _, err := sdk.AccAddressFromBech32(auth); err != nil { - return err - } - } - return nil } diff --git a/params.pb.go b/params.pb.go index c3dd587..18ff519 100644 --- a/params.pb.go +++ b/params.pb.go @@ -32,8 +32,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - // Array of addresses that are allowed to control the chains validators power. - Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. AllowValidatorSelfExit bool `protobuf:"varint,2,opt,name=allow_validator_self_exit,json=allowValidatorSelfExit,proto3" json:"allow_validator_self_exit,omitempty"` } @@ -70,13 +68,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetAdmins() []string { - if m != nil { - return m.Admins - } - return nil -} - func (m *Params) GetAllowValidatorSelfExit() bool { if m != nil { return m.AllowValidatorSelfExit @@ -180,41 +171,40 @@ func init() { } var fileDescriptor_b1333a19bedb70c3 = []byte{ - // 535 bytes of a gzipped FileDescriptorProto + // 522 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x6f, 0xd3, 0x40, - 0x14, 0xc6, 0x73, 0x14, 0x22, 0x7a, 0x55, 0x2a, 0xd5, 0xa0, 0xe2, 0xa4, 0xc2, 0x8e, 0x02, 0x48, - 0x51, 0xa5, 0xf8, 0x54, 0x98, 0x88, 0xc4, 0x12, 0xd2, 0x0d, 0x09, 0xe4, 0x56, 0x0c, 0x2c, 0xd6, - 0xc5, 0xbe, 0x38, 0xa7, 0xf8, 0xee, 0x45, 0xbe, 0x4b, 0x70, 0x77, 0x26, 0x26, 0xc6, 0x8e, 0x95, - 0x58, 0x18, 0x3b, 0xf0, 0x47, 0x74, 0xac, 0x98, 0x10, 0x43, 0x40, 0xc9, 0x50, 0x66, 0xfe, 0x02, - 0x64, 0x9f, 0x93, 0x76, 0xe8, 0x62, 0xf9, 0xbd, 0xf7, 0xbb, 0xbb, 0xef, 0xbb, 0xef, 0x70, 0x5b, - 0xe9, 0x94, 0xca, 0x98, 0x25, 0x30, 0x63, 0xc1, 0x8c, 0x49, 0x3d, 0x4d, 0x99, 0x22, 0x13, 0xa0, - 0x64, 0x76, 0x40, 0x26, 0x34, 0xa5, 0x42, 0x79, 0x93, 0x14, 0x34, 0x58, 0x7b, 0xb7, 0x91, 0xde, - 0x04, 0xa8, 0x37, 0x3b, 0x68, 0x3c, 0x8c, 0x21, 0x86, 0x82, 0x23, 0xf9, 0x9f, 0x59, 0xd2, 0xd8, - 0xa1, 0x82, 0x4b, 0x20, 0xc5, 0xb7, 0x6c, 0x39, 0x31, 0x40, 0x9c, 0x30, 0x52, 0x54, 0x83, 0xe9, - 0x90, 0x44, 0xd3, 0x94, 0x6a, 0x0e, 0xb2, 0x9c, 0xd7, 0x43, 0x50, 0x02, 0x54, 0x60, 0xf6, 0x32, - 0x85, 0x19, 0xb5, 0x34, 0xae, 0xbe, 0x2b, 0x04, 0x59, 0xbb, 0xb8, 0x4a, 0x23, 0xc1, 0xa5, 0xb2, - 0x51, 0x73, 0xa3, 0xbd, 0xe9, 0x97, 0x95, 0xf5, 0x12, 0xd7, 0x69, 0x92, 0xc0, 0xc7, 0x60, 0x46, - 0x13, 0x1e, 0x51, 0x0d, 0x69, 0xa0, 0x58, 0x32, 0x0c, 0x58, 0xc6, 0xb5, 0x7d, 0xa7, 0x89, 0xda, - 0xf7, 0xfd, 0xdd, 0x02, 0x78, 0xbf, 0x9a, 0x1f, 0xb1, 0x64, 0x78, 0x98, 0x71, 0xdd, 0x7d, 0x74, - 0x7a, 0xe6, 0x56, 0xfe, 0x9e, 0xb9, 0xe8, 0xf3, 0xd5, 0xf9, 0x3e, 0xce, 0xfd, 0x1b, 0xf3, 0xad, - 0xaf, 0x1b, 0xb8, 0x76, 0xa4, 0xe9, 0x98, 0xcb, 0xb8, 0x3c, 0xfd, 0x2d, 0xde, 0x9e, 0xca, 0x01, - 0xc8, 0x88, 0xcb, 0x38, 0xd0, 0x5c, 0x30, 0x1b, 0x35, 0x51, 0x7b, 0xeb, 0x79, 0xdd, 0x33, 0xde, - 0xbc, 0x95, 0x37, 0xaf, 0x5f, 0x7a, 0xeb, 0xd5, 0x2e, 0xe6, 0x6e, 0xe5, 0xf4, 0xb7, 0x8b, 0xbe, - 0x5d, 0x9d, 0xef, 0x23, 0xbf, 0xb6, 0x5e, 0x7f, 0xcc, 0x05, 0xb3, 0x9e, 0xe1, 0x6d, 0x41, 0xb3, - 0x6b, 0xd1, 0xaa, 0xd0, 0x5a, 0xf3, 0x6b, 0x82, 0x66, 0x6b, 0xa5, 0xca, 0x72, 0xf1, 0x56, 0x8e, - 0x31, 0xa9, 0x53, 0xce, 0x94, 0xbd, 0x51, 0x30, 0x58, 0xd0, 0xec, 0xd0, 0x74, 0xac, 0x0e, 0xb6, - 0x46, 0x5c, 0x69, 0x48, 0x79, 0x48, 0x93, 0x35, 0x77, 0xb7, 0xe0, 0x76, 0xae, 0x27, 0x2b, 0xfc, - 0x31, 0xc6, 0xb9, 0x8a, 0x20, 0x62, 0x12, 0x84, 0x7d, 0xaf, 0x89, 0xda, 0x9b, 0xfe, 0x66, 0xde, - 0xe9, 0xe7, 0x0d, 0xeb, 0x13, 0xc2, 0x0f, 0x04, 0x97, 0x41, 0x08, 0x42, 0x70, 0xa5, 0x38, 0xc8, - 0x20, 0xa5, 0x9a, 0xd9, 0xd5, 0x1c, 0xec, 0x1d, 0xe7, 0x8e, 0x7e, 0xcd, 0xdd, 0x3d, 0x13, 0x91, - 0x8a, 0xc6, 0x1e, 0x07, 0x22, 0xa8, 0x1e, 0x79, 0x6f, 0x58, 0x4c, 0xc3, 0x93, 0x3e, 0x0b, 0xff, - 0xcd, 0xdd, 0xc6, 0x09, 0x15, 0x49, 0xb7, 0x75, 0xcb, 0x3e, 0xad, 0x1f, 0xdf, 0x3b, 0xb8, 0xcc, - 0xb7, 0xcf, 0x42, 0x73, 0x31, 0x3b, 0x82, 0xcb, 0xd7, 0x6b, 0xce, 0xa7, 0x9a, 0x75, 0x9f, 0xae, - 0x42, 0x29, 0x4f, 0xea, 0xa8, 0x68, 0x4c, 0x32, 0xa2, 0x4c, 0x24, 0xc4, 0x64, 0xd2, 0x7b, 0x75, - 0xb1, 0x70, 0xd0, 0xe5, 0xc2, 0x41, 0x7f, 0x16, 0x0e, 0xfa, 0xb2, 0x74, 0x2a, 0x97, 0x4b, 0xa7, - 0xf2, 0x73, 0xe9, 0x54, 0x3e, 0x3c, 0x89, 0xb9, 0x1e, 0x4d, 0x07, 0x5e, 0x08, 0x82, 0xdc, 0x78, - 0xc1, 0x9d, 0x9b, 0x6f, 0x7d, 0x50, 0x2d, 0x22, 0x7b, 0xf1, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x8f, - 0xc6, 0xee, 0xa3, 0x0e, 0x03, 0x00, 0x00, + 0x14, 0xc6, 0x73, 0x14, 0x2a, 0x7a, 0x55, 0x2a, 0xc5, 0x20, 0x48, 0x52, 0x61, 0x47, 0x01, 0xa4, + 0xa8, 0x52, 0x7c, 0x2a, 0x4c, 0x44, 0x62, 0x09, 0xe9, 0x86, 0x04, 0x4a, 0x2b, 0x06, 0x84, 0x64, + 0x5d, 0xec, 0x8b, 0x73, 0x8a, 0xef, 0x5e, 0xe4, 0x3b, 0x1b, 0x77, 0x67, 0x62, 0x62, 0xec, 0x58, + 0x89, 0x85, 0xb1, 0x03, 0x7f, 0x44, 0xc7, 0x8a, 0x09, 0x31, 0x04, 0x94, 0x0c, 0x65, 0xe6, 0x2f, + 0x40, 0xf6, 0x39, 0x69, 0x87, 0x2e, 0x96, 0xef, 0xbd, 0xdf, 0xdd, 0x7d, 0xdf, 0x7d, 0x0f, 0x77, + 0x94, 0x8e, 0xa9, 0x0c, 0x59, 0x04, 0x29, 0xf3, 0x52, 0x26, 0x75, 0x12, 0x33, 0x45, 0x66, 0x40, + 0x49, 0xba, 0x4f, 0x66, 0x34, 0xa6, 0x42, 0xb9, 0xb3, 0x18, 0x34, 0x58, 0xbb, 0x37, 0x91, 0xee, + 0x0c, 0xa8, 0x9b, 0xee, 0x37, 0xef, 0x87, 0x10, 0x42, 0xc1, 0x91, 0xfc, 0xcf, 0x6c, 0x69, 0xd6, + 0xa8, 0xe0, 0x12, 0x48, 0xf1, 0x2d, 0x4b, 0x76, 0x08, 0x10, 0x46, 0x8c, 0x14, 0xab, 0x51, 0x32, + 0x26, 0x41, 0x12, 0x53, 0xcd, 0x41, 0x96, 0xfd, 0x86, 0x0f, 0x4a, 0x80, 0xf2, 0xcc, 0x59, 0x66, + 0x61, 0x5a, 0xed, 0x0f, 0x78, 0xf3, 0x6d, 0x21, 0xc8, 0x7a, 0x81, 0x1b, 0x34, 0x8a, 0xe0, 0xa3, + 0x97, 0xd2, 0x88, 0x07, 0x54, 0x43, 0xec, 0x29, 0x16, 0x8d, 0x3d, 0x96, 0x71, 0x5d, 0xbf, 0xd5, + 0x42, 0x9d, 0xbb, 0xc3, 0x07, 0x05, 0xf0, 0x6e, 0xd5, 0x3f, 0x64, 0xd1, 0xf8, 0x20, 0xe3, 0xba, + 0xf7, 0xf0, 0xe4, 0xd4, 0xa9, 0xfc, 0x3d, 0x75, 0xd0, 0xe7, 0xcb, 0xb3, 0x3d, 0x9c, 0xfb, 0x34, + 0x26, 0xdb, 0x5f, 0x37, 0x70, 0xf5, 0x50, 0xd3, 0x29, 0x97, 0x61, 0x79, 0xcb, 0x1b, 0xbc, 0x93, + 0xc8, 0x11, 0xc8, 0x80, 0xcb, 0xd0, 0xd3, 0x5c, 0xb0, 0x3a, 0x6a, 0xa1, 0xce, 0xf6, 0xb3, 0x86, + 0x6b, 0x3c, 0xb8, 0x2b, 0x0f, 0xee, 0xa0, 0xf4, 0xd0, 0xaf, 0x9e, 0xcf, 0x9d, 0xca, 0xc9, 0x6f, + 0x07, 0x7d, 0xbb, 0x3c, 0xdb, 0x43, 0xc3, 0xea, 0x7a, 0xff, 0x11, 0x17, 0xcc, 0x7a, 0x8a, 0x77, + 0x04, 0xcd, 0xae, 0x44, 0xab, 0x42, 0x6b, 0x75, 0x58, 0x15, 0x34, 0x5b, 0x2b, 0x55, 0x96, 0x83, + 0xb7, 0x73, 0x8c, 0x49, 0x1d, 0x73, 0xa6, 0xea, 0x1b, 0x05, 0x83, 0x05, 0xcd, 0x0e, 0x4c, 0xc5, + 0xea, 0x62, 0x6b, 0xc2, 0x95, 0x86, 0x98, 0xfb, 0x34, 0x5a, 0x73, 0xb7, 0x0b, 0xae, 0x76, 0xd5, + 0x59, 0xe1, 0x8f, 0x30, 0xce, 0x55, 0x78, 0x01, 0x93, 0x20, 0xea, 0x77, 0x5a, 0xa8, 0xb3, 0x35, + 0xdc, 0xca, 0x2b, 0x83, 0xbc, 0x60, 0x7d, 0x42, 0xf8, 0x9e, 0xe0, 0xd2, 0xf3, 0x41, 0x08, 0xae, + 0x14, 0x07, 0xe9, 0xc5, 0x54, 0xb3, 0xfa, 0x66, 0x0e, 0xf6, 0x8f, 0x72, 0x47, 0xbf, 0xe6, 0xce, + 0xae, 0x89, 0x42, 0x05, 0x53, 0x97, 0x03, 0x11, 0x54, 0x4f, 0xdc, 0xd7, 0x2c, 0xa4, 0xfe, 0xf1, + 0x80, 0xf9, 0xff, 0xe6, 0x4e, 0xf3, 0x98, 0x8a, 0xa8, 0xd7, 0xbe, 0xe1, 0x9c, 0xf6, 0x8f, 0xef, + 0x5d, 0x5c, 0xe6, 0x38, 0x60, 0xbe, 0x79, 0x98, 0x9a, 0xe0, 0xf2, 0xd5, 0x9a, 0x1b, 0x52, 0xcd, + 0x7a, 0x4f, 0x56, 0xa1, 0x94, 0x37, 0x75, 0x55, 0x30, 0x25, 0x19, 0x51, 0x26, 0x12, 0x62, 0x32, + 0xe9, 0xbf, 0x3c, 0x5f, 0xd8, 0xe8, 0x62, 0x61, 0xa3, 0x3f, 0x0b, 0x1b, 0x7d, 0x59, 0xda, 0x95, + 0x8b, 0xa5, 0x5d, 0xf9, 0xb9, 0xb4, 0x2b, 0xef, 0x1f, 0x87, 0x5c, 0x4f, 0x92, 0x91, 0xeb, 0x83, + 0x20, 0xd7, 0x26, 0xb5, 0x7b, 0x7d, 0xa6, 0x47, 0x9b, 0x45, 0x64, 0xcf, 0xff, 0x07, 0x00, 0x00, + 0xff, 0xff, 0x6b, 0x29, 0x1c, 0x94, 0xf6, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -236,14 +226,6 @@ func (this *Params) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Admins) != len(that1.Admins) { - return false - } - for i := range this.Admins { - if this.Admins[i] != that1.Admins[i] { - return false - } - } if this.AllowValidatorSelfExit != that1.AllowValidatorSelfExit { return false } @@ -318,15 +300,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.Admins) > 0 { - for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Admins[iNdEx]) - copy(dAtA[i:], m.Admins[iNdEx]) - i = encodeVarintParams(dAtA, i, uint64(len(m.Admins[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -410,12 +383,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - if len(m.Admins) > 0 { - for _, s := range m.Admins { - l = len(s) - n += 1 + l + sovParams(uint64(l)) - } - } if m.AllowValidatorSelfExit { n += 2 } @@ -483,38 +450,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowValidatorSelfExit", wireType) diff --git a/proto/strangelove_ventures/poa/v1/params.proto b/proto/strangelove_ventures/poa/v1/params.proto index da49019..fd9a0af 100644 --- a/proto/strangelove_ventures/poa/v1/params.proto +++ b/proto/strangelove_ventures/poa/v1/params.proto @@ -15,7 +15,8 @@ message Params { option (gogoproto.goproto_stringer) = false; // Array of addresses that are allowed to control the chains validators power. - repeated string admins = 1; + // deprecated: set with the authority in the keeper instead + // repeated string admins = 1; // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. bool allow_validator_self_exit = 2; From 32635d8e00349d892a5b2d3ba935bbe7d5e9cd0f Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 16 Jul 2024 20:21:22 -0500 Subject: [PATCH 03/19] fix: re-add old param even though it is removed --- api/v1/params.pulsar.go | 234 ++++++++++++++---- params.go | 6 + params.pb.go | 132 +++++++--- .../strangelove_ventures/poa/v1/params.proto | 4 +- 4 files changed, 292 insertions(+), 84 deletions(-) diff --git a/api/v1/params.pulsar.go b/api/v1/params.pulsar.go index 7aa23b5..6162c9c 100644 --- a/api/v1/params.pulsar.go +++ b/api/v1/params.pulsar.go @@ -16,14 +16,62 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]string +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field Admins as it is not of Message kind")) +} + +func (x *_Params_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + var ( md_Params protoreflect.MessageDescriptor + fd_Params_admins protoreflect.FieldDescriptor fd_Params_allow_validator_self_exit protoreflect.FieldDescriptor ) func init() { file_strangelove_ventures_poa_v1_params_proto_init() md_Params = File_strangelove_ventures_poa_v1_params_proto.Messages().ByName("Params") + fd_Params_admins = md_Params.Fields().ByName("admins") fd_Params_allow_validator_self_exit = md_Params.Fields().ByName("allow_validator_self_exit") } @@ -92,6 +140,12 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Admins) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.Admins}) + if !f(fd_Params_admins, value) { + return + } + } if x.AllowValidatorSelfExit != false { value := protoreflect.ValueOfBool(x.AllowValidatorSelfExit) if !f(fd_Params_allow_validator_self_exit, value) { @@ -113,6 +167,8 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "strangelove_ventures.poa.v1.Params.admins": + return len(x.Admins) != 0 case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": return x.AllowValidatorSelfExit != false default: @@ -131,6 +187,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "strangelove_ventures.poa.v1.Params.admins": + x.Admins = nil case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": x.AllowValidatorSelfExit = false default: @@ -149,6 +207,12 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "strangelove_ventures.poa.v1.Params.admins": + if len(x.Admins) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.Admins} + return protoreflect.ValueOfList(listValue) case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": value := x.AllowValidatorSelfExit return protoreflect.ValueOfBool(value) @@ -172,6 +236,10 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "strangelove_ventures.poa.v1.Params.admins": + lv := value.List() + clv := lv.(*_Params_1_list) + x.Admins = *clv.list case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": x.AllowValidatorSelfExit = value.Bool() default: @@ -194,6 +262,12 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "strangelove_ventures.poa.v1.Params.admins": + if x.Admins == nil { + x.Admins = []string{} + } + value := &_Params_1_list{list: &x.Admins} + return protoreflect.ValueOfList(value) case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": panic(fmt.Errorf("field allow_validator_self_exit of message strangelove_ventures.poa.v1.Params is not mutable")) default: @@ -209,6 +283,9 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "strangelove_ventures.poa.v1.Params.admins": + list := []string{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": return protoreflect.ValueOfBool(false) default: @@ -280,6 +357,12 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + if len(x.Admins) > 0 { + for _, s := range x.Admins { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.AllowValidatorSelfExit { n += 2 } @@ -322,6 +405,15 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x10 } + if len(x.Admins) > 0 { + for iNdEx := len(x.Admins) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Admins[iNdEx]) + copy(dAtA[i:], x.Admins[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admins[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -371,6 +463,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Admins = append(x.Admins, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowValidatorSelfExit", wireType) @@ -1152,6 +1276,9 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Array of addresses that are allowed to control the chains validators power. + // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. + Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. AllowValidatorSelfExit bool `protobuf:"varint,2,opt,name=allow_validator_self_exit,json=allowValidatorSelfExit,proto3" json:"allow_validator_self_exit,omitempty"` } @@ -1176,6 +1303,13 @@ func (*Params) Descriptor() ([]byte, []int) { return file_strangelove_ventures_poa_v1_params_proto_rawDescGZIP(), []int{0} } +func (x *Params) GetAdmins() []string { + if x != nil { + return x.Admins + } + return nil +} + func (x *Params) GetAllowValidatorSelfExit() bool { if x != nil { return x.AllowValidatorSelfExit @@ -1280,56 +1414,58 @@ var file_strangelove_ventures_poa_v1_params_proto_rawDesc = []byte{ 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x65, 0x78, - 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x6c, 0x66, 0x45, 0x78, 0x69, 0x74, - 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x70, - 0x6f, 0x61, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xa3, 0x03, 0x0a, 0x0d, 0x53, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, - 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, - 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, - 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x12, 0x39, 0x0a, + 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x53, 0x65, 0x6c, 0x66, 0x45, 0x78, 0x69, 0x74, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, + 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x70, 0x6f, 0x61, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x22, 0xa3, 0x03, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, + 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, + 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, + 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, - 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, - 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0x83, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, - 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, - 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, - 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, - 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, + 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, + 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, + 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x83, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, + 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, + 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, + 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, + 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/params.go b/params.go index 3d9ccab..1215852 100644 --- a/params.go +++ b/params.go @@ -2,6 +2,7 @@ package poa import ( "encoding/json" + fmt "fmt" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -9,6 +10,7 @@ import ( // DefaultParams returns default module parameters. func DefaultParams() Params { return Params{ + Admins: []string(nil), // uses the authority as admin only now AllowValidatorSelfExit: true, } } @@ -48,5 +50,9 @@ func (p Params) String() string { // Validate does the sanity check on the params. func (p Params) Validate() error { + if len(p.Admins) != 0 { + return fmt.Errorf("DEPERECATED: admins must be empty as only the keeper authority is used") + } + return nil } diff --git a/params.pb.go b/params.pb.go index 18ff519..e842df5 100644 --- a/params.pb.go +++ b/params.pb.go @@ -32,6 +32,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { + // Array of addresses that are allowed to control the chains validators power. + // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. + Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. AllowValidatorSelfExit bool `protobuf:"varint,2,opt,name=allow_validator_self_exit,json=allowValidatorSelfExit,proto3" json:"allow_validator_self_exit,omitempty"` } @@ -68,6 +71,13 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +func (m *Params) GetAdmins() []string { + if m != nil { + return m.Admins + } + return nil +} + func (m *Params) GetAllowValidatorSelfExit() bool { if m != nil { return m.AllowValidatorSelfExit @@ -171,40 +181,41 @@ func init() { } var fileDescriptor_b1333a19bedb70c3 = []byte{ - // 522 bytes of a gzipped FileDescriptorProto + // 535 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x6f, 0xd3, 0x40, - 0x14, 0xc6, 0x73, 0x14, 0x2a, 0x7a, 0x55, 0x2a, 0xc5, 0x20, 0x48, 0x52, 0x61, 0x47, 0x01, 0xa4, - 0xa8, 0x52, 0x7c, 0x2a, 0x4c, 0x44, 0x62, 0x09, 0xe9, 0x86, 0x04, 0x4a, 0x2b, 0x06, 0x84, 0x64, - 0x5d, 0xec, 0x8b, 0x73, 0x8a, 0xef, 0x5e, 0xe4, 0x3b, 0x1b, 0x77, 0x67, 0x62, 0x62, 0xec, 0x58, - 0x89, 0x85, 0xb1, 0x03, 0x7f, 0x44, 0xc7, 0x8a, 0x09, 0x31, 0x04, 0x94, 0x0c, 0x65, 0xe6, 0x2f, - 0x40, 0xf6, 0x39, 0x69, 0x87, 0x2e, 0x96, 0xef, 0xbd, 0xdf, 0xdd, 0x7d, 0xdf, 0x7d, 0x0f, 0x77, - 0x94, 0x8e, 0xa9, 0x0c, 0x59, 0x04, 0x29, 0xf3, 0x52, 0x26, 0x75, 0x12, 0x33, 0x45, 0x66, 0x40, - 0x49, 0xba, 0x4f, 0x66, 0x34, 0xa6, 0x42, 0xb9, 0xb3, 0x18, 0x34, 0x58, 0xbb, 0x37, 0x91, 0xee, - 0x0c, 0xa8, 0x9b, 0xee, 0x37, 0xef, 0x87, 0x10, 0x42, 0xc1, 0x91, 0xfc, 0xcf, 0x6c, 0x69, 0xd6, - 0xa8, 0xe0, 0x12, 0x48, 0xf1, 0x2d, 0x4b, 0x76, 0x08, 0x10, 0x46, 0x8c, 0x14, 0xab, 0x51, 0x32, - 0x26, 0x41, 0x12, 0x53, 0xcd, 0x41, 0x96, 0xfd, 0x86, 0x0f, 0x4a, 0x80, 0xf2, 0xcc, 0x59, 0x66, - 0x61, 0x5a, 0xed, 0x0f, 0x78, 0xf3, 0x6d, 0x21, 0xc8, 0x7a, 0x81, 0x1b, 0x34, 0x8a, 0xe0, 0xa3, - 0x97, 0xd2, 0x88, 0x07, 0x54, 0x43, 0xec, 0x29, 0x16, 0x8d, 0x3d, 0x96, 0x71, 0x5d, 0xbf, 0xd5, - 0x42, 0x9d, 0xbb, 0xc3, 0x07, 0x05, 0xf0, 0x6e, 0xd5, 0x3f, 0x64, 0xd1, 0xf8, 0x20, 0xe3, 0xba, - 0xf7, 0xf0, 0xe4, 0xd4, 0xa9, 0xfc, 0x3d, 0x75, 0xd0, 0xe7, 0xcb, 0xb3, 0x3d, 0x9c, 0xfb, 0x34, - 0x26, 0xdb, 0x5f, 0x37, 0x70, 0xf5, 0x50, 0xd3, 0x29, 0x97, 0x61, 0x79, 0xcb, 0x1b, 0xbc, 0x93, - 0xc8, 0x11, 0xc8, 0x80, 0xcb, 0xd0, 0xd3, 0x5c, 0xb0, 0x3a, 0x6a, 0xa1, 0xce, 0xf6, 0xb3, 0x86, - 0x6b, 0x3c, 0xb8, 0x2b, 0x0f, 0xee, 0xa0, 0xf4, 0xd0, 0xaf, 0x9e, 0xcf, 0x9d, 0xca, 0xc9, 0x6f, - 0x07, 0x7d, 0xbb, 0x3c, 0xdb, 0x43, 0xc3, 0xea, 0x7a, 0xff, 0x11, 0x17, 0xcc, 0x7a, 0x8a, 0x77, - 0x04, 0xcd, 0xae, 0x44, 0xab, 0x42, 0x6b, 0x75, 0x58, 0x15, 0x34, 0x5b, 0x2b, 0x55, 0x96, 0x83, - 0xb7, 0x73, 0x8c, 0x49, 0x1d, 0x73, 0xa6, 0xea, 0x1b, 0x05, 0x83, 0x05, 0xcd, 0x0e, 0x4c, 0xc5, - 0xea, 0x62, 0x6b, 0xc2, 0x95, 0x86, 0x98, 0xfb, 0x34, 0x5a, 0x73, 0xb7, 0x0b, 0xae, 0x76, 0xd5, - 0x59, 0xe1, 0x8f, 0x30, 0xce, 0x55, 0x78, 0x01, 0x93, 0x20, 0xea, 0x77, 0x5a, 0xa8, 0xb3, 0x35, - 0xdc, 0xca, 0x2b, 0x83, 0xbc, 0x60, 0x7d, 0x42, 0xf8, 0x9e, 0xe0, 0xd2, 0xf3, 0x41, 0x08, 0xae, - 0x14, 0x07, 0xe9, 0xc5, 0x54, 0xb3, 0xfa, 0x66, 0x0e, 0xf6, 0x8f, 0x72, 0x47, 0xbf, 0xe6, 0xce, - 0xae, 0x89, 0x42, 0x05, 0x53, 0x97, 0x03, 0x11, 0x54, 0x4f, 0xdc, 0xd7, 0x2c, 0xa4, 0xfe, 0xf1, - 0x80, 0xf9, 0xff, 0xe6, 0x4e, 0xf3, 0x98, 0x8a, 0xa8, 0xd7, 0xbe, 0xe1, 0x9c, 0xf6, 0x8f, 0xef, - 0x5d, 0x5c, 0xe6, 0x38, 0x60, 0xbe, 0x79, 0x98, 0x9a, 0xe0, 0xf2, 0xd5, 0x9a, 0x1b, 0x52, 0xcd, - 0x7a, 0x4f, 0x56, 0xa1, 0x94, 0x37, 0x75, 0x55, 0x30, 0x25, 0x19, 0x51, 0x26, 0x12, 0x62, 0x32, - 0xe9, 0xbf, 0x3c, 0x5f, 0xd8, 0xe8, 0x62, 0x61, 0xa3, 0x3f, 0x0b, 0x1b, 0x7d, 0x59, 0xda, 0x95, - 0x8b, 0xa5, 0x5d, 0xf9, 0xb9, 0xb4, 0x2b, 0xef, 0x1f, 0x87, 0x5c, 0x4f, 0x92, 0x91, 0xeb, 0x83, - 0x20, 0xd7, 0x26, 0xb5, 0x7b, 0x7d, 0xa6, 0x47, 0x9b, 0x45, 0x64, 0xcf, 0xff, 0x07, 0x00, 0x00, - 0xff, 0xff, 0x6b, 0x29, 0x1c, 0x94, 0xf6, 0x02, 0x00, 0x00, + 0x14, 0xc6, 0x73, 0x14, 0x22, 0x7a, 0x55, 0x2a, 0xd5, 0xa0, 0xe2, 0xa4, 0xc2, 0x8e, 0x02, 0x48, + 0x51, 0xa5, 0xf8, 0x54, 0x98, 0x88, 0xc4, 0x12, 0xd2, 0x0d, 0x09, 0xe4, 0x56, 0x0c, 0x2c, 0xd6, + 0xc5, 0xbe, 0x38, 0xa7, 0xf8, 0xee, 0x45, 0xbe, 0x4b, 0x70, 0x77, 0x26, 0x26, 0xc6, 0x8e, 0x95, + 0x58, 0x18, 0x3b, 0xf0, 0x47, 0x74, 0xac, 0x98, 0x10, 0x43, 0x40, 0xc9, 0x50, 0x66, 0xfe, 0x02, + 0x64, 0x9f, 0x93, 0x76, 0xe8, 0x62, 0xf9, 0xbd, 0xf7, 0xbb, 0xbb, 0xef, 0xbb, 0xef, 0x70, 0x5b, + 0xe9, 0x94, 0xca, 0x98, 0x25, 0x30, 0x63, 0xc1, 0x8c, 0x49, 0x3d, 0x4d, 0x99, 0x22, 0x13, 0xa0, + 0x64, 0x76, 0x40, 0x26, 0x34, 0xa5, 0x42, 0x79, 0x93, 0x14, 0x34, 0x58, 0x7b, 0xb7, 0x91, 0xde, + 0x04, 0xa8, 0x37, 0x3b, 0x68, 0x3c, 0x8c, 0x21, 0x86, 0x82, 0x23, 0xf9, 0x9f, 0x59, 0xd2, 0xd8, + 0xa1, 0x82, 0x4b, 0x20, 0xc5, 0xb7, 0x6c, 0x39, 0x31, 0x40, 0x9c, 0x30, 0x52, 0x54, 0x83, 0xe9, + 0x90, 0x44, 0xd3, 0x94, 0x6a, 0x0e, 0xb2, 0x9c, 0xd7, 0x43, 0x50, 0x02, 0x54, 0x60, 0xf6, 0x32, + 0x85, 0x19, 0xb5, 0x34, 0xae, 0xbe, 0x2b, 0x04, 0x59, 0xbb, 0xb8, 0x4a, 0x23, 0xc1, 0xa5, 0xb2, + 0x51, 0x73, 0xa3, 0xbd, 0xe9, 0x97, 0x95, 0xf5, 0x12, 0xd7, 0x69, 0x92, 0xc0, 0xc7, 0x60, 0x46, + 0x13, 0x1e, 0x51, 0x0d, 0x69, 0xa0, 0x58, 0x32, 0x0c, 0x58, 0xc6, 0xb5, 0x7d, 0xa7, 0x89, 0xda, + 0xf7, 0xfd, 0xdd, 0x02, 0x78, 0xbf, 0x9a, 0x1f, 0xb1, 0x64, 0x78, 0x98, 0x71, 0xdd, 0x7d, 0x74, + 0x7a, 0xe6, 0x56, 0xfe, 0x9e, 0xb9, 0xe8, 0xf3, 0xd5, 0xf9, 0x3e, 0xce, 0xfd, 0x1b, 0xf3, 0xad, + 0xaf, 0x1b, 0xb8, 0x76, 0xa4, 0xe9, 0x98, 0xcb, 0xb8, 0x3c, 0xfd, 0x2d, 0xde, 0x9e, 0xca, 0x01, + 0xc8, 0x88, 0xcb, 0x38, 0xd0, 0x5c, 0x30, 0x1b, 0x35, 0x51, 0x7b, 0xeb, 0x79, 0xdd, 0x33, 0xde, + 0xbc, 0x95, 0x37, 0xaf, 0x5f, 0x7a, 0xeb, 0xd5, 0x2e, 0xe6, 0x6e, 0xe5, 0xf4, 0xb7, 0x8b, 0xbe, + 0x5d, 0x9d, 0xef, 0x23, 0xbf, 0xb6, 0x5e, 0x7f, 0xcc, 0x05, 0xb3, 0x9e, 0xe1, 0x6d, 0x41, 0xb3, + 0x6b, 0xd1, 0xaa, 0xd0, 0x5a, 0xf3, 0x6b, 0x82, 0x66, 0x6b, 0xa5, 0xca, 0x72, 0xf1, 0x56, 0x8e, + 0x31, 0xa9, 0x53, 0xce, 0x94, 0xbd, 0x51, 0x30, 0x58, 0xd0, 0xec, 0xd0, 0x74, 0xac, 0x0e, 0xb6, + 0x46, 0x5c, 0x69, 0x48, 0x79, 0x48, 0x93, 0x35, 0x77, 0xb7, 0xe0, 0x76, 0xae, 0x27, 0x2b, 0xfc, + 0x31, 0xc6, 0xb9, 0x8a, 0x20, 0x62, 0x12, 0x84, 0x7d, 0xaf, 0x89, 0xda, 0x9b, 0xfe, 0x66, 0xde, + 0xe9, 0xe7, 0x0d, 0xeb, 0x13, 0xc2, 0x0f, 0x04, 0x97, 0x41, 0x08, 0x42, 0x70, 0xa5, 0x38, 0xc8, + 0x20, 0xa5, 0x9a, 0xd9, 0xd5, 0x1c, 0xec, 0x1d, 0xe7, 0x8e, 0x7e, 0xcd, 0xdd, 0x3d, 0x13, 0x91, + 0x8a, 0xc6, 0x1e, 0x07, 0x22, 0xa8, 0x1e, 0x79, 0x6f, 0x58, 0x4c, 0xc3, 0x93, 0x3e, 0x0b, 0xff, + 0xcd, 0xdd, 0xc6, 0x09, 0x15, 0x49, 0xb7, 0x75, 0xcb, 0x3e, 0xad, 0x1f, 0xdf, 0x3b, 0xb8, 0xcc, + 0xb7, 0xcf, 0x42, 0x73, 0x31, 0x3b, 0x82, 0xcb, 0xd7, 0x6b, 0xce, 0xa7, 0x9a, 0x75, 0x9f, 0xae, + 0x42, 0x29, 0x4f, 0xea, 0xa8, 0x68, 0x4c, 0x32, 0xa2, 0x4c, 0x24, 0xc4, 0x64, 0xd2, 0x7b, 0x75, + 0xb1, 0x70, 0xd0, 0xe5, 0xc2, 0x41, 0x7f, 0x16, 0x0e, 0xfa, 0xb2, 0x74, 0x2a, 0x97, 0x4b, 0xa7, + 0xf2, 0x73, 0xe9, 0x54, 0x3e, 0x3c, 0x89, 0xb9, 0x1e, 0x4d, 0x07, 0x5e, 0x08, 0x82, 0xdc, 0x78, + 0xc1, 0x9d, 0x9b, 0x6f, 0x7d, 0x50, 0x2d, 0x22, 0x7b, 0xf1, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x8f, + 0xc6, 0xee, 0xa3, 0x0e, 0x03, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -226,6 +237,14 @@ func (this *Params) Equal(that interface{}) bool { } else if this == nil { return false } + if len(this.Admins) != len(that1.Admins) { + return false + } + for i := range this.Admins { + if this.Admins[i] != that1.Admins[i] { + return false + } + } if this.AllowValidatorSelfExit != that1.AllowValidatorSelfExit { return false } @@ -300,6 +319,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } + if len(m.Admins) > 0 { + for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Admins[iNdEx]) + copy(dAtA[i:], m.Admins[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.Admins[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } @@ -383,6 +411,12 @@ func (m *Params) Size() (n int) { } var l int _ = l + if len(m.Admins) > 0 { + for _, s := range m.Admins { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } if m.AllowValidatorSelfExit { n += 2 } @@ -450,6 +484,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowValidatorSelfExit", wireType) diff --git a/proto/strangelove_ventures/poa/v1/params.proto b/proto/strangelove_ventures/poa/v1/params.proto index fd9a0af..22d1859 100644 --- a/proto/strangelove_ventures/poa/v1/params.proto +++ b/proto/strangelove_ventures/poa/v1/params.proto @@ -15,8 +15,8 @@ message Params { option (gogoproto.goproto_stringer) = false; // Array of addresses that are allowed to control the chains validators power. - // deprecated: set with the authority in the keeper instead - // repeated string admins = 1; + // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. + repeated string admins = 1; // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. bool allow_validator_self_exit = 2; From 98474be89a6198ef213dd87c5f4422153d3b3b18 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 16 Jul 2024 20:43:54 -0500 Subject: [PATCH 04/19] refactor: remove params entirely --- api/v1/genesis.pulsar.go | 210 ++- api/v1/params.pulsar.go | 706 +-------- api/v1/query.pulsar.go | 1074 ++------------ api/v1/query_grpc.pb.go | 39 - api/v1/tx.pulsar.go | 1277 ++--------------- api/v1/tx_grpc.pb.go | 39 - client/cli/tx.go | 40 - codec.go | 2 - codec_test.go | 3 +- e2e/helpers/poa.go | 16 - e2e/poa_gov_test.go | 42 - errors.go | 2 - genesis.go | 6 +- genesis.pb.go | 67 +- go.work.sum | 42 + keeper/genesis.go | 14 +- keeper/genesis_test.go | 44 +- keeper/keeper.go | 2 - keeper/msg_server.go | 21 - keeper/msg_server_test.go | 64 - keeper/params.go | 26 - keeper/query_server.go | 10 - keeper/query_server_test.go | 33 - params.go | 39 - params.pb.go | 318 +--- .../strangelove_ventures/poa/v1/genesis.proto | 5 +- .../strangelove_ventures/poa/v1/params.proto | 20 +- proto/strangelove_ventures/poa/v1/query.proto | 13 - proto/strangelove_ventures/poa/v1/tx.proto | 20 - query.pb.go | 398 +---- query.pb.gw.go | 65 - tx.pb.go | 507 +------ 32 files changed, 657 insertions(+), 4507 deletions(-) delete mode 100644 keeper/params.go diff --git a/api/v1/genesis.pulsar.go b/api/v1/genesis.pulsar.go index 9ab715e..6f5fbb2 100644 --- a/api/v1/genesis.pulsar.go +++ b/api/v1/genesis.pulsar.go @@ -14,15 +14,66 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*Validator +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Validator) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Validator) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(Validator) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(Validator) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_vals protoreflect.FieldDescriptor ) func init() { file_strangelove_ventures_poa_v1_genesis_proto_init() md_GenesisState = File_strangelove_ventures_poa_v1_genesis_proto.Messages().ByName("GenesisState") - fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_vals = md_GenesisState.Fields().ByName("vals") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -90,9 +141,9 @@ func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_GenesisState_params, value) { + if len(x.Vals) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Vals}) + if !f(fd_GenesisState_vals, value) { return } } @@ -111,8 +162,8 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, // a repeated field is populated if it is non-empty. func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "strangelove_ventures.poa.v1.GenesisState.params": - return x.Params != nil + case "strangelove_ventures.poa.v1.GenesisState.vals": + return len(x.Vals) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.GenesisState")) @@ -129,8 +180,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "strangelove_ventures.poa.v1.GenesisState.params": - x.Params = nil + case "strangelove_ventures.poa.v1.GenesisState.vals": + x.Vals = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.GenesisState")) @@ -147,9 +198,12 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "strangelove_ventures.poa.v1.GenesisState.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "strangelove_ventures.poa.v1.GenesisState.vals": + if len(x.Vals) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.Vals} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.GenesisState")) @@ -170,8 +224,10 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "strangelove_ventures.poa.v1.GenesisState.params": - x.Params = value.Message().Interface().(*Params) + case "strangelove_ventures.poa.v1.GenesisState.vals": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.Vals = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.GenesisState")) @@ -192,11 +248,12 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "strangelove_ventures.poa.v1.GenesisState.params": - if x.Params == nil { - x.Params = new(Params) + case "strangelove_ventures.poa.v1.GenesisState.vals": + if x.Vals == nil { + x.Vals = []*Validator{} } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + value := &_GenesisState_2_list{list: &x.Vals} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.GenesisState")) @@ -210,9 +267,9 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "strangelove_ventures.poa.v1.GenesisState.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "strangelove_ventures.poa.v1.GenesisState.vals": + list := []*Validator{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.GenesisState")) @@ -282,9 +339,11 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Vals) > 0 { + for _, e := range x.Vals { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -315,19 +374,21 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.Vals) > 0 { + for iNdEx := len(x.Vals) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Vals[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -378,9 +439,9 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vals", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -407,10 +468,8 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + x.Vals = append(x.Vals, &Validator{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Vals[len(x.Vals)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -872,8 +931,7 @@ type GenesisState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Params defines all the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Vals []*Validator `protobuf:"bytes,2,rep,name=vals,proto3" json:"vals,omitempty"` } func (x *GenesisState) Reset() { @@ -896,9 +954,9 @@ func (*GenesisState) Descriptor() ([]byte, []int) { return file_strangelove_ventures_poa_v1_genesis_proto_rawDescGZIP(), []int{0} } -func (x *GenesisState) GetParams() *Params { +func (x *GenesisState) GetVals() []*Validator { if x != nil { - return x.Params + return x.Vals } return nil } @@ -956,33 +1014,33 @@ var file_strangelove_ventures_poa_v1_genesis_proto_rawDesc = []byte{ 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, - 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, - 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x41, - 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0x37, 0x0a, 0x0a, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, - 0x70, 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x13, 0x8a, 0xe7, 0xb0, 0x2a, 0x0e, 0x70, 0x6f, 0x61, 0x2f, - 0x50, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x42, 0x84, 0x02, 0x0a, 0x1f, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, - 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0c, - 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, - 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, - 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, - 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, - 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, - 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, + 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x40, + 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, + 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, + 0x22, 0x37, 0x0a, 0x0a, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x70, + 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x13, 0x8a, 0xe7, 0xb0, 0x2a, 0x0e, 0x70, 0x6f, 0x61, 0x2f, 0x50, + 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x42, 0x84, 0x02, 0x0a, 0x1f, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, + 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, + 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, + 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, + 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, + 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, + 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1001,10 +1059,10 @@ var file_strangelove_ventures_poa_v1_genesis_proto_msgTypes = make([]protoimpl.M var file_strangelove_ventures_poa_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: strangelove_ventures.poa.v1.GenesisState (*PowerCache)(nil), // 1: strangelove_ventures.poa.v1.PowerCache - (*Params)(nil), // 2: strangelove_ventures.poa.v1.Params + (*Validator)(nil), // 2: strangelove_ventures.poa.v1.Validator } var file_strangelove_ventures_poa_v1_genesis_proto_depIdxs = []int32{ - 2, // 0: strangelove_ventures.poa.v1.GenesisState.params:type_name -> strangelove_ventures.poa.v1.Params + 2, // 0: strangelove_ventures.poa.v1.GenesisState.vals:type_name -> strangelove_ventures.poa.v1.Validator 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/api/v1/params.pulsar.go b/api/v1/params.pulsar.go index 6162c9c..ee62d9c 100644 --- a/api/v1/params.pulsar.go +++ b/api/v1/params.pulsar.go @@ -16,540 +16,6 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_Params_1_list)(nil) - -type _Params_1_list struct { - list *[]string -} - -func (x *_Params_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Params_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Params_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Params_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Params_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Params at list field Admins as it is not of Message kind")) -} - -func (x *_Params_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Params_1_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Params_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Params protoreflect.MessageDescriptor - fd_Params_admins protoreflect.FieldDescriptor - fd_Params_allow_validator_self_exit protoreflect.FieldDescriptor -) - -func init() { - file_strangelove_ventures_poa_v1_params_proto_init() - md_Params = File_strangelove_ventures_poa_v1_params_proto.Messages().ByName("Params") - fd_Params_admins = md_Params.Fields().ByName("admins") - fd_Params_allow_validator_self_exit = md_Params.Fields().ByName("allow_validator_self_exit") -} - -var _ protoreflect.Message = (*fastReflection_Params)(nil) - -type fastReflection_Params Params - -func (x *Params) ProtoReflect() protoreflect.Message { - return (*fastReflection_Params)(x) -} - -func (x *Params) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_params_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Params_messageType fastReflection_Params_messageType -var _ protoreflect.MessageType = fastReflection_Params_messageType{} - -type fastReflection_Params_messageType struct{} - -func (x fastReflection_Params_messageType) Zero() protoreflect.Message { - return (*fastReflection_Params)(nil) -} -func (x fastReflection_Params_messageType) New() protoreflect.Message { - return new(fastReflection_Params) -} -func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Params -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { - return md_Params -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Params) Type() protoreflect.MessageType { - return _fastReflection_Params_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Params) New() protoreflect.Message { - return new(fastReflection_Params) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { - return (*Params)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Admins) != 0 { - value := protoreflect.ValueOfList(&_Params_1_list{list: &x.Admins}) - if !f(fd_Params_admins, value) { - return - } - } - if x.AllowValidatorSelfExit != false { - value := protoreflect.ValueOfBool(x.AllowValidatorSelfExit) - if !f(fd_Params_allow_validator_self_exit, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - return len(x.Admins) != 0 - case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": - return x.AllowValidatorSelfExit != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.Params")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.Params does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - x.Admins = nil - case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": - x.AllowValidatorSelfExit = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.Params")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.Params does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - if len(x.Admins) == 0 { - return protoreflect.ValueOfList(&_Params_1_list{}) - } - listValue := &_Params_1_list{list: &x.Admins} - return protoreflect.ValueOfList(listValue) - case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": - value := x.AllowValidatorSelfExit - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.Params")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.Params does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - lv := value.List() - clv := lv.(*_Params_1_list) - x.Admins = *clv.list - case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": - x.AllowValidatorSelfExit = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.Params")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.Params does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - if x.Admins == nil { - x.Admins = []string{} - } - value := &_Params_1_list{list: &x.Admins} - return protoreflect.ValueOfList(value) - case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": - panic(fmt.Errorf("field allow_validator_self_exit of message strangelove_ventures.poa.v1.Params is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.Params")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.Params does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.Params.admins": - list := []string{} - return protoreflect.ValueOfList(&_Params_1_list{list: &list}) - case "strangelove_ventures.poa.v1.Params.allow_validator_self_exit": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.Params")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.Params does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.poa.v1.Params", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Params) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Params) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Admins) > 0 { - for _, s := range x.Admins { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.AllowValidatorSelfExit { - n += 2 - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Params) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.AllowValidatorSelfExit { - i-- - if x.AllowValidatorSelfExit { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(x.Admins) > 0 { - for iNdEx := len(x.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Admins[iNdEx]) - copy(dAtA[i:], x.Admins[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admins[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Params) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Admins = append(x.Admins, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowValidatorSelfExit", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.AllowValidatorSelfExit = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_StakingParams protoreflect.MessageDescriptor fd_StakingParams_unbonding_time protoreflect.FieldDescriptor @@ -580,7 +46,7 @@ func (x *StakingParams) ProtoReflect() protoreflect.Message { } func (x *StakingParams) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_params_proto_msgTypes[1] + mi := &file_strangelove_ventures_poa_v1_params_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1270,53 +736,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Params defines the parameters for the module. -type Params struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Array of addresses that are allowed to control the chains validators power. - // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. - Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` - // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. - AllowValidatorSelfExit bool `protobuf:"varint,2,opt,name=allow_validator_self_exit,json=allowValidatorSelfExit,proto3" json:"allow_validator_self_exit,omitempty"` -} - -func (x *Params) Reset() { - *x = Params{} - if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_params_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Params) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Params) ProtoMessage() {} - -// Deprecated: Use Params.ProtoReflect.Descriptor instead. -func (*Params) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_params_proto_rawDescGZIP(), []int{0} -} - -func (x *Params) GetAdmins() []string { - if x != nil { - return x.Admins - } - return nil -} - -func (x *Params) GetAllowValidatorSelfExit() bool { - if x != nil { - return x.AllowValidatorSelfExit - } - return false -} - // StakingParams defines the parameters for the x/staking module. type StakingParams struct { state protoimpl.MessageState @@ -1342,7 +761,7 @@ type StakingParams struct { func (x *StakingParams) Reset() { *x = StakingParams{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_params_proto_msgTypes[1] + mi := &file_strangelove_ventures_poa_v1_params_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1356,7 +775,7 @@ func (*StakingParams) ProtoMessage() {} // Deprecated: Use StakingParams.ProtoReflect.Descriptor instead. func (*StakingParams) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_params_proto_rawDescGZIP(), []int{1} + return file_strangelove_ventures_poa_v1_params_proto_rawDescGZIP(), []int{0} } func (x *StakingParams) GetUnbondingTime() *durationpb.Duration { @@ -1414,58 +833,50 @@ var file_strangelove_ventures_poa_v1_params_proto_rawDesc = []byte{ 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x12, 0x39, 0x0a, - 0x19, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x53, 0x65, 0x6c, 0x66, 0x45, 0x78, 0x69, 0x74, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, - 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x70, 0x6f, 0x61, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0xa3, 0x03, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, - 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, - 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, - 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, - 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, - 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, - 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, - 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x83, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, - 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, - 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, - 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, - 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x03, 0x0a, 0x0d, + 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, + 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, + 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x72, 0x61, 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, + 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x83, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, + 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, + 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1480,14 +891,13 @@ func file_strangelove_ventures_poa_v1_params_proto_rawDescGZIP() []byte { return file_strangelove_ventures_poa_v1_params_proto_rawDescData } -var file_strangelove_ventures_poa_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_strangelove_ventures_poa_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_strangelove_ventures_poa_v1_params_proto_goTypes = []interface{}{ - (*Params)(nil), // 0: strangelove_ventures.poa.v1.Params - (*StakingParams)(nil), // 1: strangelove_ventures.poa.v1.StakingParams - (*durationpb.Duration)(nil), // 2: google.protobuf.Duration + (*StakingParams)(nil), // 0: strangelove_ventures.poa.v1.StakingParams + (*durationpb.Duration)(nil), // 1: google.protobuf.Duration } var file_strangelove_ventures_poa_v1_params_proto_depIdxs = []int32{ - 2, // 0: strangelove_ventures.poa.v1.StakingParams.unbonding_time:type_name -> google.protobuf.Duration + 1, // 0: strangelove_ventures.poa.v1.StakingParams.unbonding_time:type_name -> google.protobuf.Duration 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -1502,18 +912,6 @@ func file_strangelove_ventures_poa_v1_params_proto_init() { } if !protoimpl.UnsafeEnabled { file_strangelove_ventures_poa_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Params); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_strangelove_ventures_poa_v1_params_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StakingParams); i { case 0: return &v.state @@ -1532,7 +930,7 @@ func file_strangelove_ventures_poa_v1_params_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_strangelove_ventures_poa_v1_params_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 1, NumExtensions: 0, NumServices: 0, }, diff --git a/api/v1/query.pulsar.go b/api/v1/query.pulsar.go index acb5dab..928ec5a 100644 --- a/api/v1/query.pulsar.go +++ b/api/v1/query.pulsar.go @@ -14,797 +14,6 @@ import ( sync "sync" ) -var ( - md_QueryParamsRequest protoreflect.MessageDescriptor -) - -func init() { - file_strangelove_ventures_poa_v1_query_proto_init() - md_QueryParamsRequest = File_strangelove_ventures_poa_v1_query_proto.Messages().ByName("QueryParamsRequest") -} - -var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) - -type fastReflection_QueryParamsRequest QueryParamsRequest - -func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryParamsRequest)(x) -} - -func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} - -type fastReflection_QueryParamsRequest_messageType struct{} - -func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryParamsRequest)(nil) -} -func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryParamsRequest) -} -func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryParamsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { - return new(fastReflection_QueryParamsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryParamsRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.QueryParamsRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.QueryParamsRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.QueryParamsRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.QueryParamsRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.QueryParamsRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.poa.v1.QueryParamsRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryParamsRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryParamsRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryParamsRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryParamsRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_ParamsResponse protoreflect.MessageDescriptor - fd_ParamsResponse_params protoreflect.FieldDescriptor -) - -func init() { - file_strangelove_ventures_poa_v1_query_proto_init() - md_ParamsResponse = File_strangelove_ventures_poa_v1_query_proto.Messages().ByName("ParamsResponse") - fd_ParamsResponse_params = md_ParamsResponse.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_ParamsResponse)(nil) - -type fastReflection_ParamsResponse ParamsResponse - -func (x *ParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_ParamsResponse)(x) -} - -func (x *ParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ParamsResponse_messageType fastReflection_ParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_ParamsResponse_messageType{} - -type fastReflection_ParamsResponse_messageType struct{} - -func (x fastReflection_ParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_ParamsResponse)(nil) -} -func (x fastReflection_ParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_ParamsResponse) -} -func (x fastReflection_ParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_ParamsResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_ParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_ParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ParamsResponse) New() protoreflect.Message { - return new(fastReflection_ParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ParamsResponse) Interface() protoreflect.ProtoMessage { - return (*ParamsResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_ParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_ParamsResponse_params, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_ParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.ParamsResponse.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.ParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.ParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.ParamsResponse.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.ParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.ParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "strangelove_ventures.poa.v1.ParamsResponse.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.ParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.ParamsResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.ParamsResponse.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.ParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.ParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.ParamsResponse.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.ParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.ParamsResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_ParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.ParamsResponse.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.ParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.ParamsResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_ParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.poa.v1.ParamsResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_ParamsResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ParamsResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_ParamsResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_ParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ParamsResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ParamsResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ParamsResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_QueryPendingValidatorsRequest protoreflect.MessageDescriptor ) @@ -823,7 +32,7 @@ func (x *QueryPendingValidatorsRequest) ProtoReflect() protoreflect.Message { } func (x *QueryPendingValidatorsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[2] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1232,7 +441,7 @@ func (x *PendingValidatorsResponse) ProtoReflect() protoreflect.Message { } func (x *PendingValidatorsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[3] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1675,7 +884,7 @@ func (x *QueryConsensusPowerRequest) ProtoReflect() protoreflect.Message { } func (x *QueryConsensusPowerRequest) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[4] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2095,7 +1304,7 @@ func (x *QueryConsensusPowerResponse) ProtoReflect() protoreflect.Message { } func (x *QueryConsensusPowerResponse) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[5] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2492,70 +1701,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *QueryParamsRequest) Reset() { - *x = QueryParamsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryParamsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryParamsRequest) ProtoMessage() {} - -// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{0} -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -type ParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // params is the returned parameter from the module - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *ParamsResponse) Reset() { - *x = ParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParamsResponse) ProtoMessage() {} - -// Deprecated: Use ParamsResponse.ProtoReflect.Descriptor instead. -func (*ParamsResponse) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *ParamsResponse) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - // QueryPendingValidatorsRequest is the request type for the Query/PendingValidators RPC method. type QueryPendingValidatorsRequest struct { state protoimpl.MessageState @@ -2566,7 +1711,7 @@ type QueryPendingValidatorsRequest struct { func (x *QueryPendingValidatorsRequest) Reset() { *x = QueryPendingValidatorsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[2] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2580,7 +1725,7 @@ func (*QueryPendingValidatorsRequest) ProtoMessage() {} // Deprecated: Use QueryPendingValidatorsRequest.ProtoReflect.Descriptor instead. func (*QueryPendingValidatorsRequest) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{2} + return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{0} } // QueryPendingValidatorResponse is the response type for the Query/PendingValidators RPC method. @@ -2596,7 +1741,7 @@ type PendingValidatorsResponse struct { func (x *PendingValidatorsResponse) Reset() { *x = PendingValidatorsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[3] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2610,7 +1755,7 @@ func (*PendingValidatorsResponse) ProtoMessage() {} // Deprecated: Use PendingValidatorsResponse.ProtoReflect.Descriptor instead. func (*PendingValidatorsResponse) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{3} + return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{1} } func (x *PendingValidatorsResponse) GetPending() []*Validator { @@ -2633,7 +1778,7 @@ type QueryConsensusPowerRequest struct { func (x *QueryConsensusPowerRequest) Reset() { *x = QueryConsensusPowerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[4] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2647,7 +1792,7 @@ func (*QueryConsensusPowerRequest) ProtoMessage() {} // Deprecated: Use QueryConsensusPowerRequest.ProtoReflect.Descriptor instead. func (*QueryConsensusPowerRequest) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{4} + return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{2} } func (x *QueryConsensusPowerRequest) GetValidatorAddress() string { @@ -2670,7 +1815,7 @@ type QueryConsensusPowerResponse struct { func (x *QueryConsensusPowerResponse) Reset() { *x = QueryConsensusPowerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[5] + mi := &file_strangelove_ventures_poa_v1_query_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2684,7 +1829,7 @@ func (*QueryConsensusPowerResponse) ProtoMessage() {} // Deprecated: Use QueryConsensusPowerResponse.ProtoReflect.Descriptor instead. func (*QueryConsensusPowerResponse) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{5} + return file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP(), []int{3} } func (x *QueryConsensusPowerResponse) GetConsensusPower() int64 { @@ -2710,78 +1855,63 @@ var file_strangelove_ventures_poa_v1_query_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x1f, 0x0a, 0x1d, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x63, 0x0a, - 0x19, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x70, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x70, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x22, 0x49, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x46, 0x0a, - 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, - 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x50, 0x6f, 0x77, 0x65, 0x72, 0x32, 0xdc, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x7e, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x74, 0x72, + 0x6f, 0x22, 0x1f, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x63, 0x0a, 0x19, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x46, 0x0a, 0x07, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, + 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x49, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x46, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, + 0x6f, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x32, 0xdc, 0x02, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0xab, 0x01, 0x0a, 0x11, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x3a, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, - 0x0e, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0xab, 0x01, 0x0a, 0x11, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x3a, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, + 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x12, 0xa4, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, - 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x36, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1c, 0x12, 0x1a, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xa4, 0x01, - 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, - 0x12, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, - 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x73, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x70, 0x6f, - 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, - 0x6f, 0x77, 0x65, 0x72, 0x42, 0x82, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, - 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, - 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, - 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, - 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, + 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, + 0x12, 0x17, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x42, 0x82, 0x02, 0x0a, 0x1f, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, + 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, + 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, + 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2796,31 +1926,25 @@ func file_strangelove_ventures_poa_v1_query_proto_rawDescGZIP() []byte { return file_strangelove_ventures_poa_v1_query_proto_rawDescData } -var file_strangelove_ventures_poa_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_strangelove_ventures_poa_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_strangelove_ventures_poa_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: strangelove_ventures.poa.v1.QueryParamsRequest - (*ParamsResponse)(nil), // 1: strangelove_ventures.poa.v1.ParamsResponse - (*QueryPendingValidatorsRequest)(nil), // 2: strangelove_ventures.poa.v1.QueryPendingValidatorsRequest - (*PendingValidatorsResponse)(nil), // 3: strangelove_ventures.poa.v1.PendingValidatorsResponse - (*QueryConsensusPowerRequest)(nil), // 4: strangelove_ventures.poa.v1.QueryConsensusPowerRequest - (*QueryConsensusPowerResponse)(nil), // 5: strangelove_ventures.poa.v1.QueryConsensusPowerResponse - (*Params)(nil), // 6: strangelove_ventures.poa.v1.Params - (*Validator)(nil), // 7: strangelove_ventures.poa.v1.Validator + (*QueryPendingValidatorsRequest)(nil), // 0: strangelove_ventures.poa.v1.QueryPendingValidatorsRequest + (*PendingValidatorsResponse)(nil), // 1: strangelove_ventures.poa.v1.PendingValidatorsResponse + (*QueryConsensusPowerRequest)(nil), // 2: strangelove_ventures.poa.v1.QueryConsensusPowerRequest + (*QueryConsensusPowerResponse)(nil), // 3: strangelove_ventures.poa.v1.QueryConsensusPowerResponse + (*Validator)(nil), // 4: strangelove_ventures.poa.v1.Validator } var file_strangelove_ventures_poa_v1_query_proto_depIdxs = []int32{ - 6, // 0: strangelove_ventures.poa.v1.ParamsResponse.params:type_name -> strangelove_ventures.poa.v1.Params - 7, // 1: strangelove_ventures.poa.v1.PendingValidatorsResponse.pending:type_name -> strangelove_ventures.poa.v1.Validator - 0, // 2: strangelove_ventures.poa.v1.Query.Params:input_type -> strangelove_ventures.poa.v1.QueryParamsRequest - 2, // 3: strangelove_ventures.poa.v1.Query.PendingValidators:input_type -> strangelove_ventures.poa.v1.QueryPendingValidatorsRequest - 4, // 4: strangelove_ventures.poa.v1.Query.ConsensusPower:input_type -> strangelove_ventures.poa.v1.QueryConsensusPowerRequest - 1, // 5: strangelove_ventures.poa.v1.Query.Params:output_type -> strangelove_ventures.poa.v1.ParamsResponse - 3, // 6: strangelove_ventures.poa.v1.Query.PendingValidators:output_type -> strangelove_ventures.poa.v1.PendingValidatorsResponse - 5, // 7: strangelove_ventures.poa.v1.Query.ConsensusPower:output_type -> strangelove_ventures.poa.v1.QueryConsensusPowerResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 0: strangelove_ventures.poa.v1.PendingValidatorsResponse.pending:type_name -> strangelove_ventures.poa.v1.Validator + 0, // 1: strangelove_ventures.poa.v1.Query.PendingValidators:input_type -> strangelove_ventures.poa.v1.QueryPendingValidatorsRequest + 2, // 2: strangelove_ventures.poa.v1.Query.ConsensusPower:input_type -> strangelove_ventures.poa.v1.QueryConsensusPowerRequest + 1, // 3: strangelove_ventures.poa.v1.Query.PendingValidators:output_type -> strangelove_ventures.poa.v1.PendingValidatorsResponse + 3, // 4: strangelove_ventures.poa.v1.Query.ConsensusPower:output_type -> strangelove_ventures.poa.v1.QueryConsensusPowerResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_strangelove_ventures_poa_v1_query_proto_init() } @@ -2832,30 +1956,6 @@ func file_strangelove_ventures_poa_v1_query_proto_init() { file_strangelove_ventures_poa_v1_validator_proto_init() if !protoimpl.UnsafeEnabled { file_strangelove_ventures_poa_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryParamsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_strangelove_ventures_poa_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParamsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_strangelove_ventures_poa_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryPendingValidatorsRequest); i { case 0: return &v.state @@ -2867,7 +1967,7 @@ func file_strangelove_ventures_poa_v1_query_proto_init() { return nil } } - file_strangelove_ventures_poa_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_strangelove_ventures_poa_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PendingValidatorsResponse); i { case 0: return &v.state @@ -2879,7 +1979,7 @@ func file_strangelove_ventures_poa_v1_query_proto_init() { return nil } } - file_strangelove_ventures_poa_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_strangelove_ventures_poa_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryConsensusPowerRequest); i { case 0: return &v.state @@ -2891,7 +1991,7 @@ func file_strangelove_ventures_poa_v1_query_proto_init() { return nil } } - file_strangelove_ventures_poa_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_strangelove_ventures_poa_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryConsensusPowerResponse); i { case 0: return &v.state @@ -2910,7 +2010,7 @@ func file_strangelove_ventures_poa_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_strangelove_ventures_poa_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/v1/query_grpc.pb.go b/api/v1/query_grpc.pb.go index 53f3005..c148f43 100644 --- a/api/v1/query_grpc.pb.go +++ b/api/v1/query_grpc.pb.go @@ -19,7 +19,6 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/strangelove_ventures.poa.v1.Query/Params" Query_PendingValidators_FullMethodName = "/strangelove_ventures.poa.v1.Query/PendingValidators" Query_ConsensusPower_FullMethodName = "/strangelove_ventures.poa.v1.Query/ConsensusPower" ) @@ -28,8 +27,6 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type QueryClient interface { - // Params returns the current params of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) // PendingValidators returns currently pending validators of the module. PendingValidators(ctx context.Context, in *QueryPendingValidatorsRequest, opts ...grpc.CallOption) (*PendingValidatorsResponse, error) // ConsensusPower returns the current consensus power of a validator. @@ -44,15 +41,6 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { - out := new(ParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) PendingValidators(ctx context.Context, in *QueryPendingValidatorsRequest, opts ...grpc.CallOption) (*PendingValidatorsResponse, error) { out := new(PendingValidatorsResponse) err := c.cc.Invoke(ctx, Query_PendingValidators_FullMethodName, in, out, opts...) @@ -75,8 +63,6 @@ func (c *queryClient) ConsensusPower(ctx context.Context, in *QueryConsensusPowe // All implementations must embed UnimplementedQueryServer // for forward compatibility type QueryServer interface { - // Params returns the current params of the module. - Params(context.Context, *QueryParamsRequest) (*ParamsResponse, error) // PendingValidators returns currently pending validators of the module. PendingValidators(context.Context, *QueryPendingValidatorsRequest) (*PendingValidatorsResponse, error) // ConsensusPower returns the current consensus power of a validator. @@ -88,9 +74,6 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*ParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} func (UnimplementedQueryServer) PendingValidators(context.Context, *QueryPendingValidatorsRequest) (*PendingValidatorsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PendingValidators not implemented") } @@ -110,24 +93,6 @@ func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { s.RegisterService(&Query_ServiceDesc, srv) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_PendingValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryPendingValidatorsRequest) if err := dec(in); err != nil { @@ -171,10 +136,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ ServiceName: "strangelove_ventures.poa.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, { MethodName: "PendingValidators", Handler: _Query_PendingValidators_Handler, diff --git a/api/v1/tx.pulsar.go b/api/v1/tx.pulsar.go index c53ed39..5dadbda 100644 --- a/api/v1/tx.pulsar.go +++ b/api/v1/tx.pulsar.go @@ -2640,861 +2640,6 @@ func (x *fastReflection_MsgRemovePendingResponse) ProtoMethods() *protoiface.Met } } -var ( - md_MsgUpdateParams protoreflect.MessageDescriptor - fd_MsgUpdateParams_sender protoreflect.FieldDescriptor - fd_MsgUpdateParams_params protoreflect.FieldDescriptor -) - -func init() { - file_strangelove_ventures_poa_v1_tx_proto_init() - md_MsgUpdateParams = File_strangelove_ventures_poa_v1_tx_proto.Messages().ByName("MsgUpdateParams") - fd_MsgUpdateParams_sender = md_MsgUpdateParams.Fields().ByName("sender") - fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) - -type fastReflection_MsgUpdateParams MsgUpdateParams - -func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateParams)(x) -} - -func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} - -type fastReflection_MsgUpdateParams_messageType struct{} - -func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateParams)(nil) -} -func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParams) -} -func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Sender != "" { - value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgUpdateParams_sender, value) { - return - } - } - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgUpdateParams_params, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.MsgUpdateParams.sender": - return x.Sender != "" - case "strangelove_ventures.poa.v1.MsgUpdateParams.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.MsgUpdateParams.sender": - x.Sender = "" - case "strangelove_ventures.poa.v1.MsgUpdateParams.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "strangelove_ventures.poa.v1.MsgUpdateParams.sender": - value := x.Sender - return protoreflect.ValueOfString(value) - case "strangelove_ventures.poa.v1.MsgUpdateParams.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.MsgUpdateParams.sender": - x.Sender = value.Interface().(string) - case "strangelove_ventures.poa.v1.MsgUpdateParams.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.MsgUpdateParams.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "strangelove_ventures.poa.v1.MsgUpdateParams.sender": - panic(fmt.Errorf("field sender of message strangelove_ventures.poa.v1.MsgUpdateParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "strangelove_ventures.poa.v1.MsgUpdateParams.sender": - return protoreflect.ValueOfString("") - case "strangelove_ventures.poa.v1.MsgUpdateParams.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.poa.v1.MsgUpdateParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Sender) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Sender) > 0 { - i -= len(x.Sender) - copy(dAtA[i:], x.Sender) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdateParamsResponse protoreflect.MessageDescriptor -) - -func init() { - file_strangelove_ventures_poa_v1_tx_proto_init() - md_MsgUpdateParamsResponse = File_strangelove_ventures_poa_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) - -type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse - -func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateParamsResponse)(x) -} - -func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} - -type fastReflection_MsgUpdateParamsResponse_messageType struct{} - -func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateParamsResponse)(nil) -} -func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParamsResponse) -} -func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParamsResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateParamsResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message strangelove_ventures.poa.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.poa.v1.MsgUpdateParamsResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_MsgUpdateStakingParams protoreflect.MessageDescriptor fd_MsgUpdateStakingParams_sender protoreflect.FieldDescriptor @@ -3517,7 +2662,7 @@ func (x *MsgUpdateStakingParams) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateStakingParams) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[8] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4012,7 +3157,7 @@ func (x *MsgUpdateStakingParamsResponse) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateStakingParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[9] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4380,7 +3525,7 @@ func (x *MsgCreateValidator) ProtoReflect() protoreflect.Message { } func (x *MsgCreateValidator) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[10] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5153,7 +4298,7 @@ func (x *MsgCreateValidatorResponse) ProtoReflect() protoreflect.Message { } func (x *MsgCreateValidatorResponse) slowProtoReflect() protoreflect.Message { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[11] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5733,81 +4878,6 @@ func (*MsgRemovePendingResponse) Descriptor() ([]byte, []int) { return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{5} } -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // sender is the address of the admin account with permission to update. - // ex: governance, multisig/DAO, or standard account found in Params. - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // module parameters (all must be supplied). - Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *MsgUpdateParams) Reset() { - *x = MsgUpdateParams{} - if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateParams) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{6} -} - -func (x *MsgUpdateParams) GetSender() string { - if x != nil { - return x.Sender - } - return "" -} - -func (x *MsgUpdateParams) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateParamsResponse) Reset() { - *x = MsgUpdateParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateParamsResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{7} -} - // MsgUpdateStakingParams is the Msg/UpdateStakingParams request type. type MsgUpdateStakingParams struct { state protoimpl.MessageState @@ -5824,7 +4894,7 @@ type MsgUpdateStakingParams struct { func (x *MsgUpdateStakingParams) Reset() { *x = MsgUpdateStakingParams{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[8] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5838,7 +4908,7 @@ func (*MsgUpdateStakingParams) ProtoMessage() {} // Deprecated: Use MsgUpdateStakingParams.ProtoReflect.Descriptor instead. func (*MsgUpdateStakingParams) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{8} + return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{6} } func (x *MsgUpdateStakingParams) GetSender() string { @@ -5866,7 +4936,7 @@ type MsgUpdateStakingParamsResponse struct { func (x *MsgUpdateStakingParamsResponse) Reset() { *x = MsgUpdateStakingParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[9] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5880,7 +4950,7 @@ func (*MsgUpdateStakingParamsResponse) ProtoMessage() {} // Deprecated: Use MsgUpdateStakingParamsResponse.ProtoReflect.Descriptor instead. func (*MsgUpdateStakingParamsResponse) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{9} + return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{7} } // cosmos-sdk/proto/staking/v1beta1/tx.proto @@ -5906,7 +4976,7 @@ type MsgCreateValidator struct { func (x *MsgCreateValidator) Reset() { *x = MsgCreateValidator{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[10] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5920,7 +4990,7 @@ func (*MsgCreateValidator) ProtoMessage() {} // Deprecated: Use MsgCreateValidator.ProtoReflect.Descriptor instead. func (*MsgCreateValidator) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{10} + return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgCreateValidator) GetDescription() *Description { @@ -5976,7 +5046,7 @@ type MsgCreateValidatorResponse struct { func (x *MsgCreateValidatorResponse) Reset() { *x = MsgCreateValidatorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[11] + mi := &file_strangelove_ventures_poa_v1_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5990,7 +5060,7 @@ func (*MsgCreateValidatorResponse) ProtoMessage() {} // Deprecated: Use MsgCreateValidatorResponse.ProtoReflect.Descriptor instead. func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { - return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{11} + return file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP(), []int{9} } var File_strangelove_ventures_poa_v1_tx_proto protoreflect.FileDescriptor @@ -6058,134 +5128,115 @@ var file_strangelove_ventures_poa_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xab, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x23, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x13, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, - 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc0, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, - 0x2a, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, - 0x1a, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x20, 0x0a, 0x1e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc2, 0x04, - 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x12, 0x55, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x0a, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, - 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x1a, 0x18, 0x01, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x46, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, - 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x3a, 0x39, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, - 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x70, 0x6f, 0x61, 0x2f, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xe3, 0x05, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x7b, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x37, 0x2e, 0x73, + 0xc0, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, - 0x72, 0x12, 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x1a, 0x30, 0x2e, 0x73, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, - 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, - 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, - 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x1a, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x0d, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x73, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x1a, 0x35, 0x2e, 0x73, 0x74, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x2c, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, - 0x34, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x33, 0x2e, - 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x2a, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x1a, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x3b, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x6d, 0x73, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc2, 0x04, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x55, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, + 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, + 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x61, 0x74, 0x65, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x13, 0x6d, + 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, + 0x65, 0x6c, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, + 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0x18, 0x01, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, + 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x3a, 0x39, + 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, + 0xb0, 0x2a, 0x16, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xef, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, + 0x7b, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, - 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xff, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x1a, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, + 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x08, + 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, + 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, + 0x65, 0x72, 0x1a, 0x30, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, + 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, + 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x75, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x12, 0x2d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x1a, 0x35, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, + 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x33, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, + 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x3b, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xff, 0x01, 0x0a, 0x1f, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, + 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, + 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, - 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, + 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -6200,7 +5251,7 @@ func file_strangelove_ventures_poa_v1_tx_proto_rawDescGZIP() []byte { return file_strangelove_ventures_poa_v1_tx_proto_rawDescData } -var file_strangelove_ventures_poa_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_strangelove_ventures_poa_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_strangelove_ventures_poa_v1_tx_proto_goTypes = []interface{}{ (*MsgSetPower)(nil), // 0: strangelove_ventures.poa.v1.MsgSetPower (*MsgSetPowerResponse)(nil), // 1: strangelove_ventures.poa.v1.MsgSetPowerResponse @@ -6208,41 +5259,35 @@ var file_strangelove_ventures_poa_v1_tx_proto_goTypes = []interface{}{ (*MsgRemoveValidatorResponse)(nil), // 3: strangelove_ventures.poa.v1.MsgRemoveValidatorResponse (*MsgRemovePending)(nil), // 4: strangelove_ventures.poa.v1.MsgRemovePending (*MsgRemovePendingResponse)(nil), // 5: strangelove_ventures.poa.v1.MsgRemovePendingResponse - (*MsgUpdateParams)(nil), // 6: strangelove_ventures.poa.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 7: strangelove_ventures.poa.v1.MsgUpdateParamsResponse - (*MsgUpdateStakingParams)(nil), // 8: strangelove_ventures.poa.v1.MsgUpdateStakingParams - (*MsgUpdateStakingParamsResponse)(nil), // 9: strangelove_ventures.poa.v1.MsgUpdateStakingParamsResponse - (*MsgCreateValidator)(nil), // 10: strangelove_ventures.poa.v1.MsgCreateValidator - (*MsgCreateValidatorResponse)(nil), // 11: strangelove_ventures.poa.v1.MsgCreateValidatorResponse - (*Params)(nil), // 12: strangelove_ventures.poa.v1.Params - (*StakingParams)(nil), // 13: strangelove_ventures.poa.v1.StakingParams - (*Description)(nil), // 14: strangelove_ventures.poa.v1.Description - (*CommissionRates)(nil), // 15: strangelove_ventures.poa.v1.CommissionRates - (*anypb.Any)(nil), // 16: google.protobuf.Any + (*MsgUpdateStakingParams)(nil), // 6: strangelove_ventures.poa.v1.MsgUpdateStakingParams + (*MsgUpdateStakingParamsResponse)(nil), // 7: strangelove_ventures.poa.v1.MsgUpdateStakingParamsResponse + (*MsgCreateValidator)(nil), // 8: strangelove_ventures.poa.v1.MsgCreateValidator + (*MsgCreateValidatorResponse)(nil), // 9: strangelove_ventures.poa.v1.MsgCreateValidatorResponse + (*StakingParams)(nil), // 10: strangelove_ventures.poa.v1.StakingParams + (*Description)(nil), // 11: strangelove_ventures.poa.v1.Description + (*CommissionRates)(nil), // 12: strangelove_ventures.poa.v1.CommissionRates + (*anypb.Any)(nil), // 13: google.protobuf.Any } var file_strangelove_ventures_poa_v1_tx_proto_depIdxs = []int32{ - 12, // 0: strangelove_ventures.poa.v1.MsgUpdateParams.params:type_name -> strangelove_ventures.poa.v1.Params - 13, // 1: strangelove_ventures.poa.v1.MsgUpdateStakingParams.params:type_name -> strangelove_ventures.poa.v1.StakingParams - 14, // 2: strangelove_ventures.poa.v1.MsgCreateValidator.description:type_name -> strangelove_ventures.poa.v1.Description - 15, // 3: strangelove_ventures.poa.v1.MsgCreateValidator.commission:type_name -> strangelove_ventures.poa.v1.CommissionRates - 16, // 4: strangelove_ventures.poa.v1.MsgCreateValidator.pubkey:type_name -> google.protobuf.Any - 10, // 5: strangelove_ventures.poa.v1.Msg.CreateValidator:input_type -> strangelove_ventures.poa.v1.MsgCreateValidator - 0, // 6: strangelove_ventures.poa.v1.Msg.SetPower:input_type -> strangelove_ventures.poa.v1.MsgSetPower - 2, // 7: strangelove_ventures.poa.v1.Msg.RemoveValidator:input_type -> strangelove_ventures.poa.v1.MsgRemoveValidator - 4, // 8: strangelove_ventures.poa.v1.Msg.RemovePending:input_type -> strangelove_ventures.poa.v1.MsgRemovePending - 6, // 9: strangelove_ventures.poa.v1.Msg.UpdateParams:input_type -> strangelove_ventures.poa.v1.MsgUpdateParams - 8, // 10: strangelove_ventures.poa.v1.Msg.UpdateStakingParams:input_type -> strangelove_ventures.poa.v1.MsgUpdateStakingParams - 11, // 11: strangelove_ventures.poa.v1.Msg.CreateValidator:output_type -> strangelove_ventures.poa.v1.MsgCreateValidatorResponse - 1, // 12: strangelove_ventures.poa.v1.Msg.SetPower:output_type -> strangelove_ventures.poa.v1.MsgSetPowerResponse - 3, // 13: strangelove_ventures.poa.v1.Msg.RemoveValidator:output_type -> strangelove_ventures.poa.v1.MsgRemoveValidatorResponse - 5, // 14: strangelove_ventures.poa.v1.Msg.RemovePending:output_type -> strangelove_ventures.poa.v1.MsgRemovePendingResponse - 7, // 15: strangelove_ventures.poa.v1.Msg.UpdateParams:output_type -> strangelove_ventures.poa.v1.MsgUpdateParamsResponse - 9, // 16: strangelove_ventures.poa.v1.Msg.UpdateStakingParams:output_type -> strangelove_ventures.poa.v1.MsgUpdateStakingParamsResponse - 11, // [11:17] is the sub-list for method output_type - 5, // [5:11] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 10, // 0: strangelove_ventures.poa.v1.MsgUpdateStakingParams.params:type_name -> strangelove_ventures.poa.v1.StakingParams + 11, // 1: strangelove_ventures.poa.v1.MsgCreateValidator.description:type_name -> strangelove_ventures.poa.v1.Description + 12, // 2: strangelove_ventures.poa.v1.MsgCreateValidator.commission:type_name -> strangelove_ventures.poa.v1.CommissionRates + 13, // 3: strangelove_ventures.poa.v1.MsgCreateValidator.pubkey:type_name -> google.protobuf.Any + 8, // 4: strangelove_ventures.poa.v1.Msg.CreateValidator:input_type -> strangelove_ventures.poa.v1.MsgCreateValidator + 0, // 5: strangelove_ventures.poa.v1.Msg.SetPower:input_type -> strangelove_ventures.poa.v1.MsgSetPower + 2, // 6: strangelove_ventures.poa.v1.Msg.RemoveValidator:input_type -> strangelove_ventures.poa.v1.MsgRemoveValidator + 4, // 7: strangelove_ventures.poa.v1.Msg.RemovePending:input_type -> strangelove_ventures.poa.v1.MsgRemovePending + 6, // 8: strangelove_ventures.poa.v1.Msg.UpdateStakingParams:input_type -> strangelove_ventures.poa.v1.MsgUpdateStakingParams + 9, // 9: strangelove_ventures.poa.v1.Msg.CreateValidator:output_type -> strangelove_ventures.poa.v1.MsgCreateValidatorResponse + 1, // 10: strangelove_ventures.poa.v1.Msg.SetPower:output_type -> strangelove_ventures.poa.v1.MsgSetPowerResponse + 3, // 11: strangelove_ventures.poa.v1.Msg.RemoveValidator:output_type -> strangelove_ventures.poa.v1.MsgRemoveValidatorResponse + 5, // 12: strangelove_ventures.poa.v1.Msg.RemovePending:output_type -> strangelove_ventures.poa.v1.MsgRemovePendingResponse + 7, // 13: strangelove_ventures.poa.v1.Msg.UpdateStakingParams:output_type -> strangelove_ventures.poa.v1.MsgUpdateStakingParamsResponse + 9, // [9:14] is the sub-list for method output_type + 4, // [4:9] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_strangelove_ventures_poa_v1_tx_proto_init() } @@ -6326,30 +5371,6 @@ func file_strangelove_ventures_poa_v1_tx_proto_init() { } } file_strangelove_ventures_poa_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_strangelove_ventures_poa_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateParamsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_strangelove_ventures_poa_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateStakingParams); i { case 0: return &v.state @@ -6361,7 +5382,7 @@ func file_strangelove_ventures_poa_v1_tx_proto_init() { return nil } } - file_strangelove_ventures_poa_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_strangelove_ventures_poa_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateStakingParamsResponse); i { case 0: return &v.state @@ -6373,7 +5394,7 @@ func file_strangelove_ventures_poa_v1_tx_proto_init() { return nil } } - file_strangelove_ventures_poa_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_strangelove_ventures_poa_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgCreateValidator); i { case 0: return &v.state @@ -6385,7 +5406,7 @@ func file_strangelove_ventures_poa_v1_tx_proto_init() { return nil } } - file_strangelove_ventures_poa_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_strangelove_ventures_poa_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgCreateValidatorResponse); i { case 0: return &v.state @@ -6404,7 +5425,7 @@ func file_strangelove_ventures_poa_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_strangelove_ventures_poa_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/v1/tx_grpc.pb.go b/api/v1/tx_grpc.pb.go index d1e5c2f..0aa9b37 100644 --- a/api/v1/tx_grpc.pb.go +++ b/api/v1/tx_grpc.pb.go @@ -23,7 +23,6 @@ const ( Msg_SetPower_FullMethodName = "/strangelove_ventures.poa.v1.Msg/SetPower" Msg_RemoveValidator_FullMethodName = "/strangelove_ventures.poa.v1.Msg/RemoveValidator" Msg_RemovePending_FullMethodName = "/strangelove_ventures.poa.v1.Msg/RemovePending" - Msg_UpdateParams_FullMethodName = "/strangelove_ventures.poa.v1.Msg/UpdateParams" Msg_UpdateStakingParams_FullMethodName = "/strangelove_ventures.poa.v1.Msg/UpdateStakingParams" ) @@ -39,8 +38,6 @@ type MsgClient interface { RemoveValidator(ctx context.Context, in *MsgRemoveValidator, opts ...grpc.CallOption) (*MsgRemoveValidatorResponse, error) // RemovePending removes a pending validator from the queue. RemovePending(ctx context.Context, in *MsgRemovePending, opts ...grpc.CallOption) (*MsgRemovePendingResponse, error) - // UpdateParams updates the module parameters. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) // UpdateStakingParams updates the module parameters. UpdateStakingParams(ctx context.Context, in *MsgUpdateStakingParams, opts ...grpc.CallOption) (*MsgUpdateStakingParamsResponse, error) } @@ -89,15 +86,6 @@ func (c *msgClient) RemovePending(ctx context.Context, in *MsgRemovePending, opt return out, nil } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) UpdateStakingParams(ctx context.Context, in *MsgUpdateStakingParams, opts ...grpc.CallOption) (*MsgUpdateStakingParamsResponse, error) { out := new(MsgUpdateStakingParamsResponse) err := c.cc.Invoke(ctx, Msg_UpdateStakingParams_FullMethodName, in, out, opts...) @@ -119,8 +107,6 @@ type MsgServer interface { RemoveValidator(context.Context, *MsgRemoveValidator) (*MsgRemoveValidatorResponse, error) // RemovePending removes a pending validator from the queue. RemovePending(context.Context, *MsgRemovePending) (*MsgRemovePendingResponse, error) - // UpdateParams updates the module parameters. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) // UpdateStakingParams updates the module parameters. UpdateStakingParams(context.Context, *MsgUpdateStakingParams) (*MsgUpdateStakingParamsResponse, error) mustEmbedUnimplementedMsgServer() @@ -142,9 +128,6 @@ func (UnimplementedMsgServer) RemoveValidator(context.Context, *MsgRemoveValidat func (UnimplementedMsgServer) RemovePending(context.Context, *MsgRemovePending) (*MsgRemovePendingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemovePending not implemented") } -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} func (UnimplementedMsgServer) UpdateStakingParams(context.Context, *MsgUpdateStakingParams) (*MsgUpdateStakingParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateStakingParams not implemented") } @@ -233,24 +216,6 @@ func _Msg_RemovePending_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_UpdateStakingParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateStakingParams) if err := dec(in); err != nil { @@ -292,10 +257,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "RemovePending", Handler: _Msg_RemovePending_Handler, }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, { MethodName: "UpdateStakingParams", Handler: _Msg_UpdateStakingParams_Handler, diff --git a/client/cli/tx.go b/client/cli/tx.go index 0530548..1013523 100644 --- a/client/cli/tx.go +++ b/client/cli/tx.go @@ -42,7 +42,6 @@ func NewTxCmd(ac address.Codec) *cobra.Command { NewSetPowerCmd(ac), NewRemovePendingCmd(), NewRemoveValidatorCmd(), - NewUpdateParamsCmd(), NewUpdateStakingParamsCmd(), ) @@ -159,45 +158,6 @@ func NewRemovePendingCmd() *cobra.Command { return cmd } -func NewUpdateParamsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-params [allow-validator-self-exit-bool]", - Short: "update the PoA module params", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - allowGracefulExit, err := strconv.ParseBool(args[0]) - if err != nil { - return fmt.Errorf("strconv.ParseBool failed: %w", err) - } - - p, err := poa.NewParams(allowGracefulExit) - if err != nil { - return fmt.Errorf("NewParams failed: %w", err) - } - - msg := &poa.MsgUpdateParams{ - Sender: clientCtx.GetFromAddress().String(), - Params: p, - } - - if err := msg.Params.Validate(); err != nil { - return fmt.Errorf("msg.Params.Validate failed: %w", err) - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - func NewUpdateStakingParamsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "update-staking-params [unbondingTime] [maxVals] [maxEntries] [historicalEntries] [bondDenom] [minCommissionRate]", diff --git a/codec.go b/codec.go index 512869b..dd5c3b9 100644 --- a/codec.go +++ b/codec.go @@ -13,7 +13,6 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgSetPower{}, "poa/MsgSetPower") legacy.RegisterAminoMsg(cdc, &MsgCreateValidator{}, "poa/MsgCreateValidator") - legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "poa/MsgUpdateParams") legacy.RegisterAminoMsg(cdc, &MsgRemoveValidator{}, "poa/MsgRemoveValidator") legacy.RegisterAminoMsg(cdc, &MsgUpdateStakingParams{}, "poa/MsgUpdateStakingParams") } @@ -23,7 +22,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSetPower{}, &MsgCreateValidator{}, - &MsgUpdateParams{}, &MsgRemoveValidator{}, &MsgUpdateStakingParams{}, ) diff --git a/codec_test.go b/codec_test.go index f32d21a..b3fd270 100644 --- a/codec_test.go +++ b/codec_test.go @@ -19,11 +19,10 @@ func TestCodecRegisterInterfaces(t *testing.T) { impls := registry.ListImplementations(sdk.MsgInterfaceProtoName) - require.Len(t, impls, 6) + require.Len(t, impls, 5) require.ElementsMatch(t, []string{ prefix + "MsgSetPower", prefix + "MsgCreateValidator", - prefix + "MsgUpdateParams", prefix + "MsgRemoveValidator", prefix + "MsgRemovePending", prefix + "MsgUpdateStakingParams", diff --git a/e2e/helpers/poa.go b/e2e/helpers/poa.go index 8065372..2e0b5d0 100644 --- a/e2e/helpers/poa.go +++ b/e2e/helpers/poa.go @@ -82,12 +82,6 @@ func SubmitGovernanceProposalForValidatorChanges(t *testing.T, ctx context.Conte return txProp.ProposalID } -func GetPOAParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) poa.Params { - var res poa.ParamsResponse - ExecuteQuery(ctx, chain, []string{"query", "poa", "params"}, &res) - return res.Params -} - func GetPOAConsensusPower(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, valoperAddr string) int64 { var res POAConsensusPower ExecuteQuery(ctx, chain, []string{"query", "poa", "consensus-power", valoperAddr}, &res) @@ -105,16 +99,6 @@ func GetPOAPending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) return res } -func POAUpdateParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, gracefulExit bool) (sdk.TxResponse, error) { - gracefulParam := "true" - if !gracefulExit { - gracefulParam = "false" - } - - cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "update-params", gracefulParam}, user.KeyName()) - return ExecuteTransaction(ctx, chain, cmd) -} - func POAUpdateStakingParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, sp stakingtypes.Params) (sdk.TxResponse, error) { command := []string{"tx", "poa", "update-staking-params", sp.UnbondingTime.String(), diff --git a/e2e/poa_gov_test.go b/e2e/poa_gov_test.go index 4343e54..0fdd846 100644 --- a/e2e/poa_gov_test.go +++ b/e2e/poa_gov_test.go @@ -9,7 +9,6 @@ import ( "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" - "github.com/strangelove-ventures/poa" "github.com/strangelove-ventures/poa/e2e/helpers" "github.com/stretchr/testify/require" @@ -56,22 +55,6 @@ func TestPOAGovernance(t *testing.T) { func testGovernance(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0 ibc.Wallet, validators []string) { t.Log("\n===== TEST GOVERNANCE =====") - t.Run("success: gov proposal update params", func(t *testing.T) { - updatedParams := []cosmos.ProtoMessage{ - &poa.MsgUpdateParams{ - Sender: GovModuleAddress, - Params: poa.Params{ - AllowValidatorSelfExit: false, - }, - }, - } - - propId := helpers.SubmitParamChangeProp(t, ctx, chain, acc0, updatedParams, GovModuleAddress, 25) - helpers.ValidatorVote(t, ctx, chain, propId, cosmos.ProposalVoteYes, 30) - - require.True(t, helpers.GetPOAParams(t, ctx, chain).AllowValidatorSelfExit, "AllowValidatorSelfExit should be true") - }) - t.Run("success: gov proposal validator change", func(t *testing.T) { // ibc.ChainConfig key: app_state.poa.params.admins must contain the governance address. powerAmt := uint64(1_234_567) @@ -92,17 +75,6 @@ func testUpdatePOAParams(t *testing.T, ctx context.Context, chain *cosmos.Cosmos t.Log("\n===== TEST UPDATE POA PARAMS =====") - t.Run("fail: update-params message from a non authorized user", func(t *testing.T) { - tx, err = helpers.POAUpdateParams(t, ctx, chain, incorrectUser, true) - if err != nil { - t.Fatal(err) - } - txRes, err := chain.GetTransaction(tx.TxHash) - require.NoError(t, err) - fmt.Printf("%+v", txRes) - require.Contains(t, txRes.RawLog, poa.ErrNotAnAuthority.Error()) - }) - t.Run("fail: update staking params from a non authorized user", func(t *testing.T) { tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, incorrectUser, stakingtypes.DefaultParams()) if err != nil { @@ -141,18 +113,4 @@ func testUpdatePOAParams(t *testing.T, ctx context.Context, chain *cosmos.Cosmos require.EqualValues(t, sp.MaxValidators, 10) }) - t.Run("success: update-params message from an authorized user with cli.", func(t *testing.T) { - tx, err = helpers.POAUpdateParams(t, ctx, chain, acc0, true) - if err != nil { - t.Fatal(err) - } - txRes, err := chain.GetTransaction(tx.TxHash) - require.NoError(t, err) - fmt.Printf("%+v", txRes) - require.EqualValues(t, txRes.Code, 0) - - p := helpers.GetPOAParams(t, ctx, chain) - require.False(t, p.AllowValidatorSelfExit) // TODO: check this - }) - } diff --git a/errors.go b/errors.go index 3c4e2e8..f5b0ecf 100644 --- a/errors.go +++ b/errors.go @@ -9,6 +9,4 @@ var ( ErrPowerBelowMinimum = sdkerrors.Register(ModuleName, 2, "power must be above 1_000_000") ErrNotAnAuthority = sdkerrors.Register(ModuleName, 3, "not an authority") ErrUnsafePower = sdkerrors.Register(ModuleName, 4, "unsafe: msg.Power is >30%% of total power, set unsafe=true to override") - // ErrMustProvideAtLeastOneAddress = sdkerrors.Register(ModuleName, 5, "must provide at least one address") - ErrValidatorSelfRemoval = sdkerrors.Register(ModuleName, 6, "validator is not allowed to remove themselves") ) diff --git a/genesis.go b/genesis.go index 6d65cd1..735c4fa 100644 --- a/genesis.go +++ b/genesis.go @@ -2,12 +2,10 @@ package poa // NewGenesisState creates a new genesis state with default values. func NewGenesisState() *GenesisState { - return &GenesisState{ - Params: DefaultParams(), - } + return &GenesisState{} } // Validate performs basic genesis state validation returning an error upon any func (gs *GenesisState) Validate() error { - return gs.Params.Validate() + return nil } diff --git a/genesis.pb.go b/genesis.pb.go index 4a6dcd7..3eda7b9 100644 --- a/genesis.pb.go +++ b/genesis.pb.go @@ -26,8 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the poa module's genesis state. type GenesisState struct { - // Params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Vals []Validator `protobuf:"bytes,2,rep,name=vals,proto3" json:"vals"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -63,11 +62,11 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { +func (m *GenesisState) GetVals() []Validator { if m != nil { - return m.Params + return m.Vals } - return Params{} + return nil } // PowerCache is a cached block or absolute change in power for ibc-go validations. @@ -125,7 +124,7 @@ func init() { } var fileDescriptor_d9ebd7913aa01cfd = []byte{ - // 268 bytes of a gzipped FileDescriptorProto + // 273 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2c, 0x2e, 0x29, 0x4a, 0xcc, 0x4b, 0x4f, 0xcd, 0xc9, 0x2f, 0x4b, 0x8d, 0x2f, 0x4b, 0xcd, 0x2b, 0x29, 0x2d, 0x4a, 0x2d, 0xd6, 0x2f, 0xc8, 0x4f, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, @@ -133,16 +132,17 @@ var fileDescriptor_d9ebd7913aa01cfd = []byte{ 0x50, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xac, 0x4e, 0x1f, 0xc4, 0x82, 0x68, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x50, 0x21, 0x6d, 0x7c, 0x16, 0x96, 0x25, 0xe6, 0x64, 0xa6, 0x24, 0x96, 0xe4, 0x17, 0x41, 0x15, 0x6b, 0xe0, 0x53, 0x5c, 0x90, 0x58, 0x94, 0x98, 0x0b, - 0x75, 0x9c, 0x94, 0x0a, 0x3e, 0x95, 0x25, 0x15, 0x10, 0x55, 0x4a, 0x81, 0x5c, 0x3c, 0xee, 0x10, - 0x3f, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x39, 0x72, 0xb1, 0x41, 0x4c, 0x91, 0x60, 0x54, 0x60, - 0xd4, 0xe0, 0x36, 0x52, 0xd6, 0xc3, 0xe3, 0x47, 0xbd, 0x00, 0xb0, 0x52, 0x27, 0x96, 0x13, 0xf7, - 0xe4, 0x19, 0x82, 0xa0, 0x1a, 0x95, 0xcc, 0xb9, 0xb8, 0x02, 0xf2, 0xcb, 0x53, 0x8b, 0x9c, 0x13, - 0x93, 0x33, 0x52, 0x85, 0x44, 0xb8, 0x58, 0x0b, 0x40, 0x3c, 0xb0, 0x79, 0x2c, 0x41, 0x10, 0x8e, - 0x95, 0x70, 0xd7, 0xf3, 0x0d, 0x5a, 0x7c, 0x20, 0xc7, 0x20, 0x94, 0x3a, 0xd9, 0x9e, 0x78, 0x24, - 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, - 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x72, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, - 0x72, 0x7e, 0xae, 0x3e, 0x92, 0x7b, 0x74, 0x91, 0xbd, 0x95, 0xc4, 0x06, 0xf6, 0x91, 0x31, 0x20, - 0x00, 0x00, 0xff, 0xff, 0x8d, 0x5f, 0xf5, 0xc4, 0xc1, 0x01, 0x00, 0x00, + 0x75, 0x9c, 0x94, 0x0a, 0x3e, 0x95, 0x25, 0x15, 0x10, 0x55, 0x4a, 0x01, 0x5c, 0x3c, 0xee, 0x10, + 0x3f, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x39, 0x70, 0xb1, 0x94, 0x25, 0xe6, 0x14, 0x4b, 0x30, + 0x29, 0x30, 0x6b, 0x70, 0x1b, 0xa9, 0xe9, 0xe1, 0xf1, 0xa1, 0x5e, 0x18, 0xcc, 0x6d, 0x4e, 0x2c, + 0x27, 0xee, 0xc9, 0x33, 0x04, 0x81, 0x75, 0x2a, 0x99, 0x73, 0x71, 0x05, 0xe4, 0x97, 0xa7, 0x16, + 0x39, 0x27, 0x26, 0x67, 0xa4, 0x0a, 0x89, 0x70, 0xb1, 0x16, 0x80, 0x78, 0x12, 0x8c, 0x0a, 0x8c, + 0x1a, 0x2c, 0x41, 0x10, 0x8e, 0x95, 0x70, 0xd7, 0xf3, 0x0d, 0x5a, 0x7c, 0x20, 0xb7, 0x20, 0x94, + 0x3a, 0xd9, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, + 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x72, 0x7a, 0x66, + 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x92, 0x83, 0x74, 0x91, 0x7d, 0x95, 0xc4, + 0x06, 0xf6, 0x90, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x40, 0xb0, 0xf7, 0x94, 0xc0, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -165,16 +165,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Vals) > 0 { + for iNdEx := len(m.Vals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Vals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -223,8 +227,12 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) + if len(m.Vals) > 0 { + for _, e := range m.Vals { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -275,9 +283,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Vals", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -304,7 +312,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Vals = append(m.Vals, Validator{}) + if err := m.Vals[len(m.Vals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/go.work.sum b/go.work.sum index b0e47fc..08f76a9 100644 --- a/go.work.sum +++ b/go.work.sum @@ -2,9 +2,12 @@ 4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= 4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= 4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= +cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cloud.google.com/go v0.0.0-20170206221025-ce650573d812/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/accessapproval v1.7.4 h1:ZvLvJ952zK8pFHINjpMBY5k7LTAp/6pBf50RDMRgBUI= cloud.google.com/go/accessapproval v1.7.4/go.mod h1:/aTEh45LzplQgFYdQdwPMR9YdX0UlhBmvB84uAmQKUc= cloud.google.com/go/accessapproval v1.7.5/go.mod h1:g88i1ok5dvQ9XJsxpUInWWvUBrIZhyPDPbk4T01OoJ0= @@ -88,6 +91,9 @@ cloud.google.com/go/cloudtasks v1.12.4/go.mod h1:BEPu0Gtt2dU6FxZHNqqNdGqIG86qyWK cloud.google.com/go/cloudtasks v1.12.6/go.mod h1:b7c7fe4+TJsFZfDyzO51F7cjq7HLUlRi/KZQLQjDsaY= cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/contactcenterinsights v1.12.0 h1:wP41IUA4ucMVooj/TP53jd7vbNjWrDkAPOeulVJGT5U= cloud.google.com/go/contactcenterinsights v1.12.0/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= cloud.google.com/go/contactcenterinsights v1.12.1/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= @@ -335,6 +341,8 @@ cloud.google.com/go/speech v1.21.1/go.mod h1:E5GHZXYQlkqWQwY5xRSLHw2ci5NMQNG52Ff cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/storage v1.37.0 h1:WI8CsaFO8Q9KjPVtsZ5Cmi0dXV25zMoX0FklT7c3Jm4= cloud.google.com/go/storage v1.37.0/go.mod h1:i34TiT2IhiNDmcj65PqwCjcoUX7Z5pLzS8DEmoiFq1k= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= cloud.google.com/go/storagetransfer v1.10.3 h1:YM1dnj5gLjfL6aDldO2s4GeU8JoAvH1xyIwXre63KmI= cloud.google.com/go/storagetransfer v1.10.3/go.mod h1:Up8LY2p6X68SZ+WToswpQbQHnJpOty/ACcMafuey8gc= cloud.google.com/go/storagetransfer v1.10.4/go.mod h1:vef30rZKu5HSEf/x1tK3WfWrL0XVoUQN/EPDRGPzjZs= @@ -994,6 +1002,9 @@ github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw= github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.12.1/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720 h1:zC34cGQu69FG7qzJ3WiKW244WfhDC3xxYMeNOX2gtUQ= github.com/googleapis/google-cloud-go-testing v0.0.0-20210719221736-1c9a4c676720/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -1808,16 +1819,32 @@ go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E= go.etcd.io/gofail v0.1.0 h1:XItAMIhOojXFQMgrxjnd2EIIHun/d5qL0Pf7FzVTkFg= go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -1852,6 +1879,7 @@ golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72 golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= @@ -1957,6 +1985,10 @@ google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2Pr google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g= google.golang.org/api v0.160.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= +google.golang.org/api v0.164.0/go.mod h1:2OatzO7ZDQsoS7IFf3rvsE17/TldiU3F/zxFHeqUB5o= +google.golang.org/api v0.166.0/go.mod h1:4FcBc686KFi7QI/U51/2GKKevfZMpM17sCdibqe/bSA= +google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= +google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= @@ -1969,6 +2001,7 @@ google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0 google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto v0.0.0-20240205150955-31a09d347014/go.mod h1:xEgQu1e4stdSSsxPDK8Azkrk/ECl5HvdPf6nbZrTS5M= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= @@ -1984,10 +2017,13 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go. google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= +google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= google.golang.org/genproto/googleapis/bytestream v0.0.0-20231120223509-83a465c0220f h1:hL+1ptbhFoeL1HcROQ8OGXaqH0jYRRibgWQWco0/Ugc= google.golang.org/genproto/googleapis/bytestream v0.0.0-20231120223509-83a465c0220f/go.mod h1:iIgEblxoG4klcXsG0d9cpoxJ4xndv6+1FkDROCHhPRI= google.golang.org/genproto/googleapis/bytestream v0.0.0-20231212172506-995d672761c0/go.mod h1:guYXGPwC6jwxgWKW5Y405fKWOFNwlvUlUnzyp9i0uqo= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:SCz6T5xjNXM4QFPRwxHcfChp7V+9DcXR3ay2TkHR8Tg= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:vh/N7795ftP0AkN1w8XKqN4w1OdUKXW5Eummda+ofv8= google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= @@ -2004,7 +2040,10 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v0.0.0-20170208002647-2a6bf6142e96/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= @@ -2015,6 +2054,9 @@ google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/protobuf v1.28.2-0.20230222093303-bc1253ad3743/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/keeper/genesis.go b/keeper/genesis.go index 8b9e24b..9b6c205 100644 --- a/keeper/genesis.go +++ b/keeper/genesis.go @@ -9,7 +9,7 @@ import ( // InitGenesis initializes the module's state from a genesis state. func (k *Keeper) InitGenesis(ctx context.Context, data *poa.GenesisState) error { if err := k.PendingValidators.Set(ctx, poa.Validators{ - Validators: []poa.Validator{}, + Validators: data.Vals, }); err != nil { return err } @@ -20,13 +20,9 @@ func (k *Keeper) InitGenesis(ctx context.Context, data *poa.GenesisState) error return err } - if err := k.AbsoluteChangedInBlockPower.Set(ctx, poa.PowerCache{ + return k.AbsoluteChangedInBlockPower.Set(ctx, poa.PowerCache{ Power: 0, - }); err != nil { - return err - } - - return k.SetParams(ctx, data.Params) + }) } // InitStores sets the `AbsoluteChangedBlock` and `PreviousBlockPower` as a cache into the poa store. @@ -50,12 +46,12 @@ func (k *Keeper) InitCacheStores(ctx context.Context) error { // ExportGenesis exports the module's state to a genesis state. func (k *Keeper) ExportGenesis(ctx context.Context) *poa.GenesisState { - params, err := k.GetParams(ctx) + vals, err := k.PendingValidators.Get(ctx) if err != nil { panic(err) } return &poa.GenesisState{ - Params: params, + Vals: vals.Validators, } } diff --git a/keeper/genesis_test.go b/keeper/genesis_test.go index b3ce066..c097e7d 100644 --- a/keeper/genesis_test.go +++ b/keeper/genesis_test.go @@ -17,37 +17,13 @@ func TestInitGenesis(t *testing.T) { fixture := SetupTest(t, 2_000_000) require := require.New(t) - t.Run("default params", func(t *testing.T) { - data := &poa.GenesisState{ - Params: poa.DefaultParams(), - } + t.Run("default state", func(t *testing.T) { + data := &poa.GenesisState{} err := fixture.k.InitGenesis(fixture.ctx, data) require.NoError(err) - - params, err := fixture.k.GetParams(fixture.ctx) - require.NoError(err) - require.Equal(poa.DefaultParams(), params) - }) - - t.Run("custom params", func(t *testing.T) { - p, err := poa.NewParams(true) - require.NoError(err) - - data := &poa.GenesisState{ - Params: p, - } - err = fixture.k.InitGenesis(fixture.ctx, data) - require.NoError(err) - - params, err := fixture.k.GetParams(fixture.ctx) - require.NoError(err) - require.Equal(p, params) }) t.Run("pending validator export", func(t *testing.T) { - p, err := poa.NewParams(true) - require.NoError(err) - acc := GenAcc() valAddr := sdk.ValAddress(acc.addr) @@ -56,15 +32,17 @@ func TestInitGenesis(t *testing.T) { val.Tokens = sdkmath.NewInt(1_234_567) - err = fixture.k.InitGenesis(fixture.ctx, &poa.GenesisState{ - Params: p, - }) - require.NoError(err) + state := &poa.GenesisState{ + Vals: []poa.Validator{poa.ConvertStakingToPOA(val)}, + } - // load params - params, err := fixture.k.GetParams(fixture.ctx) + err = fixture.k.InitGenesis(fixture.ctx, state) require.NoError(err) - require.Equal(p, params) + exported := fixture.k.ExportGenesis(fixture.ctx) + + require.Len(state.Vals, len(exported.Vals)) + require.Equal(state.Vals[0].OperatorAddress, exported.Vals[0].OperatorAddress) + }) } diff --git a/keeper/keeper.go b/keeper/keeper.go index 04cb360..b6792b1 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -31,7 +31,6 @@ type Keeper struct { // state management Schema collections.Schema - Params collections.Item[poa.Params] PendingValidators collections.Item[poa.Validators] UpdatedValidatorsCache collections.KeySet[string] @@ -63,7 +62,6 @@ func NewKeeper( logger: logger, // Stores - Params: collections.NewItem(sb, poa.ParamsKey, "params", codec.CollValue[poa.Params](cdc)), PendingValidators: collections.NewItem(sb, poa.PendingValidatorsKey, "pending", codec.CollValue[poa.Validators](cdc)), UpdatedValidatorsCache: collections.NewKeySet(sb, poa.UpdatedValidatorsCacheKey, "updated_validators", collections.StringKey), diff --git a/keeper/msg_server.go b/keeper/msg_server.go index db010df..e0d97e8 100644 --- a/keeper/msg_server.go +++ b/keeper/msg_server.go @@ -86,11 +86,6 @@ func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.Ms func (ms msgServer) RemoveValidator(ctx context.Context, msg *poa.MsgRemoveValidator) (*poa.MsgRemoveValidatorResponse, error) { // Sender is not an admin. Check if the sender is the validator and that validator exist. if !ms.k.IsAdmin(ctx, msg.Sender) { - params, err := ms.k.GetParams(ctx) - if err != nil { - return nil, err - } - // check if the sender is the validator being removed. hasPermission, err := ms.k.IsSenderValidator(ctx, msg.Sender, msg.ValidatorAddress) if err != nil { @@ -100,10 +95,6 @@ func (ms msgServer) RemoveValidator(ctx context.Context, msg *poa.MsgRemoveValid if !hasPermission { return nil, poa.ErrNotAnAuthority } - - if !params.AllowValidatorSelfExit { - return nil, poa.ErrValidatorSelfRemoval - } } vals, err := ms.k.stakingKeeper.GetAllValidators(ctx) @@ -154,18 +145,6 @@ func (ms msgServer) RemovePending(ctx context.Context, msg *poa.MsgRemovePending return &poa.MsgRemovePendingResponse{}, ms.k.RemovePendingValidator(ctx, msg.ValidatorAddress) } -func (ms msgServer) UpdateParams(ctx context.Context, msg *poa.MsgUpdateParams) (*poa.MsgUpdateParamsResponse, error) { - if ok := ms.k.IsAdmin(ctx, msg.Sender); !ok { - return nil, poa.ErrNotAnAuthority - } - - if err := msg.Params.Validate(); err != nil { - return nil, err - } - - return &poa.MsgUpdateParamsResponse{}, ms.k.SetParams(ctx, msg.Params) -} - // CreateValidator is from the x/staking module. // POA changes: // - MinSelfDelegation is force set to 1. diff --git a/keeper/msg_server_test.go b/keeper/msg_server_test.go index 474af19..31d0af0 100644 --- a/keeper/msg_server_test.go +++ b/keeper/msg_server_test.go @@ -13,54 +13,6 @@ import ( "github.com/strangelove-ventures/poa" ) -func TestUpdateParams(t *testing.T) { - f := SetupTest(t, 2_000_000) - require := require.New(t) - - testCases := []struct { - name string - request *poa.MsgUpdateParams - expectErrMsg string - }{ - { - name: "set invalid authority (not an address)", - request: &poa.MsgUpdateParams{ - Sender: "foo", - }, - expectErrMsg: "not an authority", - }, - { - name: "set invalid authority (not defined authority)", - request: &poa.MsgUpdateParams{ - Sender: f.addrs[1].String(), - }, - expectErrMsg: "not an authority", - }, - { - name: "set valid params", - request: &poa.MsgUpdateParams{ - Sender: f.authorityAddr, - Params: poa.Params{ - AllowValidatorSelfExit: true, - }, - }, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - _, err := f.msgServer.UpdateParams(f.ctx, tc.request) - if tc.expectErrMsg != "" { - require.Error(err) - require.ErrorContains(err, tc.expectErrMsg) - } else { - require.NoError(err) - } - }) - } -} - func TestUpdateStakingParams(t *testing.T) { f := SetupTest(t, 2_000_000) require := require.New(t) @@ -316,15 +268,6 @@ func TestRemoveValidator(t *testing.T) { }, expectErrMsg: "is not bonded", }, - { - name: "fail; try to remove validator as itself with self removal disabled", - request: &poa.MsgRemoveValidator{ - Sender: sdk.AccAddress(MustValAddressFromBech32(vals[1].OperatorAddress)).String(), - ValidatorAddress: vals[1].OperatorAddress, - }, - expectErrMsg: poa.ErrValidatorSelfRemoval.Error(), - isSelfRemovalAllowed: false, - }, { name: "success; remove validator as itself", request: &poa.MsgRemoveValidator{ @@ -347,13 +290,6 @@ func TestRemoveValidator(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - // Update the params for self approval - currParams, _ := f.k.GetParams(f.ctx) - currParams.AllowValidatorSelfExit = tc.isSelfRemovalAllowed - - err = f.k.SetParams(f.ctx, currParams) - require.NoError(err) - _, err = f.msgServer.RemoveValidator(f.ctx, tc.request) if tc.expectErrMsg != "" { diff --git a/keeper/params.go b/keeper/params.go deleted file mode 100644 index 326655e..0000000 --- a/keeper/params.go +++ /dev/null @@ -1,26 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/strangelove-ventures/poa" -) - -// SetParams sets the module parameters. -func (k Keeper) SetParams(ctx context.Context, p poa.Params) error { - if err := p.Validate(); err != nil { - return err - } - - return k.Params.Set(ctx, p) -} - -// GetParams returns the current module parameters. -func (k Keeper) GetParams(ctx context.Context) (poa.Params, error) { - p, err := k.Params.Get(ctx) - if err != nil { - return poa.DefaultParams(), err - } - - return p, nil -} diff --git a/keeper/query_server.go b/keeper/query_server.go index eda6e8e..332627f 100644 --- a/keeper/query_server.go +++ b/keeper/query_server.go @@ -48,13 +48,3 @@ func (qs queryServer) PendingValidators(ctx context.Context, _ *poa.QueryPending return &poa.PendingValidatorsResponse{Pending: pending.Validators}, nil } - -// Params returns the current module params. -func (qs queryServer) Params(ctx context.Context, msg *poa.QueryParamsRequest) (*poa.ParamsResponse, error) { - params, err := qs.k.GetParams(ctx) - if err != nil { - return nil, err - } - - return &poa.ParamsResponse{Params: params}, nil -} diff --git a/keeper/query_server_test.go b/keeper/query_server_test.go index c44bd3e..b5a5f73 100644 --- a/keeper/query_server_test.go +++ b/keeper/query_server_test.go @@ -49,36 +49,3 @@ func TestPendingValidatorsQuery(t *testing.T) { require.NotEqual(valAddr, val.OperatorAddress) } } - -func TestParamsQuery(t *testing.T) { - f := SetupTest(t, 1_000_000) - require := require.New(t) - - testCases := []struct { - name string - request *poa.MsgUpdateParams - expected poa.Params - }{ - { - name: "default", - request: &poa.MsgUpdateParams{ - Sender: f.addrs[0].String(), - Params: poa.DefaultParams(), - }, - expected: poa.DefaultParams(), - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - _, err := f.msgServer.UpdateParams(f.ctx, tc.request) - require.NoError(err) - - r, err := f.queryServer.Params(f.ctx, &poa.QueryParamsRequest{}) - require.NoError(err) - - require.EqualValues(tc.expected, r.Params) - }) - } -} diff --git a/params.go b/params.go index 1215852..f722389 100644 --- a/params.go +++ b/params.go @@ -1,29 +1,9 @@ package poa import ( - "encoding/json" - fmt "fmt" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// DefaultParams returns default module parameters. -func DefaultParams() Params { - return Params{ - Admins: []string(nil), // uses the authority as admin only now - AllowValidatorSelfExit: true, - } -} - -// NewParams returns a new POA Params. -func NewParams(allowValSelfExit bool) (Params, error) { - p := Params{ - AllowValidatorSelfExit: allowValSelfExit, - } - - return p, p.Validate() -} - // DefaultParams returns the default x/staking parameters. func DefaultStakingParams() StakingParams { sp := stakingtypes.DefaultParams() @@ -37,22 +17,3 @@ func DefaultStakingParams() StakingParams { MinCommissionRate: sp.MinCommissionRate, } } - -// Stringer method for Params. -func (p Params) String() string { - bz, err := json.Marshal(p) - if err != nil { - panic(err) - } - - return string(bz) -} - -// Validate does the sanity check on the params. -func (p Params) Validate() error { - if len(p.Admins) != 0 { - return fmt.Errorf("DEPERECATED: admins must be empty as only the keeper authority is used") - } - - return nil -} diff --git a/params.pb.go b/params.pb.go index e842df5..23a20d5 100644 --- a/params.pb.go +++ b/params.pb.go @@ -30,61 +30,6 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the parameters for the module. -type Params struct { - // Array of addresses that are allowed to control the chains validators power. - // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. - Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` - // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. - AllowValidatorSelfExit bool `protobuf:"varint,2,opt,name=allow_validator_self_exit,json=allowValidatorSelfExit,proto3" json:"allow_validator_self_exit,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_b1333a19bedb70c3, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetAdmins() []string { - if m != nil { - return m.Admins - } - return nil -} - -func (m *Params) GetAllowValidatorSelfExit() bool { - if m != nil { - return m.AllowValidatorSelfExit - } - return false -} - // StakingParams defines the parameters for the x/staking module. type StakingParams struct { // unbonding_time is the time duration of unbonding. @@ -107,7 +52,7 @@ func (m *StakingParams) Reset() { *m = StakingParams{} } func (m *StakingParams) String() string { return proto.CompactTextString(m) } func (*StakingParams) ProtoMessage() {} func (*StakingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_b1333a19bedb70c3, []int{1} + return fileDescriptor_b1333a19bedb70c3, []int{0} } func (m *StakingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -172,7 +117,6 @@ func (m *StakingParams) GetBondDenom() string { } func init() { - proto.RegisterType((*Params)(nil), "strangelove_ventures.poa.v1.Params") proto.RegisterType((*StakingParams)(nil), "strangelove_ventures.poa.v1.StakingParams") } @@ -181,75 +125,39 @@ func init() { } var fileDescriptor_b1333a19bedb70c3 = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x6f, 0xd3, 0x40, - 0x14, 0xc6, 0x73, 0x14, 0x22, 0x7a, 0x55, 0x2a, 0xd5, 0xa0, 0xe2, 0xa4, 0xc2, 0x8e, 0x02, 0x48, - 0x51, 0xa5, 0xf8, 0x54, 0x98, 0x88, 0xc4, 0x12, 0xd2, 0x0d, 0x09, 0xe4, 0x56, 0x0c, 0x2c, 0xd6, - 0xc5, 0xbe, 0x38, 0xa7, 0xf8, 0xee, 0x45, 0xbe, 0x4b, 0x70, 0x77, 0x26, 0x26, 0xc6, 0x8e, 0x95, - 0x58, 0x18, 0x3b, 0xf0, 0x47, 0x74, 0xac, 0x98, 0x10, 0x43, 0x40, 0xc9, 0x50, 0x66, 0xfe, 0x02, - 0x64, 0x9f, 0x93, 0x76, 0xe8, 0x62, 0xf9, 0xbd, 0xf7, 0xbb, 0xbb, 0xef, 0xbb, 0xef, 0x70, 0x5b, - 0xe9, 0x94, 0xca, 0x98, 0x25, 0x30, 0x63, 0xc1, 0x8c, 0x49, 0x3d, 0x4d, 0x99, 0x22, 0x13, 0xa0, - 0x64, 0x76, 0x40, 0x26, 0x34, 0xa5, 0x42, 0x79, 0x93, 0x14, 0x34, 0x58, 0x7b, 0xb7, 0x91, 0xde, - 0x04, 0xa8, 0x37, 0x3b, 0x68, 0x3c, 0x8c, 0x21, 0x86, 0x82, 0x23, 0xf9, 0x9f, 0x59, 0xd2, 0xd8, - 0xa1, 0x82, 0x4b, 0x20, 0xc5, 0xb7, 0x6c, 0x39, 0x31, 0x40, 0x9c, 0x30, 0x52, 0x54, 0x83, 0xe9, - 0x90, 0x44, 0xd3, 0x94, 0x6a, 0x0e, 0xb2, 0x9c, 0xd7, 0x43, 0x50, 0x02, 0x54, 0x60, 0xf6, 0x32, - 0x85, 0x19, 0xb5, 0x34, 0xae, 0xbe, 0x2b, 0x04, 0x59, 0xbb, 0xb8, 0x4a, 0x23, 0xc1, 0xa5, 0xb2, - 0x51, 0x73, 0xa3, 0xbd, 0xe9, 0x97, 0x95, 0xf5, 0x12, 0xd7, 0x69, 0x92, 0xc0, 0xc7, 0x60, 0x46, - 0x13, 0x1e, 0x51, 0x0d, 0x69, 0xa0, 0x58, 0x32, 0x0c, 0x58, 0xc6, 0xb5, 0x7d, 0xa7, 0x89, 0xda, - 0xf7, 0xfd, 0xdd, 0x02, 0x78, 0xbf, 0x9a, 0x1f, 0xb1, 0x64, 0x78, 0x98, 0x71, 0xdd, 0x7d, 0x74, - 0x7a, 0xe6, 0x56, 0xfe, 0x9e, 0xb9, 0xe8, 0xf3, 0xd5, 0xf9, 0x3e, 0xce, 0xfd, 0x1b, 0xf3, 0xad, - 0xaf, 0x1b, 0xb8, 0x76, 0xa4, 0xe9, 0x98, 0xcb, 0xb8, 0x3c, 0xfd, 0x2d, 0xde, 0x9e, 0xca, 0x01, - 0xc8, 0x88, 0xcb, 0x38, 0xd0, 0x5c, 0x30, 0x1b, 0x35, 0x51, 0x7b, 0xeb, 0x79, 0xdd, 0x33, 0xde, - 0xbc, 0x95, 0x37, 0xaf, 0x5f, 0x7a, 0xeb, 0xd5, 0x2e, 0xe6, 0x6e, 0xe5, 0xf4, 0xb7, 0x8b, 0xbe, - 0x5d, 0x9d, 0xef, 0x23, 0xbf, 0xb6, 0x5e, 0x7f, 0xcc, 0x05, 0xb3, 0x9e, 0xe1, 0x6d, 0x41, 0xb3, - 0x6b, 0xd1, 0xaa, 0xd0, 0x5a, 0xf3, 0x6b, 0x82, 0x66, 0x6b, 0xa5, 0xca, 0x72, 0xf1, 0x56, 0x8e, - 0x31, 0xa9, 0x53, 0xce, 0x94, 0xbd, 0x51, 0x30, 0x58, 0xd0, 0xec, 0xd0, 0x74, 0xac, 0x0e, 0xb6, - 0x46, 0x5c, 0x69, 0x48, 0x79, 0x48, 0x93, 0x35, 0x77, 0xb7, 0xe0, 0x76, 0xae, 0x27, 0x2b, 0xfc, - 0x31, 0xc6, 0xb9, 0x8a, 0x20, 0x62, 0x12, 0x84, 0x7d, 0xaf, 0x89, 0xda, 0x9b, 0xfe, 0x66, 0xde, - 0xe9, 0xe7, 0x0d, 0xeb, 0x13, 0xc2, 0x0f, 0x04, 0x97, 0x41, 0x08, 0x42, 0x70, 0xa5, 0x38, 0xc8, - 0x20, 0xa5, 0x9a, 0xd9, 0xd5, 0x1c, 0xec, 0x1d, 0xe7, 0x8e, 0x7e, 0xcd, 0xdd, 0x3d, 0x13, 0x91, - 0x8a, 0xc6, 0x1e, 0x07, 0x22, 0xa8, 0x1e, 0x79, 0x6f, 0x58, 0x4c, 0xc3, 0x93, 0x3e, 0x0b, 0xff, - 0xcd, 0xdd, 0xc6, 0x09, 0x15, 0x49, 0xb7, 0x75, 0xcb, 0x3e, 0xad, 0x1f, 0xdf, 0x3b, 0xb8, 0xcc, - 0xb7, 0xcf, 0x42, 0x73, 0x31, 0x3b, 0x82, 0xcb, 0xd7, 0x6b, 0xce, 0xa7, 0x9a, 0x75, 0x9f, 0xae, - 0x42, 0x29, 0x4f, 0xea, 0xa8, 0x68, 0x4c, 0x32, 0xa2, 0x4c, 0x24, 0xc4, 0x64, 0xd2, 0x7b, 0x75, - 0xb1, 0x70, 0xd0, 0xe5, 0xc2, 0x41, 0x7f, 0x16, 0x0e, 0xfa, 0xb2, 0x74, 0x2a, 0x97, 0x4b, 0xa7, - 0xf2, 0x73, 0xe9, 0x54, 0x3e, 0x3c, 0x89, 0xb9, 0x1e, 0x4d, 0x07, 0x5e, 0x08, 0x82, 0xdc, 0x78, - 0xc1, 0x9d, 0x9b, 0x6f, 0x7d, 0x50, 0x2d, 0x22, 0x7b, 0xf1, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x8f, - 0xc6, 0xee, 0xa3, 0x0e, 0x03, 0x00, 0x00, + // 470 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x73, 0x14, 0x2a, 0xf5, 0x2a, 0x57, 0x8a, 0x61, 0x70, 0x53, 0x61, 0x47, 0x01, 0xa4, + 0xa8, 0x52, 0x7c, 0x2a, 0x6c, 0x95, 0x58, 0x42, 0xd8, 0x90, 0x40, 0xa1, 0x62, 0x60, 0xb1, 0x5e, + 0xec, 0xc3, 0x39, 0xc5, 0x77, 0x2f, 0xf2, 0x9d, 0xad, 0x74, 0x67, 0x62, 0x62, 0x64, 0x44, 0x62, + 0x61, 0xec, 0xc0, 0x87, 0xe8, 0x58, 0x31, 0x21, 0x86, 0x80, 0x92, 0xa1, 0xcc, 0x7c, 0x02, 0x64, + 0x9f, 0x1b, 0x3a, 0x74, 0xb1, 0x7c, 0xff, 0xf7, 0xbb, 0xf7, 0x7f, 0xf7, 0xde, 0xa3, 0x7d, 0x6d, + 0x72, 0x50, 0x29, 0xcf, 0xb0, 0xe4, 0x51, 0xc9, 0x95, 0x29, 0x72, 0xae, 0xd9, 0x1c, 0x81, 0x95, + 0x47, 0x6c, 0x0e, 0x39, 0x48, 0x1d, 0xce, 0x73, 0x34, 0xe8, 0x1e, 0xdc, 0x44, 0x86, 0x73, 0x84, + 0xb0, 0x3c, 0xea, 0xdc, 0x4b, 0x31, 0xc5, 0x9a, 0x63, 0xd5, 0x9f, 0xbd, 0xd2, 0x69, 0x83, 0x14, + 0x0a, 0x59, 0xfd, 0x6d, 0x24, 0x3f, 0x45, 0x4c, 0x33, 0xce, 0xea, 0xd3, 0xa4, 0x78, 0xc7, 0x92, + 0x22, 0x07, 0x23, 0x50, 0x35, 0xf1, 0xfd, 0x18, 0xb5, 0x44, 0x1d, 0xd9, 0x5c, 0xf6, 0x60, 0x43, + 0xbd, 0x2f, 0x5b, 0xd4, 0x79, 0x6d, 0x60, 0x26, 0x54, 0xfa, 0xaa, 0x2e, 0xcc, 0x7d, 0x49, 0xf7, + 0x0a, 0x35, 0x41, 0x95, 0x08, 0x95, 0x46, 0x46, 0x48, 0xee, 0x91, 0x2e, 0xe9, 0xef, 0x3e, 0xde, + 0x0f, 0xad, 0x4b, 0x78, 0xe5, 0x12, 0x8e, 0x1a, 0x97, 0xa1, 0x73, 0xbe, 0x0c, 0x5a, 0x9f, 0x7e, + 0x05, 0xe4, 0xeb, 0xe5, 0xd9, 0x21, 0x19, 0x3b, 0x9b, 0xfb, 0x27, 0x42, 0x72, 0xf7, 0x11, 0xdd, + 0x93, 0xb0, 0x88, 0x4a, 0xc8, 0x44, 0x02, 0x06, 0x73, 0xed, 0xdd, 0xea, 0x92, 0xbe, 0x33, 0x76, + 0x24, 0x2c, 0xde, 0x6c, 0x44, 0x37, 0xa0, 0xbb, 0x15, 0xc6, 0x95, 0xc9, 0x05, 0xd7, 0xde, 0x56, + 0xcd, 0x50, 0x09, 0x8b, 0xe7, 0x56, 0x71, 0x07, 0xd4, 0x9d, 0x0a, 0x6d, 0x30, 0x17, 0x31, 0x64, + 0x1b, 0xee, 0x76, 0xcd, 0xb5, 0xff, 0x47, 0xae, 0xf0, 0xfb, 0x94, 0x56, 0x55, 0x44, 0x09, 0x57, + 0x28, 0xbd, 0x3b, 0x5d, 0xd2, 0xdf, 0x19, 0xef, 0x54, 0xca, 0xa8, 0x12, 0xdc, 0xf7, 0x84, 0xde, + 0x95, 0x42, 0x45, 0x31, 0x4a, 0x29, 0xb4, 0x16, 0xa8, 0xa2, 0x1c, 0x0c, 0xf7, 0xb6, 0x2b, 0x70, + 0x78, 0x52, 0xbd, 0xe8, 0xe7, 0x32, 0x38, 0xb0, 0xcd, 0xd2, 0xc9, 0x2c, 0x14, 0xc8, 0x24, 0x98, + 0x69, 0xf8, 0x82, 0xa7, 0x10, 0x9f, 0x8e, 0x78, 0xfc, 0x77, 0x19, 0x74, 0x4e, 0x41, 0x66, 0xc7, + 0xbd, 0x1b, 0xf2, 0xf4, 0xbe, 0x7f, 0x1b, 0xd0, 0xa6, 0xd3, 0x23, 0x1e, 0xdb, 0xc6, 0xb4, 0xa5, + 0x50, 0xcf, 0x36, 0xdc, 0x18, 0x0c, 0x3f, 0x7e, 0xf8, 0xe7, 0x73, 0x40, 0x3e, 0x5c, 0x9e, 0x1d, + 0x36, 0x4e, 0x03, 0x9d, 0xcc, 0xd8, 0x82, 0x69, 0x3b, 0x12, 0x66, 0x67, 0x32, 0x7c, 0x7a, 0xbe, + 0xf2, 0xc9, 0xc5, 0xca, 0x27, 0xbf, 0x57, 0x3e, 0xf9, 0xb8, 0xf6, 0x5b, 0x17, 0x6b, 0xbf, 0xf5, + 0x63, 0xed, 0xb7, 0xde, 0x3e, 0x48, 0x85, 0x99, 0x16, 0x93, 0x30, 0x46, 0xc9, 0xae, 0xed, 0xd2, + 0xe0, 0xfa, 0xd6, 0x4d, 0xb6, 0xeb, 0x91, 0x3d, 0xf9, 0x17, 0x00, 0x00, 0xff, 0xff, 0x13, 0x1a, + 0xfc, 0xf3, 0x98, 0x02, 0x00, 0x00, } -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Admins) != len(that1.Admins) { - return false - } - for i := range this.Admins { - if this.Admins[i] != that1.Admins[i] { - return false - } - } - if this.AllowValidatorSelfExit != that1.AllowValidatorSelfExit { - return false - } - return true -} func (this *StakingParams) Equal(that interface{}) bool { if that == nil { return this == nil @@ -289,48 +197,6 @@ func (this *StakingParams) Equal(that interface{}) bool { } return true } -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AllowValidatorSelfExit { - i-- - if m.AllowValidatorSelfExit { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Admins) > 0 { - for iNdEx := len(m.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Admins[iNdEx]) - copy(dAtA[i:], m.Admins[iNdEx]) - i = encodeVarintParams(dAtA, i, uint64(len(m.Admins[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *StakingParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -405,24 +271,6 @@ func encodeVarintParams(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Admins) > 0 { - for _, s := range m.Admins { - l = len(s) - n += 1 + l + sovParams(uint64(l)) - } - } - if m.AllowValidatorSelfExit { - n += 2 - } - return n -} - func (m *StakingParams) Size() (n int) { if m == nil { return 0 @@ -455,108 +303,6 @@ func sovParams(x uint64) (n int) { func sozParams(x uint64) (n int) { return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admins = append(m.Admins, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowValidatorSelfExit", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowValidatorSelfExit = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *StakingParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/strangelove_ventures/poa/v1/genesis.proto b/proto/strangelove_ventures/poa/v1/genesis.proto index 81912f5..b826242 100644 --- a/proto/strangelove_ventures/poa/v1/genesis.proto +++ b/proto/strangelove_ventures/poa/v1/genesis.proto @@ -12,7 +12,10 @@ option go_package = "github.com/strangelove-ventures/poa"; // GenesisState defines the poa module's genesis state. message GenesisState { // Params defines all the parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; + // Params params = 1 [ (gogoproto.nullable) = false ]; + + + repeated Validator vals = 2 [ (gogoproto.nullable) = false ]; } // PowerCache is a cached block or absolute change in power for ibc-go validations. diff --git a/proto/strangelove_ventures/poa/v1/params.proto b/proto/strangelove_ventures/poa/v1/params.proto index 22d1859..538fbd4 100644 --- a/proto/strangelove_ventures/poa/v1/params.proto +++ b/proto/strangelove_ventures/poa/v1/params.proto @@ -9,18 +9,18 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/strangelove-ventures/poa"; // Params defines the parameters for the module. -message Params { - option (amino.name) = "poa/params"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; +// message Params { +// option (amino.name) = "poa/params"; +// option (gogoproto.equal) = true; +// option (gogoproto.goproto_stringer) = false; - // Array of addresses that are allowed to control the chains validators power. - // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. - repeated string admins = 1; +// // Array of addresses that are allowed to control the chains validators power. +// // deprecated: set with the authority in the keeper instead. This is just here for store compatibility. +// repeated string admins = 1; - // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. - bool allow_validator_self_exit = 2; -} +// // allow_validator_self_exit allows for a valdiator to remove themselves from the validator set. +// bool allow_validator_self_exit = 2; +// } // StakingParams defines the parameters for the x/staking module. message StakingParams { diff --git a/proto/strangelove_ventures/poa/v1/query.proto b/proto/strangelove_ventures/poa/v1/query.proto index efab7ab..50bff4c 100644 --- a/proto/strangelove_ventures/poa/v1/query.proto +++ b/proto/strangelove_ventures/poa/v1/query.proto @@ -10,10 +10,6 @@ option go_package = "github.com/strangelove-ventures/poa"; // Query defines the gRPC querier service. service Query { - // Params returns the current params of the module. - rpc Params(QueryParamsRequest) returns (ParamsResponse) { - option (google.api.http).get = "/poa/v1/params"; - } // PendingValidators returns currently pending validators of the module. rpc PendingValidators(QueryPendingValidatorsRequest) returns (PendingValidatorsResponse) { @@ -26,15 +22,6 @@ service Query { } } -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message ParamsResponse { - // params is the returned parameter from the module - Params params = 1 [ (gogoproto.nullable) = false ]; -} - // QueryPendingValidatorsRequest is the request type for the Query/PendingValidators RPC method. message QueryPendingValidatorsRequest {} diff --git a/proto/strangelove_ventures/poa/v1/tx.proto b/proto/strangelove_ventures/poa/v1/tx.proto index 61dc145..d16e1c5 100644 --- a/proto/strangelove_ventures/poa/v1/tx.proto +++ b/proto/strangelove_ventures/poa/v1/tx.proto @@ -28,9 +28,6 @@ service Msg { // RemovePending removes a pending validator from the queue. rpc RemovePending(MsgRemovePending) returns (MsgRemovePendingResponse); - // UpdateParams updates the module parameters. - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // UpdateStakingParams updates the module parameters. rpc UpdateStakingParams(MsgUpdateStakingParams) returns (MsgUpdateStakingParamsResponse); } @@ -85,23 +82,6 @@ message MsgRemovePending { // MsgRemovePendingResponse is the response type for the Msg/RemovePending RPC method. message MsgRemovePendingResponse {} -// MsgUpdateParams is the Msg/UpdateParams request type. -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "sender"; - option (amino.name) = "poa/MsgUpdateParams"; - - // sender is the address of the admin account with permission to update. - // ex: governance, multisig/DAO, or standard account found in Params. - string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // module parameters (all must be supplied). - Params params = 2 [ (gogoproto.nullable) = false ]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -message MsgUpdateParamsResponse {} - // MsgUpdateStakingParams is the Msg/UpdateStakingParams request type. message MsgUpdateStakingParams { option (cosmos.msg.v1.signer) = "sender"; diff --git a/query.pb.go b/query.pb.go index a194f5d..3b519ab 100644 --- a/query.pb.go +++ b/query.pb.go @@ -29,89 +29,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_676fcce3868e4c52, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is the response type for the Query/Params RPC method. -type ParamsResponse struct { - // params is the returned parameter from the module - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *ParamsResponse) Reset() { *m = ParamsResponse{} } -func (m *ParamsResponse) String() string { return proto.CompactTextString(m) } -func (*ParamsResponse) ProtoMessage() {} -func (*ParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_676fcce3868e4c52, []int{1} -} -func (m *ParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParamsResponse.Merge(m, src) -} -func (m *ParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *ParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ParamsResponse proto.InternalMessageInfo - -func (m *ParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - // QueryPendingValidatorsRequest is the request type for the Query/PendingValidators RPC method. type QueryPendingValidatorsRequest struct { } @@ -120,7 +37,7 @@ func (m *QueryPendingValidatorsRequest) Reset() { *m = QueryPendingValid func (m *QueryPendingValidatorsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPendingValidatorsRequest) ProtoMessage() {} func (*QueryPendingValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_676fcce3868e4c52, []int{2} + return fileDescriptor_676fcce3868e4c52, []int{0} } func (m *QueryPendingValidatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -159,7 +76,7 @@ func (m *PendingValidatorsResponse) Reset() { *m = PendingValidatorsResp func (m *PendingValidatorsResponse) String() string { return proto.CompactTextString(m) } func (*PendingValidatorsResponse) ProtoMessage() {} func (*PendingValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_676fcce3868e4c52, []int{3} + return fileDescriptor_676fcce3868e4c52, []int{1} } func (m *PendingValidatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -205,7 +122,7 @@ func (m *QueryConsensusPowerRequest) Reset() { *m = QueryConsensusPowerR func (m *QueryConsensusPowerRequest) String() string { return proto.CompactTextString(m) } func (*QueryConsensusPowerRequest) ProtoMessage() {} func (*QueryConsensusPowerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_676fcce3868e4c52, []int{4} + return fileDescriptor_676fcce3868e4c52, []int{2} } func (m *QueryConsensusPowerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -251,7 +168,7 @@ func (m *QueryConsensusPowerResponse) Reset() { *m = QueryConsensusPower func (m *QueryConsensusPowerResponse) String() string { return proto.CompactTextString(m) } func (*QueryConsensusPowerResponse) ProtoMessage() {} func (*QueryConsensusPowerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_676fcce3868e4c52, []int{5} + return fileDescriptor_676fcce3868e4c52, []int{3} } func (m *QueryConsensusPowerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -288,8 +205,6 @@ func (m *QueryConsensusPowerResponse) GetConsensusPower() int64 { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "strangelove_ventures.poa.v1.QueryParamsRequest") - proto.RegisterType((*ParamsResponse)(nil), "strangelove_ventures.poa.v1.ParamsResponse") proto.RegisterType((*QueryPendingValidatorsRequest)(nil), "strangelove_ventures.poa.v1.QueryPendingValidatorsRequest") proto.RegisterType((*PendingValidatorsResponse)(nil), "strangelove_ventures.poa.v1.PendingValidatorsResponse") proto.RegisterType((*QueryConsensusPowerRequest)(nil), "strangelove_ventures.poa.v1.QueryConsensusPowerRequest") @@ -301,37 +216,33 @@ func init() { } var fileDescriptor_676fcce3868e4c52 = []byte{ - // 475 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xc1, 0x6a, 0x14, 0x31, - 0x18, 0xc7, 0x37, 0xae, 0xae, 0x98, 0xc2, 0xda, 0x86, 0xa2, 0xed, 0xb4, 0xce, 0x96, 0x14, 0xec, - 0xc2, 0xe2, 0x84, 0xae, 0xa0, 0x22, 0x78, 0x68, 0x85, 0x82, 0xb7, 0xba, 0x82, 0x07, 0x2f, 0x4b, - 0x3a, 0x13, 0xc6, 0x81, 0x6d, 0x92, 0x26, 0x99, 0x11, 0x2f, 0x1e, 0x7c, 0x02, 0xc1, 0x57, 0xf0, - 0xe6, 0x8b, 0xf4, 0x58, 0xf0, 0xe2, 0x41, 0x44, 0x76, 0x7d, 0x10, 0x99, 0x64, 0x66, 0xec, 0xda, - 0xe9, 0xb8, 0xbd, 0x0d, 0xf9, 0xbe, 0xff, 0xff, 0xfb, 0xe5, 0xfb, 0x4f, 0xe0, 0x8e, 0x36, 0x8a, - 0xf2, 0x98, 0x4d, 0x44, 0xc6, 0xc6, 0x19, 0xe3, 0x26, 0x55, 0x4c, 0x13, 0x29, 0x28, 0xc9, 0x76, - 0xc9, 0x49, 0xca, 0xd4, 0xfb, 0x40, 0x2a, 0x61, 0x04, 0xda, 0xa8, 0x6b, 0x0c, 0xa4, 0xa0, 0x41, - 0xb6, 0xeb, 0xad, 0xc6, 0x22, 0x16, 0xb6, 0x8f, 0xe4, 0x5f, 0x4e, 0xe2, 0x6d, 0xc6, 0x42, 0xc4, - 0x13, 0x46, 0xa8, 0x4c, 0x08, 0xe5, 0x5c, 0x18, 0x6a, 0x12, 0xc1, 0x75, 0x51, 0xed, 0x37, 0x4d, - 0x96, 0x54, 0xd1, 0xe3, 0xb2, 0x73, 0xd0, 0xd4, 0x99, 0xd1, 0x49, 0x12, 0x51, 0x23, 0x94, 0x6b, - 0xc6, 0xab, 0x10, 0xbd, 0xcc, 0xb1, 0x0f, 0xad, 0xc3, 0x88, 0x9d, 0xa4, 0x4c, 0x1b, 0xfc, 0x0a, - 0x76, 0xcb, 0x03, 0x2d, 0x05, 0xd7, 0x0c, 0xed, 0xc1, 0x8e, 0x1b, 0xb2, 0x06, 0xb6, 0x40, 0x7f, - 0x69, 0xb8, 0x1d, 0x34, 0x5c, 0x30, 0x70, 0xe2, 0xfd, 0xeb, 0xa7, 0x3f, 0x7b, 0xad, 0x51, 0x21, - 0xc4, 0x3d, 0x78, 0xcf, 0x8d, 0x62, 0x3c, 0x4a, 0x78, 0xfc, 0xba, 0x24, 0xa9, 0xa6, 0x86, 0x70, - 0xbd, 0xa6, 0x56, 0x00, 0x1c, 0xc0, 0x9b, 0xd2, 0x15, 0xd7, 0xc0, 0x56, 0xbb, 0xbf, 0x34, 0xbc, - 0xdf, 0x48, 0x50, 0x39, 0x14, 0x10, 0xa5, 0x18, 0xbf, 0x80, 0x9e, 0xa5, 0x78, 0x9e, 0xbb, 0x72, - 0x9d, 0xea, 0x43, 0xf1, 0x8e, 0xa9, 0x02, 0x01, 0x0d, 0xe0, 0x4a, 0xb5, 0xa1, 0x31, 0x8d, 0x22, - 0xc5, 0xb4, 0xbb, 0xf1, 0xad, 0xd1, 0x72, 0x55, 0xd8, 0x73, 0xe7, 0xf8, 0x00, 0x6e, 0xd4, 0x5a, - 0x15, 0xc4, 0x3b, 0xf0, 0x76, 0x58, 0x56, 0xc6, 0x32, 0x2f, 0x59, 0xa7, 0xf6, 0xa8, 0x1b, 0xce, - 0x09, 0x86, 0x3f, 0xda, 0xf0, 0x86, 0x35, 0x42, 0x1f, 0x60, 0xc7, 0xad, 0x0e, 0x91, 0xc6, 0xdb, - 0x5d, 0x8c, 0xcc, 0x1b, 0x2c, 0x10, 0x48, 0x89, 0x86, 0xef, 0x7c, 0xfc, 0xf6, 0xfb, 0xf3, 0xb5, - 0x65, 0xd4, 0x9d, 0xff, 0x81, 0xd0, 0x57, 0x00, 0x57, 0x2e, 0x44, 0x80, 0x9e, 0x2e, 0xc0, 0x72, - 0x49, 0xa6, 0xde, 0xa3, 0x66, 0xac, 0xcb, 0xe2, 0xc6, 0xd8, 0x12, 0x6e, 0x22, 0xaf, 0x22, 0x74, - 0xad, 0xe3, 0xec, 0x2f, 0xd7, 0x17, 0x00, 0xbb, 0xf3, 0xbb, 0x47, 0x8f, 0xff, 0x8f, 0x5a, 0x1b, - 0xbc, 0xf7, 0xe4, 0xea, 0xc2, 0x82, 0xb4, 0x67, 0x49, 0xd7, 0xd1, 0xdd, 0x92, 0xf4, 0x9f, 0xd0, - 0xf7, 0x9f, 0x9d, 0x4e, 0x7d, 0x70, 0x36, 0xf5, 0xc1, 0xaf, 0xa9, 0x0f, 0x3e, 0xcd, 0xfc, 0xd6, - 0xd9, 0xcc, 0x6f, 0x7d, 0x9f, 0xf9, 0xad, 0x37, 0xdb, 0x71, 0x62, 0xde, 0xa6, 0x47, 0x41, 0x28, - 0x8e, 0xc9, 0xb9, 0xf1, 0x0f, 0xce, 0x3f, 0xda, 0xa3, 0x8e, 0x7d, 0xa8, 0x0f, 0xff, 0x04, 0x00, - 0x00, 0xff, 0xff, 0xf3, 0x3e, 0x02, 0x49, 0x7b, 0x04, 0x00, 0x00, + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x4f, 0xeb, 0xd3, 0x30, + 0x1c, 0xc6, 0x9b, 0xcd, 0x3f, 0x18, 0x61, 0xba, 0x20, 0xb8, 0x75, 0xb3, 0x1b, 0x15, 0xdc, 0x60, + 0xd8, 0xb2, 0x09, 0x2a, 0x82, 0x07, 0x27, 0x0c, 0xbc, 0xcd, 0x1e, 0x3c, 0x78, 0x29, 0x59, 0x1b, + 0x6a, 0x61, 0x4b, 0xb2, 0x24, 0xad, 0x78, 0xf5, 0x15, 0x08, 0xbe, 0x05, 0x6f, 0xbe, 0x91, 0x1d, + 0x07, 0x5e, 0x3c, 0x88, 0xc8, 0xe6, 0x0b, 0x91, 0xfe, 0x75, 0xd3, 0x5a, 0xf9, 0xdd, 0x4a, 0x9f, + 0xe7, 0xfb, 0xe4, 0xf3, 0x7d, 0x12, 0x38, 0x92, 0x4a, 0x60, 0x1a, 0x90, 0x35, 0x8b, 0x89, 0x1b, + 0x13, 0xaa, 0x22, 0x41, 0xa4, 0xcd, 0x19, 0xb6, 0xe3, 0xa9, 0xbd, 0x8d, 0x88, 0x78, 0x67, 0x71, + 0xc1, 0x14, 0x43, 0xbd, 0x2a, 0xa3, 0xc5, 0x19, 0xb6, 0xe2, 0xa9, 0x7e, 0x2b, 0x60, 0x01, 0x4b, + 0x7d, 0x76, 0xf2, 0x95, 0x8d, 0xe8, 0xfd, 0x80, 0xb1, 0x60, 0x4d, 0x6c, 0xcc, 0x43, 0x1b, 0x53, + 0xca, 0x14, 0x56, 0x21, 0xa3, 0x32, 0x57, 0xc7, 0x75, 0x27, 0x73, 0x2c, 0xf0, 0xa6, 0x70, 0x4e, + 0xea, 0x9c, 0x31, 0x5e, 0x87, 0x3e, 0x56, 0x4c, 0x64, 0x66, 0x73, 0x00, 0xef, 0xbc, 0x4c, 0xb0, + 0x97, 0x84, 0xfa, 0x21, 0x0d, 0x5e, 0x15, 0xb2, 0x74, 0xc8, 0x36, 0x22, 0x52, 0x99, 0x1e, 0xec, + 0x56, 0x68, 0x92, 0x33, 0x2a, 0x09, 0x5a, 0xc0, 0xab, 0x3c, 0x13, 0x3b, 0x60, 0xd8, 0x1c, 0x5f, + 0x9f, 0xdd, 0xb3, 0x6a, 0xf6, 0xb6, 0xca, 0x84, 0xf9, 0xa5, 0xdd, 0xf7, 0x81, 0xe6, 0x14, 0xc3, + 0xe6, 0x0b, 0xa8, 0xa7, 0x14, 0xcf, 0x93, 0x54, 0x2a, 0x23, 0xb9, 0x64, 0x6f, 0x89, 0xc8, 0x11, + 0xd0, 0x04, 0xb6, 0x4b, 0x6c, 0x17, 0xfb, 0xbe, 0x20, 0x52, 0x76, 0xc0, 0x10, 0x8c, 0xaf, 0x39, + 0x37, 0x4b, 0xe1, 0x59, 0xf6, 0xdf, 0x5c, 0xc0, 0x5e, 0x65, 0x54, 0x4e, 0x3c, 0x82, 0x37, 0xbc, + 0x42, 0x71, 0x79, 0x22, 0xa5, 0x49, 0x4d, 0xa7, 0xe5, 0x9d, 0x0d, 0xcc, 0xbe, 0x35, 0xe0, 0xe5, + 0x34, 0x08, 0x7d, 0x06, 0xb0, 0xfd, 0x57, 0x05, 0xe8, 0x49, 0xed, 0xa6, 0xb5, 0x9d, 0xea, 0x0f, + 0x6b, 0x67, 0xff, 0x59, 0xb7, 0x69, 0xbe, 0xff, 0xf2, 0xf3, 0x63, 0xa3, 0x8f, 0xf4, 0xf2, 0xde, + 0x33, 0xab, 0x1b, 0xff, 0xe6, 0xfa, 0x04, 0x60, 0xeb, 0x7c, 0x77, 0xf4, 0xe8, 0xff, 0xa8, 0x95, + 0xc5, 0xeb, 0x8f, 0x2f, 0x3e, 0x98, 0x93, 0x0e, 0x52, 0xd2, 0x2e, 0xba, 0x5d, 0x90, 0xfe, 0x51, + 0xfa, 0xfc, 0xe9, 0xee, 0x60, 0x80, 0xfd, 0xc1, 0x00, 0x3f, 0x0e, 0x06, 0xf8, 0x70, 0x34, 0xb4, + 0xfd, 0xd1, 0xd0, 0xbe, 0x1e, 0x0d, 0xed, 0xf5, 0xdd, 0x20, 0x54, 0x6f, 0xa2, 0x95, 0xe5, 0xb1, + 0x8d, 0x7d, 0x72, 0xfc, 0xfd, 0xd3, 0x97, 0xbc, 0xba, 0x92, 0xbe, 0xde, 0x07, 0xbf, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x2c, 0xb8, 0x2b, 0x91, 0x90, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -346,8 +257,6 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Params returns the current params of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) // PendingValidators returns currently pending validators of the module. PendingValidators(ctx context.Context, in *QueryPendingValidatorsRequest, opts ...grpc.CallOption) (*PendingValidatorsResponse, error) // ConsensusPower returns the current consensus power of a validator. @@ -362,15 +271,6 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { - out := new(ParamsResponse) - err := c.cc.Invoke(ctx, "/strangelove_ventures.poa.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) PendingValidators(ctx context.Context, in *QueryPendingValidatorsRequest, opts ...grpc.CallOption) (*PendingValidatorsResponse, error) { out := new(PendingValidatorsResponse) err := c.cc.Invoke(ctx, "/strangelove_ventures.poa.v1.Query/PendingValidators", in, out, opts...) @@ -391,8 +291,6 @@ func (c *queryClient) ConsensusPower(ctx context.Context, in *QueryConsensusPowe // QueryServer is the server API for Query service. type QueryServer interface { - // Params returns the current params of the module. - Params(context.Context, *QueryParamsRequest) (*ParamsResponse, error) // PendingValidators returns currently pending validators of the module. PendingValidators(context.Context, *QueryPendingValidatorsRequest) (*PendingValidatorsResponse, error) // ConsensusPower returns the current consensus power of a validator. @@ -403,9 +301,6 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*ParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} func (*UnimplementedQueryServer) PendingValidators(ctx context.Context, req *QueryPendingValidatorsRequest) (*PendingValidatorsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PendingValidators not implemented") } @@ -417,24 +312,6 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/strangelove_ventures.poa.v1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_PendingValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryPendingValidatorsRequest) if err := dec(in); err != nil { @@ -475,10 +352,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "strangelove_ventures.poa.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, { MethodName: "PendingValidators", Handler: _Query_PendingValidators_Handler, @@ -492,62 +365,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "strangelove_ventures/poa/v1/query.proto", } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *QueryPendingValidatorsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -677,26 +494,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryPendingValidatorsRequest) Size() (n int) { if m == nil { return 0 @@ -752,139 +549,6 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryPendingValidatorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/query.pb.gw.go b/query.pb.gw.go index 90bc18b..de123ed 100644 --- a/query.pb.gw.go +++ b/query.pb.gw.go @@ -33,24 +33,6 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_PendingValidators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPendingValidatorsRequest var metadata runtime.ServerMetadata @@ -111,29 +93,6 @@ func local_request_Query_ConsensusPower_0(ctx context.Context, marshaler runtime // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_PendingValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -221,26 +180,6 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_PendingValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -285,16 +224,12 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"poa", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_PendingValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"poa", "v1", "pending_validators"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ConsensusPower_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"poa", "v1", "consensus_power"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_PendingValidators_0 = runtime.ForwardResponseMessage forward_Query_ConsensusPower_0 = runtime.ForwardResponseMessage diff --git a/tx.pb.go b/tx.pb.go index 05b7a04..f3b1b8b 100644 --- a/tx.pb.go +++ b/tx.pb.go @@ -264,100 +264,6 @@ func (m *MsgRemovePendingResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemovePendingResponse proto.InternalMessageInfo -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - // sender is the address of the admin account with permission to update. - // ex: governance, multisig/DAO, or standard account found in Params. - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // module parameters (all must be supplied). - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_9035304c91ee78c4, []int{6} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9035304c91ee78c4, []int{7} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - // MsgUpdateStakingParams is the Msg/UpdateStakingParams request type. type MsgUpdateStakingParams struct { // sender is the address of the admin account with permission to update. @@ -371,7 +277,7 @@ func (m *MsgUpdateStakingParams) Reset() { *m = MsgUpdateStakingParams{} func (m *MsgUpdateStakingParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateStakingParams) ProtoMessage() {} func (*MsgUpdateStakingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_9035304c91ee78c4, []int{8} + return fileDescriptor_9035304c91ee78c4, []int{6} } func (m *MsgUpdateStakingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -423,7 +329,7 @@ func (m *MsgUpdateStakingParamsResponse) Reset() { *m = MsgUpdateStaking func (m *MsgUpdateStakingParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateStakingParamsResponse) ProtoMessage() {} func (*MsgUpdateStakingParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9035304c91ee78c4, []int{9} + return fileDescriptor_9035304c91ee78c4, []int{7} } func (m *MsgUpdateStakingParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -470,7 +376,7 @@ func (m *MsgCreateValidator) Reset() { *m = MsgCreateValidator{} } func (m *MsgCreateValidator) String() string { return proto.CompactTextString(m) } func (*MsgCreateValidator) ProtoMessage() {} func (*MsgCreateValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_9035304c91ee78c4, []int{10} + return fileDescriptor_9035304c91ee78c4, []int{8} } func (m *MsgCreateValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -507,7 +413,7 @@ func (m *MsgCreateValidatorResponse) Reset() { *m = MsgCreateValidatorRe func (m *MsgCreateValidatorResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateValidatorResponse) ProtoMessage() {} func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9035304c91ee78c4, []int{11} + return fileDescriptor_9035304c91ee78c4, []int{9} } func (m *MsgCreateValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,8 +449,6 @@ func init() { proto.RegisterType((*MsgRemoveValidatorResponse)(nil), "strangelove_ventures.poa.v1.MsgRemoveValidatorResponse") proto.RegisterType((*MsgRemovePending)(nil), "strangelove_ventures.poa.v1.MsgRemovePending") proto.RegisterType((*MsgRemovePendingResponse)(nil), "strangelove_ventures.poa.v1.MsgRemovePendingResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "strangelove_ventures.poa.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "strangelove_ventures.poa.v1.MsgUpdateParamsResponse") proto.RegisterType((*MsgUpdateStakingParams)(nil), "strangelove_ventures.poa.v1.MsgUpdateStakingParams") proto.RegisterType((*MsgUpdateStakingParamsResponse)(nil), "strangelove_ventures.poa.v1.MsgUpdateStakingParamsResponse") proto.RegisterType((*MsgCreateValidator)(nil), "strangelove_ventures.poa.v1.MsgCreateValidator") @@ -556,65 +460,62 @@ func init() { } var fileDescriptor_9035304c91ee78c4 = []byte{ - // 920 bytes of a gzipped FileDescriptorProto + // 868 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x69, 0x1a, 0xed, 0x4e, 0x41, 0x6d, 0xdd, 0x6c, 0xd7, 0x6b, 0xc0, 0x09, 0x29, 0x12, - 0x51, 0x68, 0xec, 0xa6, 0x0b, 0x42, 0x04, 0x71, 0x68, 0x76, 0xf9, 0xb1, 0x42, 0x41, 0x91, 0xa3, - 0x5d, 0x24, 0x2e, 0x61, 0x12, 0x4f, 0x66, 0xad, 0xc6, 0x33, 0x96, 0x67, 0x12, 0x88, 0xf6, 0x82, - 0xb8, 0x80, 0x38, 0xf1, 0x27, 0xec, 0x11, 0x89, 0x4b, 0x0f, 0xbd, 0x70, 0x40, 0x42, 0x9c, 0x56, - 0x9c, 0x56, 0x3d, 0x21, 0x24, 0x56, 0xa8, 0x39, 0x94, 0x3f, 0x03, 0xd9, 0x1e, 0x7b, 0x1d, 0x37, - 0x3f, 0xda, 0x5e, 0xf6, 0x52, 0x75, 0xde, 0x7c, 0xef, 0x7b, 0xdf, 0xe7, 0x99, 0xf7, 0x26, 0xe0, - 0x4d, 0xc6, 0x3d, 0x48, 0x30, 0x1a, 0xd0, 0x11, 0xea, 0x8c, 0x10, 0xe1, 0x43, 0x0f, 0x31, 0xc3, - 0xa5, 0xd0, 0x18, 0xd5, 0x0c, 0xfe, 0x8d, 0xee, 0x7a, 0x94, 0x53, 0xf9, 0xd5, 0x59, 0x28, 0xdd, - 0xa5, 0x50, 0x1f, 0xd5, 0x54, 0xad, 0x47, 0x99, 0x43, 0x99, 0xd1, 0x85, 0x0c, 0x19, 0xa3, 0x5a, - 0x17, 0x71, 0x58, 0x33, 0x7a, 0xd4, 0x26, 0x61, 0xb2, 0xfa, 0xf6, 0xa2, 0x12, 0x23, 0x38, 0xb0, - 0x2d, 0xc8, 0xa9, 0x27, 0xc0, 0xe5, 0x45, 0x60, 0x17, 0x7a, 0xd0, 0x61, 0x02, 0x79, 0x2b, 0x2c, - 0xdb, 0x09, 0x56, 0x46, 0xb8, 0x88, 0xb6, 0x30, 0xa5, 0x78, 0x80, 0x8c, 0x60, 0xd5, 0x1d, 0xf6, - 0x0d, 0x48, 0xc6, 0x62, 0x2b, 0x8f, 0x29, 0xa6, 0x61, 0x8a, 0xff, 0x9f, 0x88, 0xde, 0x14, 0x16, - 0x1c, 0x86, 0xfd, 0x3a, 0x0e, 0xc3, 0x62, 0x63, 0x13, 0x3a, 0x36, 0xa1, 0x46, 0xf0, 0x37, 0x0c, - 0x95, 0xfe, 0x91, 0xc0, 0x5a, 0x93, 0xe1, 0x36, 0xe2, 0x2d, 0xfa, 0x35, 0xf2, 0xe4, 0x3d, 0x90, - 0x63, 0x88, 0x58, 0xc8, 0x53, 0xa4, 0xa2, 0x54, 0xbe, 0xde, 0x50, 0x4e, 0x8e, 0xab, 0x79, 0x21, - 0xe7, 0xc0, 0xb2, 0x3c, 0xc4, 0x58, 0x9b, 0x7b, 0x36, 0xc1, 0xa6, 0xc0, 0xc9, 0x1f, 0x81, 0xcd, - 0xd8, 0x76, 0x07, 0x86, 0x10, 0xe5, 0xa5, 0x25, 0xc9, 0x1b, 0x71, 0x8a, 0x88, 0xcb, 0x79, 0xb0, - 0xea, 0xfa, 0x0a, 0x94, 0x95, 0xa2, 0x54, 0xce, 0x9a, 0xe1, 0x42, 0xde, 0x06, 0xb9, 0x21, 0x61, - 0xb0, 0x8f, 0x94, 0x6c, 0x51, 0x2a, 0x5f, 0x33, 0xc5, 0xaa, 0xfe, 0xd6, 0x0f, 0x8f, 0x0b, 0x99, - 0xff, 0x1e, 0x17, 0x32, 0xdf, 0x9d, 0x1d, 0x55, 0x84, 0x92, 0x1f, 0xcf, 0x8e, 0x2a, 0xeb, 0xfe, - 0xb7, 0x4d, 0xf8, 0x29, 0xdd, 0x00, 0x5b, 0x89, 0xa5, 0x89, 0x98, 0x4b, 0x09, 0x43, 0xa5, 0xdf, - 0x24, 0x20, 0x37, 0x19, 0x36, 0x91, 0x43, 0x47, 0xe8, 0x41, 0xa4, 0xe5, 0x85, 0xb9, 0xaf, 0xeb, - 0x73, 0xfc, 0x6c, 0x0b, 0x3f, 0x29, 0xa1, 0xa5, 0xd7, 0x80, 0x7a, 0x3e, 0x1a, 0xbb, 0xfb, 0x55, - 0x02, 0x1b, 0xf1, 0x76, 0x0b, 0x11, 0xcb, 0x26, 0xf8, 0xc5, 0x79, 0xdb, 0x9d, 0xe3, 0x2d, 0x3f, - 0xe5, 0x4d, 0xc8, 0x2c, 0xa9, 0x40, 0x49, 0xc7, 0x62, 0x5f, 0xbf, 0x48, 0x60, 0xbd, 0xc9, 0xf0, - 0x7d, 0xd7, 0x82, 0x1c, 0xb5, 0x82, 0xf6, 0xb9, 0x82, 0xad, 0x03, 0x90, 0x0b, 0x5b, 0x2f, 0xf0, - 0xb2, 0xb6, 0xbf, 0xa3, 0x2f, 0x98, 0x07, 0x7a, 0x58, 0xa6, 0x91, 0x7d, 0xf2, 0xac, 0x90, 0x31, - 0x45, 0x62, 0x7d, 0x27, 0x65, 0x65, 0x4b, 0x58, 0x49, 0x2a, 0x2b, 0xdd, 0x02, 0x37, 0x53, 0xa1, - 0xd8, 0xc8, 0xef, 0x12, 0xd8, 0x8e, 0xf7, 0xda, 0x1c, 0x1e, 0xda, 0x04, 0x5f, 0xd9, 0xcf, 0xa7, - 0x29, 0x3f, 0x95, 0x85, 0x7e, 0xa6, 0xaa, 0xa5, 0x6c, 0x55, 0x52, 0xb6, 0xd4, 0x29, 0x5b, 0x53, - 0x99, 0xa5, 0x22, 0xd0, 0x66, 0xef, 0xc4, 0x26, 0xff, 0xc8, 0x06, 0x3d, 0x76, 0xc7, 0x43, 0x90, - 0x27, 0x7a, 0xec, 0x3e, 0x58, 0xb3, 0x10, 0xeb, 0x79, 0xb6, 0xcb, 0x6d, 0x4a, 0x02, 0x97, 0x6b, - 0xfb, 0xe5, 0x85, 0x9a, 0xef, 0x3e, 0xc7, 0x37, 0xae, 0xfb, 0x8a, 0x7f, 0x3e, 0x3b, 0xaa, 0x48, - 0x66, 0x92, 0x47, 0xfe, 0x02, 0x80, 0x1e, 0x75, 0x1c, 0x9b, 0x31, 0x9f, 0x35, 0xfc, 0x12, 0xbb, - 0x0b, 0x59, 0xef, 0xc4, 0x70, 0x13, 0x72, 0xc4, 0x92, 0xcc, 0x09, 0x2a, 0xf9, 0x2b, 0xb0, 0xe5, - 0xd8, 0xa4, 0xc3, 0xd0, 0xa0, 0xdf, 0xb1, 0xd0, 0x00, 0x61, 0x18, 0xe8, 0x5e, 0x09, 0x4e, 0x67, - 0xcf, 0xcf, 0xf9, 0xfb, 0x59, 0xe1, 0x46, 0x78, 0x42, 0xcc, 0x3a, 0xd4, 0x6d, 0x6a, 0x38, 0x90, - 0x3f, 0xd4, 0xef, 0x11, 0x7e, 0x72, 0x5c, 0x05, 0xe2, 0xe8, 0xee, 0x11, 0x1e, 0x52, 0x6f, 0x3a, - 0x36, 0x69, 0xa3, 0x41, 0xff, 0x6e, 0x4c, 0x25, 0x7f, 0x02, 0x36, 0x05, 0x71, 0xa2, 0xcf, 0xb2, - 0x01, 0xbf, 0x3a, 0xef, 0xf4, 0x15, 0xc9, 0xdc, 0x88, 0x93, 0xa2, 0x19, 0xfa, 0xf9, 0xac, 0x86, - 0x5d, 0x0d, 0x88, 0xde, 0x38, 0x39, 0xae, 0xbe, 0x2e, 0x88, 0x1e, 0xa4, 0x3a, 0x74, 0xee, 0x4c, - 0xfe, 0x18, 0xe4, 0xdc, 0x61, 0xf7, 0x10, 0x8d, 0x95, 0x5c, 0xf0, 0x3d, 0xf3, 0x7a, 0xf8, 0x14, - 0xe9, 0xd1, 0x53, 0xa4, 0x1f, 0x90, 0x71, 0x43, 0xf9, 0xf3, 0xb9, 0xc6, 0x9e, 0x37, 0x76, 0x39, - 0xd5, 0x5b, 0xc3, 0xee, 0x67, 0x68, 0x6c, 0x8a, 0xec, 0xfa, 0xfb, 0xc9, 0x09, 0x70, 0x5e, 0x62, - 0x72, 0xd0, 0xa5, 0x6e, 0x8b, 0x18, 0x74, 0xa9, 0x68, 0x74, 0xc5, 0xf6, 0x27, 0xab, 0x60, 0xa5, - 0xc9, 0xb0, 0xfc, 0x08, 0xac, 0xa7, 0xaf, 0x99, 0xb1, 0xf0, 0xec, 0xcf, 0x73, 0xaa, 0xef, 0x5d, - 0x32, 0x21, 0x12, 0x21, 0xf7, 0xc1, 0xb5, 0xf8, 0xf9, 0x2c, 0x2f, 0x23, 0x89, 0x90, 0xea, 0xde, - 0x45, 0x91, 0x71, 0x9d, 0x47, 0x60, 0x3d, 0xfd, 0x5e, 0x2d, 0x35, 0x99, 0x4a, 0x58, 0x6e, 0x72, - 0xce, 0x93, 0x22, 0x0f, 0xc1, 0x2b, 0xd3, 0xcf, 0x49, 0xf5, 0x62, 0x4c, 0x02, 0xae, 0xbe, 0x7b, - 0x29, 0x78, 0x5c, 0xd6, 0x03, 0x2f, 0x4f, 0x4d, 0xfb, 0xdd, 0x65, 0x34, 0x49, 0xb4, 0xfa, 0xce, - 0x65, 0xd0, 0x71, 0xcd, 0xef, 0x25, 0xb0, 0x35, 0x6b, 0x32, 0xdf, 0xbe, 0x18, 0xdb, 0x54, 0x92, - 0xfa, 0xc1, 0x15, 0x92, 0x22, 0x25, 0xea, 0xea, 0xb7, 0xfe, 0xc8, 0x68, 0x7c, 0xf8, 0xe4, 0x54, - 0x93, 0x9e, 0x9e, 0x6a, 0xd2, 0xbf, 0xa7, 0x9a, 0xf4, 0xd3, 0x44, 0xcb, 0x3c, 0x9d, 0x68, 0x99, - 0xbf, 0x26, 0x5a, 0xe6, 0xcb, 0x1d, 0x6c, 0xf3, 0x87, 0xc3, 0xae, 0xde, 0xa3, 0x8e, 0x91, 0xa8, - 0x53, 0x4d, 0xfe, 0xd4, 0xec, 0xe6, 0x82, 0x6e, 0xbd, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xfb, 0x9f, 0x59, 0x73, 0x1d, 0x0b, 0x00, 0x00, + 0x14, 0x8e, 0x69, 0x1a, 0xed, 0x4e, 0x84, 0xda, 0xb8, 0xd9, 0x62, 0x0c, 0x38, 0x21, 0x20, 0x11, + 0x85, 0x8d, 0xdd, 0x74, 0x85, 0x10, 0x41, 0x1c, 0x36, 0xbb, 0xfc, 0x58, 0xa1, 0xa0, 0xc8, 0xd1, + 0x2e, 0x12, 0x97, 0x30, 0x89, 0x27, 0xb3, 0x56, 0xe3, 0x19, 0xcb, 0x33, 0x09, 0x44, 0x7b, 0x41, + 0x5c, 0x40, 0x9c, 0xf8, 0x13, 0xf6, 0xc8, 0xb1, 0x87, 0x5e, 0x38, 0x20, 0x21, 0x4e, 0x15, 0xa7, + 0xaa, 0x27, 0x84, 0x44, 0x85, 0xda, 0x43, 0xb9, 0xf1, 0x2f, 0xac, 0x6c, 0x8f, 0x5d, 0xd7, 0xcd, + 0x8f, 0xb6, 0x97, 0x5e, 0xa2, 0xcc, 0x9b, 0xf7, 0x7d, 0xef, 0xfb, 0x66, 0xde, 0xbc, 0x04, 0xbc, + 0xcd, 0xb8, 0x07, 0x09, 0x46, 0x23, 0x3a, 0x41, 0xbd, 0x09, 0x22, 0x7c, 0xec, 0x21, 0x66, 0xb8, + 0x14, 0x1a, 0x93, 0x86, 0xc1, 0xbf, 0xd5, 0x5d, 0x8f, 0x72, 0x2a, 0xbf, 0x36, 0x2b, 0x4b, 0x77, + 0x29, 0xd4, 0x27, 0x0d, 0x55, 0x1b, 0x50, 0xe6, 0x50, 0x66, 0xf4, 0x21, 0x43, 0xc6, 0xa4, 0xd1, + 0x47, 0x1c, 0x36, 0x8c, 0x01, 0xb5, 0x49, 0x08, 0x56, 0xdf, 0x5d, 0x54, 0x62, 0x02, 0x47, 0xb6, + 0x05, 0x39, 0xf5, 0x44, 0x72, 0x75, 0x51, 0xb2, 0x0b, 0x3d, 0xe8, 0x30, 0x91, 0xf9, 0x6a, 0x58, + 0xb6, 0x17, 0xac, 0x8c, 0x70, 0x11, 0x6d, 0x61, 0x4a, 0xf1, 0x08, 0x19, 0xc1, 0xaa, 0x3f, 0x1e, + 0x1a, 0x90, 0x4c, 0xc5, 0x56, 0x11, 0x53, 0x4c, 0x43, 0x88, 0xff, 0x4d, 0x44, 0x5f, 0x11, 0x16, + 0x1c, 0x86, 0xfd, 0x3a, 0x0e, 0xc3, 0x62, 0xa3, 0x00, 0x1d, 0x9b, 0x50, 0x23, 0xf8, 0x0c, 0x43, + 0x95, 0x7f, 0x24, 0x90, 0x6f, 0x33, 0xdc, 0x45, 0xbc, 0x43, 0xbf, 0x41, 0x9e, 0xbc, 0x05, 0x72, + 0x0c, 0x11, 0x0b, 0x79, 0x8a, 0x54, 0x96, 0xaa, 0xb7, 0x5b, 0xca, 0xe1, 0x5e, 0xbd, 0x28, 0xe4, + 0xdc, 0xb7, 0x2c, 0x0f, 0x31, 0xd6, 0xe5, 0x9e, 0x4d, 0xb0, 0x29, 0xf2, 0xe4, 0x8f, 0x41, 0x21, + 0xb6, 0xdd, 0x83, 0x61, 0x8a, 0xf2, 0xd2, 0x12, 0xf0, 0x7a, 0x0c, 0x11, 0x71, 0xb9, 0x08, 0x56, + 0x5d, 0x5f, 0x81, 0xb2, 0x52, 0x96, 0xaa, 0x59, 0x33, 0x5c, 0xc8, 0x9b, 0x20, 0x37, 0x26, 0x0c, + 0x0e, 0x91, 0x92, 0x2d, 0x4b, 0xd5, 0x5b, 0xa6, 0x58, 0x35, 0xdf, 0xf9, 0xf1, 0x79, 0x29, 0xf3, + 0xdf, 0xf3, 0x52, 0xe6, 0xfb, 0xd3, 0xdd, 0x9a, 0x50, 0xf2, 0xd3, 0xe9, 0x6e, 0x6d, 0xcd, 0x3f, + 0xdb, 0x84, 0x9f, 0xca, 0x1d, 0xb0, 0x91, 0x58, 0x9a, 0x88, 0xb9, 0x94, 0x30, 0x54, 0xf9, 0x4d, + 0x02, 0x72, 0x9b, 0x61, 0x13, 0x39, 0x74, 0x82, 0x9e, 0x44, 0x5a, 0x6e, 0xcc, 0x7d, 0x53, 0x9f, + 0xe3, 0x67, 0x53, 0xf8, 0x49, 0x09, 0xad, 0xbc, 0x0e, 0xd4, 0x8b, 0xd1, 0xd8, 0xdd, 0xaf, 0x12, + 0x58, 0x8f, 0xb7, 0x3b, 0x88, 0x58, 0x36, 0xc1, 0x37, 0xe7, 0xed, 0xee, 0x1c, 0x6f, 0xc5, 0x73, + 0xde, 0x84, 0xcc, 0x8a, 0x0a, 0x94, 0x74, 0x2c, 0xf6, 0xf5, 0xbb, 0x04, 0x36, 0xdb, 0x0c, 0x3f, + 0x76, 0x2d, 0xc8, 0x51, 0x97, 0xc3, 0x1d, 0x9b, 0xe0, 0x4e, 0xf0, 0x8a, 0xae, 0xe1, 0xee, 0x33, + 0x90, 0x0b, 0x5f, 0x60, 0x60, 0x29, 0xbf, 0x5d, 0xd3, 0x17, 0x8c, 0x05, 0xfd, 0x5c, 0xb5, 0x56, + 0x76, 0xff, 0xa8, 0x94, 0x31, 0x05, 0xbe, 0x59, 0x4b, 0x19, 0x53, 0x85, 0xb1, 0x19, 0x3a, 0x2b, + 0x65, 0xa0, 0xcd, 0xde, 0x89, 0x4d, 0xfe, 0x91, 0x0d, 0x5a, 0xf3, 0x81, 0x87, 0x20, 0x4f, 0xb4, + 0xe6, 0x63, 0x90, 0xb7, 0x10, 0x1b, 0x78, 0xb6, 0xcb, 0x6d, 0x4a, 0x02, 0x97, 0xf9, 0xed, 0xea, + 0x42, 0xcd, 0x0f, 0xcf, 0xf2, 0x5b, 0xb7, 0x7d, 0xc5, 0xbf, 0x9c, 0xee, 0xd6, 0x24, 0x33, 0xc9, + 0x23, 0x7f, 0x09, 0xc0, 0x80, 0x3a, 0x8e, 0xcd, 0x98, 0xcf, 0x1a, 0x9e, 0xc4, 0xdd, 0x85, 0xac, + 0x0f, 0xe2, 0x74, 0x13, 0x72, 0xc4, 0x92, 0xcc, 0x09, 0x2a, 0xf9, 0x6b, 0xb0, 0xe1, 0xd8, 0xa4, + 0xc7, 0xd0, 0x68, 0xd8, 0xb3, 0xd0, 0x08, 0x61, 0x18, 0xe8, 0x5e, 0x09, 0x6e, 0x67, 0xcb, 0xc7, + 0xfc, 0x7d, 0x54, 0xba, 0x13, 0xde, 0x10, 0xb3, 0x76, 0x74, 0x9b, 0x1a, 0x0e, 0xe4, 0x4f, 0xf5, + 0x47, 0x84, 0x1f, 0xee, 0xd5, 0x81, 0xb8, 0xba, 0x47, 0x84, 0x87, 0xd4, 0x05, 0xc7, 0x26, 0x5d, + 0x34, 0x1a, 0x3e, 0x8c, 0xa9, 0xe4, 0x4f, 0x41, 0x41, 0x10, 0x27, 0xda, 0x33, 0x1b, 0xf0, 0xab, + 0xf3, 0x6e, 0x5f, 0x91, 0xcc, 0xf5, 0x18, 0x14, 0x8d, 0x9e, 0x2f, 0x66, 0xf5, 0xf9, 0x6a, 0x40, + 0xf4, 0xe6, 0xe1, 0x5e, 0xfd, 0x0d, 0x41, 0xf4, 0x24, 0xd5, 0xd8, 0x73, 0x47, 0xd9, 0x27, 0x20, + 0xe7, 0x8e, 0xfb, 0x3b, 0x68, 0xaa, 0xe4, 0x82, 0xf3, 0x2c, 0xea, 0xe1, 0x04, 0xd7, 0xa3, 0x09, + 0xae, 0xdf, 0x27, 0xd3, 0x96, 0xf2, 0xe7, 0x99, 0xc6, 0x81, 0x37, 0x75, 0x39, 0xd5, 0x3b, 0xe3, + 0xfe, 0xe7, 0x68, 0x6a, 0x0a, 0x74, 0xf3, 0x83, 0xe4, 0xc3, 0xb9, 0x28, 0x31, 0x39, 0x1f, 0x52, + 0xdd, 0x22, 0xe6, 0x43, 0x2a, 0x1a, 0xb5, 0xd8, 0xf6, 0xff, 0x59, 0xb0, 0xd2, 0x66, 0x58, 0x7e, + 0x06, 0xd6, 0xd2, 0x6d, 0x66, 0x2c, 0xbc, 0xfb, 0x8b, 0x9c, 0xea, 0xfb, 0x57, 0x04, 0x44, 0x22, + 0xe4, 0x21, 0xb8, 0x15, 0xff, 0xea, 0x54, 0x97, 0x91, 0x44, 0x99, 0xea, 0xd6, 0x65, 0x33, 0xe3, + 0x3a, 0xcf, 0xc0, 0x5a, 0x7a, 0xcc, 0x2f, 0x35, 0x99, 0x02, 0x2c, 0x37, 0x39, 0x67, 0x12, 0xcb, + 0x63, 0xf0, 0xf2, 0xf9, 0x29, 0x5c, 0xbf, 0x1c, 0x93, 0x48, 0x57, 0xdf, 0xbb, 0x52, 0x7a, 0x5c, + 0xf6, 0x07, 0x09, 0x6c, 0xcc, 0x9a, 0x92, 0xf7, 0x96, 0xd1, 0xcd, 0x00, 0xa9, 0x1f, 0x5e, 0x03, + 0x14, 0x29, 0x51, 0x57, 0xbf, 0xf3, 0x9f, 0x6f, 0xeb, 0xa3, 0xfd, 0x63, 0x4d, 0x3a, 0x38, 0xd6, + 0xa4, 0x7f, 0x8f, 0x35, 0xe9, 0xe7, 0x13, 0x2d, 0x73, 0x70, 0xa2, 0x65, 0xfe, 0x3a, 0xd1, 0x32, + 0x5f, 0xbd, 0x85, 0x6d, 0xfe, 0x74, 0xdc, 0xd7, 0x07, 0xd4, 0x31, 0x12, 0x75, 0xea, 0xc9, 0x7f, + 0x4b, 0xfd, 0x5c, 0xf0, 0x72, 0xee, 0xbd, 0x08, 0x00, 0x00, 0xff, 0xff, 0x89, 0x2b, 0x71, 0x78, + 0xe0, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -637,8 +538,6 @@ type MsgClient interface { RemoveValidator(ctx context.Context, in *MsgRemoveValidator, opts ...grpc.CallOption) (*MsgRemoveValidatorResponse, error) // RemovePending removes a pending validator from the queue. RemovePending(ctx context.Context, in *MsgRemovePending, opts ...grpc.CallOption) (*MsgRemovePendingResponse, error) - // UpdateParams updates the module parameters. - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) // UpdateStakingParams updates the module parameters. UpdateStakingParams(ctx context.Context, in *MsgUpdateStakingParams, opts ...grpc.CallOption) (*MsgUpdateStakingParamsResponse, error) } @@ -687,15 +586,6 @@ func (c *msgClient) RemovePending(ctx context.Context, in *MsgRemovePending, opt return out, nil } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/strangelove_ventures.poa.v1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) UpdateStakingParams(ctx context.Context, in *MsgUpdateStakingParams, opts ...grpc.CallOption) (*MsgUpdateStakingParamsResponse, error) { out := new(MsgUpdateStakingParamsResponse) err := c.cc.Invoke(ctx, "/strangelove_ventures.poa.v1.Msg/UpdateStakingParams", in, out, opts...) @@ -715,8 +605,6 @@ type MsgServer interface { RemoveValidator(context.Context, *MsgRemoveValidator) (*MsgRemoveValidatorResponse, error) // RemovePending removes a pending validator from the queue. RemovePending(context.Context, *MsgRemovePending) (*MsgRemovePendingResponse, error) - // UpdateParams updates the module parameters. - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) // UpdateStakingParams updates the module parameters. UpdateStakingParams(context.Context, *MsgUpdateStakingParams) (*MsgUpdateStakingParamsResponse, error) } @@ -737,9 +625,6 @@ func (*UnimplementedMsgServer) RemoveValidator(ctx context.Context, req *MsgRemo func (*UnimplementedMsgServer) RemovePending(ctx context.Context, req *MsgRemovePending) (*MsgRemovePendingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemovePending not implemented") } -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} func (*UnimplementedMsgServer) UpdateStakingParams(ctx context.Context, req *MsgUpdateStakingParams) (*MsgUpdateStakingParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateStakingParams not implemented") } @@ -820,24 +705,6 @@ func _Msg_RemovePending_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/strangelove_ventures.poa.v1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_UpdateStakingParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateStakingParams) if err := dec(in); err != nil { @@ -876,10 +743,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RemovePending", Handler: _Msg_RemovePending_Handler, }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, { MethodName: "UpdateStakingParams", Handler: _Msg_UpdateStakingParams_Handler, @@ -1084,69 +947,6 @@ func (m *MsgRemovePendingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *MsgUpdateStakingParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1407,30 +1207,6 @@ func (m *MsgRemovePendingResponse) Size() (n int) { return n } -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgUpdateStakingParams) Size() (n int) { if m == nil { return 0 @@ -2028,171 +1804,6 @@ func (m *MsgRemovePendingResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgUpdateStakingParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From f253413b5fadeba580d01e83738e5fea61749c79 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 16 Jul 2024 21:00:11 -0500 Subject: [PATCH 05/19] wip: testing --- README.md | 36 ------------------------------------ e2e/poa_test.go | 7 +++---- e2e/setup.go | 11 ++++------- keeper/genesis_test.go | 1 - keeper/keeper.go | 6 ++++++ 5 files changed, 13 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index a9568c4..3f4d85b 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,6 @@ All delegation actions are disabled with the [disabled-staking ante](./INTEGRATI ## State -### Genesis -`Params` is found in the genesis state. This object contains the `admins` field, which is a list of bech32 addresses that are allowed to modify the validator set, PoA params, and validator params (via x/staking). If no admin is set, then the chain should set the governance account as the admin (default). By allowing for an array of admins, the chain can be controlled by multiple different parties according to your use case. For example, governance can be an admin while also allowing a multisig, DAO, and/or single account to control the validator set. There must be at least one admin in the list at all times. - -`AllowValidatorSelfExit` is a boolean option *(default true)* that toggles validators ability to remove themselves from the active set. This is useful for validators that are no longer able or decide this PoA network is no longer for them. If set to false, only admins can remove validators from the set. **NOTE** This does not stop validators from going down and being jailed for downtime. It just provides a graceful way to self remove power. - ### Pending Validators `PendingValidators` stores an array of PoA validator objects pending approval (from the admins) into the active set. This only is required after the chain has started. @@ -125,26 +120,6 @@ The `AbsoluteChangedPower` of +1 to each validator is 3, which is 33% of the pre } ``` -### UpdateParams (admin only) - -- `admins` is a list of bech32 addresses that control the validator set and parameters of the chain. -- `allow_validator_self_exit` allows validators to force remove themselves from the active set at any time. - -```json -{ - "@type": "/strangelove_ventures.poa.v1.MsgUpdateParams", - "sender": "cosmos1addr", - "params": { - "admins": [ - "cosmos1addr", - "cosmos1addr1", - "cosmos1addr2", - ], - "allow_validator_self_exit": true - } -} -``` - ### UpdateStakingParams (admin only) ```json { @@ -176,7 +151,6 @@ A validator is removed by an admin at height H; it increases the minimum self de | LCD / API | gRPC | |------------------------------|-----------------------------------------------------| -| `/poa/v1/params` |`strangelove_ventures.poa.v1.Query/Params` | | `/poa/v1/pending_validators` |`strangelove_ventures.poa.v1.Query/PendingValidators`| | `/poa/v1/{consensus_power}` |`strangelove_ventures.poa.v1.Query/ConsensusPower` | @@ -189,9 +163,6 @@ A user can query and interact with the `poa` module using the CLI. The `query` commands allow users to query the `poa` state. ```bash -# Get module params (admins list) -poad q poa params - # Get validators waiting to be added to the set poad q poa pending-validators @@ -222,13 +193,6 @@ poad tx poa remove [validator] # - --unsafe flag allows for bypassing the 30% max change per block poad tx poa set-power [validator] [amount] [--unsafe] -# (admin) Update the PoA module params -# - admins is a comma separated list of bech32 addresses -# - any admin can modify the list at any time -# - there must be at least one admin in the list at all times -# - allow_validator_self_exit is a bool to allow validators to force remove themselves from the set. -poad tx poa update-params [allow_validator_self_exit] - # (admin) Update the staking module params # - unbondingTime is the time that a validator must wait to unbond (ex: 336h) # - maxVals is the maximum number of validators for the active set. diff --git a/e2e/poa_test.go b/e2e/poa_test.go index 3ee32d7..91aaf3d 100644 --- a/e2e/poa_test.go +++ b/e2e/poa_test.go @@ -18,7 +18,6 @@ func TestPOABase(t *testing.T) { t.Skip("skipping in short mode") } - // setup base chain chains := interchaintest.CreateChainWithConfig(t, numVals, numNodes, "poa", "", POACfg) chain := chains[0].(*cosmos.CosmosChain) @@ -74,16 +73,16 @@ func testStakingDisabled(t *testing.T, ctx context.Context, chain *cosmos.Cosmos require.Contains(t, res.RawLog, poa.ErrStakingActionNotAllowed.Error()) } -func testRemovePending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0 ibc.Wallet) { +func testRemovePending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, admin ibc.Wallet) { t.Log("\n===== TEST PENDING =====") - _, err := helpers.POACreatePendingValidator(t, ctx, chain, acc0, "pl3Q8OQwtC7G2dSqRqsUrO5VZul7l40I+MKUcejqRsg=", "testval", "0.10", "0.25", "0.05") + _, err := helpers.POACreatePendingValidator(t, ctx, chain, admin, "pl3Q8OQwtC7G2dSqRqsUrO5VZul7l40I+MKUcejqRsg=", "testval", "0.10", "0.25", "0.05") require.NoError(t, err) pv := helpers.GetPOAPending(t, ctx, chain).Pending require.Equal(t, 1, len(pv)) - _, err = helpers.POARemovePending(t, ctx, chain, acc0, pv[0].OperatorAddress) + _, err = helpers.POARemovePending(t, ctx, chain, admin, pv[0].OperatorAddress) require.NoError(t, err) // validate it was removed diff --git a/e2e/setup.go b/e2e/setup.go index e094c68..94355e2 100644 --- a/e2e/setup.go +++ b/e2e/setup.go @@ -2,6 +2,7 @@ package e2e import ( "context" + "fmt" "testing" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" @@ -24,13 +25,6 @@ var ( } defaultGenesis = []cosmos.GenesisKV{ - { - Key: "app_state.poa.params.admins", - Value: []string{ - "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", // gov - "cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr", // testing account - }, - }, { Key: "app_state.gov.params.voting_period", Value: VotingPeriod, @@ -65,6 +59,9 @@ var ( CoinType: "118", GasPrices: "0" + Denom, TrustingPeriod: "330h", + Env: []string{ + fmt.Sprintf("POA_ADMIN_ADDRESS=%s", "cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr"), // acc0 / admin + }, } ) diff --git a/keeper/genesis_test.go b/keeper/genesis_test.go index c097e7d..f3defd3 100644 --- a/keeper/genesis_test.go +++ b/keeper/genesis_test.go @@ -43,6 +43,5 @@ func TestInitGenesis(t *testing.T) { require.Len(state.Vals, len(exported.Vals)) require.Equal(state.Vals[0].OperatorAddress, exported.Vals[0].OperatorAddress) - }) } diff --git a/keeper/keeper.go b/keeper/keeper.go index b6792b1..d63a7ec 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "os" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -54,6 +55,11 @@ func NewKeeper( sb := collections.NewSchemaBuilder(storeService) + if address := os.Getenv("POA_ADMIN_ADDRESS"); address != "" { + adminAuthority = address + logger.Info("admin authority override from environment variable `POA_ADMIN_ADDRESS`", "address", adminAuthority) + } + k := Keeper{ cdc: cdc, stakingKeeper: sk, From 850903a3f560f607dcf6b94521d870a93f73ecdc Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 16 Jul 2024 21:22:29 -0500 Subject: [PATCH 06/19] rm gov test which is no longer required --- .github/workflows/e2e.yaml | 1 - Makefile | 3 - e2e/Makefile | 5 +- e2e/poa_gov_test.go | 116 ------------------------------------- e2e/poa_test.go | 49 ++++++++++++++++ 5 files changed, 50 insertions(+), 124 deletions(-) delete mode 100644 e2e/poa_gov_test.go diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 74e8771..8330196 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -54,7 +54,6 @@ jobs: - "ictest-jail" - "ictest-val-add" - "ictest-val-remove" - - "ictest-gov" fail-fast: false steps: diff --git a/Makefile b/Makefile index 682b862..8965161 100644 --- a/Makefile +++ b/Makefile @@ -35,9 +35,6 @@ ictest-val-add: ictest-val-remove: $(MAKE) -C e2e/ ictest-val-remove -ictest-gov: - $(MAKE) -C e2e/ ictest-gov - .PHONY: test ictest-poa ictest-jail ictest-val-add ictest-val-remove coverage: ## Run coverage report diff --git a/e2e/Makefile b/e2e/Makefile index bb1c9ee..1f0dfc1 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -8,7 +8,4 @@ ictest-val-add: go clean -testcache && go test -race -v -run TestPOAAddValidator . ictest-val-remove: - go clean -testcache && go test -race -v -run TestPOARemoval . - -ictest-gov: - go clean -testcache && go test -race -v -run TestPOAGovernance . \ No newline at end of file + go clean -testcache && go test -race -v -run TestPOARemoval . \ No newline at end of file diff --git a/e2e/poa_gov_test.go b/e2e/poa_gov_test.go deleted file mode 100644 index 0fdd846..0000000 --- a/e2e/poa_gov_test.go +++ /dev/null @@ -1,116 +0,0 @@ -package e2e - -import ( - "context" - "fmt" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/strangelove-ventures/interchaintest/v8" - "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v8/ibc" - "github.com/strangelove-ventures/poa/e2e/helpers" - "github.com/stretchr/testify/require" - - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -var ( - GovModuleAddress = "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn" - RandAcc = "cosmos1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnrql8a" -) - -func TestPOAGovernance(t *testing.T) { - if testing.Short() { - t.Skip("skipping in short mode") - } - - // setup base chain - chains := interchaintest.CreateChainWithConfig(t, numVals, numNodes, "poa", "", POACfg) - chain := chains[0].(*cosmos.CosmosChain) - - enableBlockDB := false - ctx, _, _, _ := interchaintest.BuildInitialChain(t, chains, enableBlockDB) - - // setup accounts - acc0, err := interchaintest.GetAndFundTestUserWithMnemonic(ctx, "acc0", accMnemonic, userFunds, chain) - if err != nil { - t.Fatal(err) - } - - users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), userFunds, chain) - incorrectUser := users[0] - - // get validator operator addresses - validators := helpers.GetValidatorsOperatingAddresses(t, ctx, chain) - require.Equal(t, len(validators), numVals) - assertSignatures(t, ctx, chain, len(validators)) - assertConsensus(t, ctx, chain, len(validators)) - - // === Test Cases === - testUpdatePOAParams(t, ctx, chain, acc0, incorrectUser) - testGovernance(t, ctx, chain, acc0, validators) -} - -func testGovernance(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0 ibc.Wallet, validators []string) { - t.Log("\n===== TEST GOVERNANCE =====") - - t.Run("success: gov proposal validator change", func(t *testing.T) { - // ibc.ChainConfig key: app_state.poa.params.admins must contain the governance address. - powerAmt := uint64(1_234_567) - propID := helpers.SubmitGovernanceProposalForValidatorChanges(t, ctx, chain, acc0, validators[0], powerAmt, true, GovModuleAddress) - helpers.ValidatorVote(t, ctx, chain, propID, cosmos.ProposalVoteYes, 25) - - // validate the validator[0] was set to powerAmt - val := helpers.GetValidators(t, ctx, chain).Validators[0] - require.Equal(t, val.Tokens, "1234567") - p := helpers.GetPOAConsensusPower(t, ctx, chain, val.OperatorAddress) - require.EqualValues(t, powerAmt/1_000_000, p, "Validator[0] should have 1 consensus power") - }) -} - -func testUpdatePOAParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0, incorrectUser ibc.Wallet) { - var tx sdk.TxResponse - var err error - - t.Log("\n===== TEST UPDATE POA PARAMS =====") - - t.Run("fail: update staking params from a non authorized user", func(t *testing.T) { - tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, incorrectUser, stakingtypes.DefaultParams()) - if err != nil { - t.Fatal(err) - } - txRes, err := chain.GetTransaction(tx.TxHash) - require.NoError(t, err) - fmt.Printf("%+v", txRes) - require.EqualValues(t, txRes.Code, 3) - - sp := helpers.GetStakingParams(t, ctx, chain) - fmt.Printf("%+v", sp) - }) - - t.Run("success: update staking params from an authorized user.", func(t *testing.T) { - stakingparams := stakingtypes.DefaultParams() - tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, acc0, stakingtypes.Params{ - UnbondingTime: stakingparams.UnbondingTime, - MaxValidators: 10, - MaxEntries: stakingparams.MaxEntries, - HistoricalEntries: stakingparams.HistoricalEntries, - BondDenom: stakingparams.BondDenom, - MinCommissionRate: stakingparams.MinCommissionRate, - }) - if err != nil { - t.Fatal(err) - } - - txRes, err := chain.GetTransaction(tx.TxHash) - require.NoError(t, err) - fmt.Printf("%+v", txRes) - require.EqualValues(t, txRes.Code, 0) - - sp := helpers.GetStakingParams(t, ctx, chain) - fmt.Printf("%+v", sp) - require.EqualValues(t, sp.MaxValidators, 10) - }) - -} diff --git a/e2e/poa_test.go b/e2e/poa_test.go index 91aaf3d..dfeb071 100644 --- a/e2e/poa_test.go +++ b/e2e/poa_test.go @@ -2,9 +2,11 @@ package e2e import ( "context" + "fmt" "testing" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" @@ -46,9 +48,56 @@ func TestPOABase(t *testing.T) { // === Test Cases === testStakingDisabled(t, ctx, chain, validators, acc0, acc1) testPowerErrors(t, ctx, chain, validators, incorrectUser, acc0) + testUpdateParams(t, ctx, chain, acc0, incorrectUser) testRemovePending(t, ctx, chain, acc0) } +func testUpdateParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0, incorrectUser ibc.Wallet) { + var tx sdk.TxResponse + var err error + + t.Log("\n===== TEST UPDATE POA PARAMS =====") + + t.Run("fail: update staking params from a non authorized user", func(t *testing.T) { + tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, incorrectUser, stakingtypes.DefaultParams()) + if err != nil { + t.Fatal(err) + } + txRes, err := chain.GetTransaction(tx.TxHash) + require.NoError(t, err) + fmt.Printf("%+v", txRes) + require.EqualValues(t, txRes.Code, 3) + + sp := helpers.GetStakingParams(t, ctx, chain) + fmt.Printf("%+v", sp) + }) + + t.Run("success: update staking params from an authorized user.", func(t *testing.T) { + stakingparams := stakingtypes.DefaultParams() + tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, acc0, stakingtypes.Params{ + UnbondingTime: stakingparams.UnbondingTime, + MaxValidators: 10, + MaxEntries: stakingparams.MaxEntries, + HistoricalEntries: stakingparams.HistoricalEntries, + BondDenom: stakingparams.BondDenom, + MinCommissionRate: stakingparams.MinCommissionRate, + }) + if err != nil { + t.Fatal(err) + } + + txRes, err := chain.GetTransaction(tx.TxHash) + require.NoError(t, err) + fmt.Printf("%+v", txRes) + require.EqualValues(t, txRes.Code, 0) + + sp := helpers.GetStakingParams(t, ctx, chain) + fmt.Printf("%+v", sp) + require.EqualValues(t, sp.MaxValidators, 10) + }) + +} + func testStakingDisabled(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, validators []string, acc0, acc1 ibc.Wallet) { t.Log("\n===== TEST STAKING DISABLED =====") // Normal delegation execution fails From 93578c6cd108f2b66a8790e1ada96d644ace3098 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 23 Jul 2024 12:33:37 -0500 Subject: [PATCH 07/19] modify simulation --- simulation/genesis.go | 43 ++------------------------ simulation/operations.go | 67 +++------------------------------------- 2 files changed, 8 insertions(+), 102 deletions(-) diff --git a/simulation/genesis.go b/simulation/genesis.go index 2fe1fc4..fd0e1ab 100644 --- a/simulation/genesis.go +++ b/simulation/genesis.go @@ -3,58 +3,21 @@ package simulation import ( "encoding/json" "fmt" - "math/rand" - "sort" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/strangelove-ventures/poa" ) -const ( - admins = "admins" - allowValSelfExit = "allow_validator_self_exit" -) - func RandomizedGenState(simState *module.SimulationState) { - var ( - adm []string - allowSelfExit bool - ) - - simState.AppParams.GetOrGenerate(admins, &adm, simState.Rand, func(r *rand.Rand) { - // Select a random number of admins from the simState accounts - adminSet := make(map[string]bool) - numAdmins := simulation.RandIntBetween(r, 1, len(simState.Accounts)) - for i := 0; i < numAdmins; i++ { - acc, _ := simulation.RandomAcc(r, simState.Accounts) - adminSet[acc.Address.String()] = true - } - - // Iteration order on map is non-deterministic - for k := range adminSet { - adm = append(adm, k) - } - - // Sort the admin list for determinism - sort.Strings(adm) - }) - - // Allow validator self exit is enabled 50% of the time - simState.AppParams.GetOrGenerate(allowValSelfExit, &allowSelfExit, simState.Rand, func(r *rand.Rand) { allowSelfExit = r.Intn(2) == 1 }) - poaGenesis := poa.GenesisState{ - Params: poa.Params{ - Admins: adm, - AllowValidatorSelfExit: allowSelfExit, - }, + Vals: []poa.Validator{}, } - bz, err := json.MarshalIndent(&poaGenesis.Params, "", " ") + bz, err := json.MarshalIndent(&poaGenesis, "", " ") if err != nil { panic(err) } - fmt.Printf("Selected randomly generated poa parameters:\n%s\n", bz) // nolint: forbidigo + fmt.Printf("Selected randomly generated poa genesis :\n%s\n", bz) // nolint: forbidigo simState.GenState[poa.ModuleName] = simState.Cdc.MustMarshalJSON(&poaGenesis) } diff --git a/simulation/operations.go b/simulation/operations.go index 418158b..2f6d463 100644 --- a/simulation/operations.go +++ b/simulation/operations.go @@ -25,7 +25,6 @@ const ( OpWeightMsgPOASetPower = "op_weight_msg_poa_set_power" // nolint: gosec OpWeightMsgPOARemoveValidator = "op_weight_msg_poa_remove_validator" // nolint: gosec OpWeightMsgPOARemovePendingValidator = "op_weight_msg_poa_remove_pending_validator" // nolint: gosec - OpWeightMsgPOAUpdateParams = "op_weight_msg_poa_update_params" // nolint: gosec OpWeightMsgPOACreateValidator = "op_weight_msg_poa_create_validator" // nolint: gosec ) @@ -35,7 +34,6 @@ var ( OpWeightMsgPOASetPower: 100, OpWeightMsgPOARemoveValidator: 20, OpWeightMsgPOARemovePendingValidator: 100, - OpWeightMsgPOAUpdateParams: 85, OpWeightMsgPOACreateValidator: 100, } ) @@ -72,8 +70,6 @@ func getWeightedOperation(op string, weight int, txGen client.TxConfig, k keeper return simulation.NewWeightedOperation(weight, SimulateMsgRemoveValidator(txGen, k)) case OpWeightMsgPOARemovePendingValidator: return simulation.NewWeightedOperation(weight, SimulateMsgRemovePendingValidator(txGen, k)) - case OpWeightMsgPOAUpdateParams: - return simulation.NewWeightedOperation(weight, SimulateMsgUpdateParams(txGen, k)) case OpWeightMsgPOACreateValidator: return simulation.NewWeightedOperation(weight, SimulateMsgCreateValidator(txGen, k)) default: @@ -129,43 +125,6 @@ func SimulateMsgCreateValidator(txGen client.TxConfig, k keeper.Keeper) simtypes } } -func SimulateMsgUpdateParams(txGen client.TxConfig, k keeper.Keeper) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - msgType := sdk.MsgTypeURL(&poatypes.MsgUpdateParams{}) - - params, err := k.GetParams(ctx) - if err != nil { - return simtypes.NoOpMsg(poatypes.ModuleName, msgType, "unable to get params"), nil, err - } - - admins := params.GetAdmins() - if len(admins) < 2 { - return simtypes.NoOpMsg(poatypes.ModuleName, msgType, "not enough admins found"), nil, nil - } - - // Remove a random admin from the list - idx := r.Intn(len(admins)) - admins[idx] = admins[len(admins)-1] - admins = admins[:len(admins)-1] - - adminAcc, err := selectRandomPOAAccount(r, admins, accs) - if err != nil { - return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err - } - - msg := poatypes.MsgUpdateParams{ - Sender: adminAcc.Address.String(), - Params: poatypes.Params{ - Admins: admins, - AllowValidatorSelfExit: r.Intn(2) == 1, - }, - } - - return genAndDeliverTxWithRandFees(r, app, ctx, txGen, adminAcc, &msg, k) - } -} - func SimulateMsgRemovePendingValidator(txGen client.TxConfig, k keeper.Keeper) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { @@ -182,7 +141,7 @@ func SimulateMsgRemovePendingValidator(txGen client.TxConfig, k keeper.Keeper) s // Pick a random pending validator address valAddr := pending.Validators[r.Intn(len(pending.Validators))].OperatorAddress - adminAcc, err := selectRandomPOAAccount(r, k.GetAdmins(ctx), accs) + adminAcc, err := getPOAAdmin(accs, k.GetAdmin(ctx)) if err != nil { return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err } @@ -215,7 +174,7 @@ func SimulateMsgRemoveValidator(txGen client.TxConfig, k keeper.Keeper) simtypes // Select a random bonded validator to remove validator := validators[r.Intn(len(validators))] - adminAcc, err := selectRandomPOAAccount(r, k.GetAdmins(ctx), accs) + adminAcc, err := getPOAAdmin(accs, k.GetAdmin(ctx)) if err != nil { return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err } @@ -259,7 +218,7 @@ func SimulateMsgSetPower(txGen client.TxConfig, k keeper.Keeper) simtypes.Operat return simtypes.NoOpMsg(poatypes.ModuleName, msgType, errStr), nil, nil } - adminAcc, err := selectRandomPOAAccount(r, k.GetAdmins(ctx), accs) + adminAcc, err := getPOAAdmin(accs, k.GetAdmin(ctx)) if err != nil { return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err } @@ -338,13 +297,8 @@ func getNewPower(r *rand.Rand, k keeper.Keeper, ctx sdk.Context, validator staki return newPowerTokens.Uint64(), "", false } -func selectRandomPOAAccount(r *rand.Rand, admins []string, accs []simtypes.Account) (simtypes.Account, error) { - randomAdminAddr, err := getRandomPOAAdmin(r, admins) - if err != nil { - return simtypes.Account{}, err - } - - acc, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(randomAdminAddr)) +func getPOAAdmin(accs []simtypes.Account, admin string) (simtypes.Account, error) { + acc, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(admin)) if !found { return simtypes.Account{}, errors.New("admin not found in simulator accounts") } @@ -352,17 +306,6 @@ func selectRandomPOAAccount(r *rand.Rand, admins []string, accs []simtypes.Accou return acc, nil } -func getRandomPOAAdmin(r *rand.Rand, admins []string) (string, error) { - if len(admins) == 0 { - return "", errors.New("no admins found") - } - - idx := r.Intn(len(admins)) - admin := admins[idx] - - return admin, nil -} - func generateRandomDescription(r *rand.Rand) poatypes.Description { return poatypes.Description{ Moniker: simtypes.RandStringOfLength(r, 10), From 0695900dae2c9dc861d6e075022a90d1e50df70a Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 23 Jul 2024 12:36:39 -0500 Subject: [PATCH 08/19] remove poa params e2e --- e2e/poa_test.go | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/e2e/poa_test.go b/e2e/poa_test.go index d52aea0..cc062d7 100644 --- a/e2e/poa_test.go +++ b/e2e/poa_test.go @@ -2,11 +2,9 @@ package e2e import ( "context" - "fmt" "testing" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" @@ -49,56 +47,9 @@ func TestPOABase(t *testing.T) { testStakingDisabled(t, ctx, chain, validators, acc0, acc1) testWithdrawDelegatorRewardsDisabled(t, ctx, chain, validators, acc0, acc1) testPowerErrors(t, ctx, chain, validators, incorrectUser, acc0) - testUpdateParams(t, ctx, chain, acc0, incorrectUser) testRemovePending(t, ctx, chain, acc0) } -func testUpdateParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0, incorrectUser ibc.Wallet) { - var tx sdk.TxResponse - var err error - - t.Log("\n===== TEST UPDATE POA PARAMS =====") - - t.Run("fail: update staking params from a non authorized user", func(t *testing.T) { - tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, incorrectUser, stakingtypes.DefaultParams()) - if err != nil { - t.Fatal(err) - } - txRes, err := chain.GetTransaction(tx.TxHash) - require.NoError(t, err) - fmt.Printf("%+v", txRes) - require.EqualValues(t, txRes.Code, 3) - - sp := helpers.GetStakingParams(t, ctx, chain) - fmt.Printf("%+v", sp) - }) - - t.Run("success: update staking params from an authorized user.", func(t *testing.T) { - stakingparams := stakingtypes.DefaultParams() - tx, err = helpers.POAUpdateStakingParams(t, ctx, chain, acc0, stakingtypes.Params{ - UnbondingTime: stakingparams.UnbondingTime, - MaxValidators: 10, - MaxEntries: stakingparams.MaxEntries, - HistoricalEntries: stakingparams.HistoricalEntries, - BondDenom: stakingparams.BondDenom, - MinCommissionRate: stakingparams.MinCommissionRate, - }) - if err != nil { - t.Fatal(err) - } - - txRes, err := chain.GetTransaction(tx.TxHash) - require.NoError(t, err) - fmt.Printf("%+v", txRes) - require.EqualValues(t, txRes.Code, 0) - - sp := helpers.GetStakingParams(t, ctx, chain) - fmt.Printf("%+v", sp) - require.EqualValues(t, sp.MaxValidators, 10) - }) - -} - func testStakingDisabled(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, validators []string, acc0, acc1 ibc.Wallet) { t.Log("\n===== TEST STAKING DISABLED =====") // Normal delegation execution fails From 041b1fd775ca413c04ce99e9e70d740236609916 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Tue, 23 Jul 2024 13:00:01 -0500 Subject: [PATCH 09/19] fix: depinject issue with authority --- .gitignore | 1 + keeper/keeper.go | 4 ++++ module/depinject.go | 12 +++++++++--- simulation/operations.go | 4 +++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c6bccf2..e41e7be 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ debug_container.dot build/ go.work.sum +debug_*.* \ No newline at end of file diff --git a/keeper/keeper.go b/keeper/keeper.go index ba8747a..12e92a5 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -113,6 +113,10 @@ func (k *Keeper) SetTestAccountKeeper(ak AccountKeeper) { k.accountKeeper = ak } +func (k *Keeper) SetTestAuthority(addr string) { + k.authority = addr +} + func (k Keeper) GetAdmin(ctx context.Context) string { return k.authority } diff --git a/module/depinject.go b/module/depinject.go index 5b390a2..be8cf78 100644 --- a/module/depinject.go +++ b/module/depinject.go @@ -13,6 +13,8 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/strangelove-ventures/poa" modulev1 "github.com/strangelove-ventures/poa/api/module/v1" "github.com/strangelove-ventures/poa/keeper" @@ -38,6 +40,7 @@ type ModuleInputs struct { depinject.In Cdc codec.Codec + Config *modulev1.Module StoreService store.KVStoreService AddressCodec address.Codec @@ -45,8 +48,6 @@ type ModuleInputs struct { SlashingKeeper keeper.SlashingKeeper BankKeeper keeper.BankKeeper AccountKeeper keeper.AccountKeeper // for testing - - Authority string } type ModuleOutputs struct { @@ -57,7 +58,12 @@ type ModuleOutputs struct { } func ProvideModule(in ModuleInputs) ModuleOutputs { - k := keeper.NewKeeper(in.Cdc, in.StoreService, in.StakingKeeper, in.SlashingKeeper, in.BankKeeper, log.NewLogger(os.Stderr), in.Authority) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if len(in.Config.Admins) > 0 && in.Config.Admins[0] != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Admins[0]) + } + + k := keeper.NewKeeper(in.Cdc, in.StoreService, in.StakingKeeper, in.SlashingKeeper, in.BankKeeper, log.NewLogger(os.Stderr), authority.String()) k.SetTestAccountKeeper(in.AccountKeeper) // for testing m := NewAppModule(in.Cdc, k) diff --git a/simulation/operations.go b/simulation/operations.go index 2f6d463..d643b2a 100644 --- a/simulation/operations.go +++ b/simulation/operations.go @@ -108,7 +108,7 @@ func SimulateMsgCreateValidator(txGen client.TxConfig, k keeper.Keeper) simtypes // Generate a random self-delegation amount between 1 and balance amount := sdkmath.NewInt(r.Int63n(balance.Amount.Int64()-1) + 1) - if err != nil { + if amount.IsNegative() { return simtypes.NoOpMsg(poatypes.ModuleName, msgType, "unable to generate positive amount"), nil, err } @@ -196,6 +196,8 @@ func SimulateMsgRemoveValidator(txGen client.TxConfig, k keeper.Keeper) simtypes func SimulateMsgSetPower(txGen client.TxConfig, k keeper.Keeper) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + k.SetTestAuthority(accs[0].Address.String()) + msgType := sdk.MsgTypeURL(&poatypes.MsgSetPower{}) validators, err := k.GetStakingKeeper().GetAllValidators(ctx) From 82c2a4c2b6b7ab09a831f9854aedba0c79786c33 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:00:10 -0500 Subject: [PATCH 10/19] depinject 1.0.0 --- e2e/go.mod | 18 +++++++++--------- e2e/go.sum | 36 ++++++++++++++++++------------------ go.mod | 16 ++++++++-------- go.sum | 36 ++++++++++++++++++------------------ 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/e2e/go.mod b/e2e/go.mod index b2e14e2..2a4666e 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -35,7 +35,7 @@ require ( cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.12.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/store v1.1.0 // indirect @@ -233,23 +233,23 @@ require ( go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.20.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.20.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/grpc v1.65.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index e5dea34..37c1e74 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -770,8 +770,8 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= @@ -1935,8 +1935,8 @@ golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45 golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2084,8 +2084,8 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2259,8 +2259,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2275,8 +2275,8 @@ golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2297,8 +2297,8 @@ golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2384,8 +2384,8 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2656,8 +2656,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -2732,8 +2732,8 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/go.mod b/go.mod index abb1dc8..038f2f5 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( cosmossdk.io/api v0.7.5 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.12.0 - cosmossdk.io/depinject v1.0.0-alpha.4 + cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 @@ -35,7 +35,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 google.golang.org/grpc v1.65.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 ) require ( @@ -150,15 +150,15 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/go.sum b/go.sum index d6e537b..c4e2169 100644 --- a/go.sum +++ b/go.sum @@ -760,8 +760,8 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= @@ -1744,8 +1744,8 @@ golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45 golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1893,8 +1893,8 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2065,8 +2065,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2081,8 +2081,8 @@ golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2103,8 +2103,8 @@ golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2190,8 +2190,8 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2456,8 +2456,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -2532,8 +2532,8 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 344ef33557041ce8af48cd86a477d334f6b4da04 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:00:47 -0500 Subject: [PATCH 11/19] lint --- module/depinject.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/depinject.go b/module/depinject.go index be8cf78..78c9a43 100644 --- a/module/depinject.go +++ b/module/depinject.go @@ -6,6 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" @@ -13,8 +15,6 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/strangelove-ventures/poa" modulev1 "github.com/strangelove-ventures/poa/api/module/v1" "github.com/strangelove-ventures/poa/keeper" From aedef77e83017708aa3a9bd74a3922ac3dcaa5c0 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:05:05 -0500 Subject: [PATCH 12/19] Err -> idx 5 --- errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors.go b/errors.go index d8146af..8c36f37 100644 --- a/errors.go +++ b/errors.go @@ -9,5 +9,5 @@ var ( ErrPowerBelowMinimum = sdkerrors.Register(ModuleName, 2, "power must be above 1_000_000") ErrNotAnAuthority = sdkerrors.Register(ModuleName, 3, "not an authority") ErrUnsafePower = sdkerrors.Register(ModuleName, 4, "unsafe: msg.Power is >30%% of total power, set unsafe=true to override") - ErrWithdrawDelegatorRewardsNotAllowed = sdkerrors.Register(ModuleName, 6, "withdraw delegator rewards is not allowed on this chain") + ErrWithdrawDelegatorRewardsNotAllowed = sdkerrors.Register(ModuleName, 5, "withdraw delegator rewards is not allowed on this chain") ) From 4eebaf1396e8616086a00f79cc3313c3f2844638 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:43:04 -0500 Subject: [PATCH 13/19] single authority for depinject --- api/module/v1/module.pulsar.go | 182 ++++++------------ module/depinject.go | 4 +- .../poa/module/v1/module.proto | 4 +- 3 files changed, 65 insertions(+), 125 deletions(-) diff --git a/api/module/v1/module.pulsar.go b/api/module/v1/module.pulsar.go index edd0ee7..3a2df7e 100644 --- a/api/module/v1/module.pulsar.go +++ b/api/module/v1/module.pulsar.go @@ -13,61 +13,15 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_Module_1_list)(nil) - -type _Module_1_list struct { - list *[]string -} - -func (x *_Module_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Module_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Module_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Module_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Module_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Module at list field Admins as it is not of Message kind")) -} - -func (x *_Module_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Module_1_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Module_1_list) IsValid() bool { - return x.list != nil -} - var ( - md_Module protoreflect.MessageDescriptor - fd_Module_admins protoreflect.FieldDescriptor + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor ) func init() { file_strangelove_ventures_poa_module_v1_module_proto_init() md_Module = File_strangelove_ventures_poa_module_v1_module_proto.Messages().ByName("Module") - fd_Module_admins = md_Module.Fields().ByName("admins") + fd_Module_authority = md_Module.Fields().ByName("authority") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -135,9 +89,9 @@ func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Admins) != 0 { - value := protoreflect.ValueOfList(&_Module_1_list{list: &x.Admins}) - if !f(fd_Module_admins, value) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { return } } @@ -156,8 +110,8 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "strangelove_ventures.poa.module.v1.Module.admins": - return len(x.Admins) != 0 + case "strangelove_ventures.poa.module.v1.Module.authority": + return x.Authority != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.module.v1.Module")) @@ -174,8 +128,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "strangelove_ventures.poa.module.v1.Module.admins": - x.Admins = nil + case "strangelove_ventures.poa.module.v1.Module.authority": + x.Authority = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.module.v1.Module")) @@ -192,12 +146,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "strangelove_ventures.poa.module.v1.Module.admins": - if len(x.Admins) == 0 { - return protoreflect.ValueOfList(&_Module_1_list{}) - } - listValue := &_Module_1_list{list: &x.Admins} - return protoreflect.ValueOfList(listValue) + case "strangelove_ventures.poa.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.module.v1.Module")) @@ -218,10 +169,8 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "strangelove_ventures.poa.module.v1.Module.admins": - lv := value.List() - clv := lv.(*_Module_1_list) - x.Admins = *clv.list + case "strangelove_ventures.poa.module.v1.Module.authority": + x.Authority = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.module.v1.Module")) @@ -242,12 +191,8 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "strangelove_ventures.poa.module.v1.Module.admins": - if x.Admins == nil { - x.Admins = []string{} - } - value := &_Module_1_list{list: &x.Admins} - return protoreflect.ValueOfList(value) + case "strangelove_ventures.poa.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message strangelove_ventures.poa.module.v1.Module is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.module.v1.Module")) @@ -261,9 +206,8 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "strangelove_ventures.poa.module.v1.Module.admins": - list := []string{} - return protoreflect.ValueOfList(&_Module_1_list{list: &list}) + case "strangelove_ventures.poa.module.v1.Module.authority": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.module.v1.Module")) @@ -333,11 +277,9 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.Admins) > 0 { - for _, s := range x.Admins { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -368,14 +310,12 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Admins) > 0 { - for iNdEx := len(x.Admins) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Admins[iNdEx]) - copy(dAtA[i:], x.Admins[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admins[iNdEx]))) - i-- - dAtA[i] = 0xa - } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -428,7 +368,7 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admins", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -456,7 +396,7 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Admins = append(x.Admins, string(dAtA[iNdEx:postIndex])) + x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -513,9 +453,9 @@ type Module struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // admins defines the custom module admins. + // authority defines the custom module authority. // if not set, defaults to the governance module. - Admins []string `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` } func (x *Module) Reset() { @@ -538,11 +478,11 @@ func (*Module) Descriptor() ([]byte, []int) { return file_strangelove_ventures_poa_module_v1_module_proto_rawDescGZIP(), []int{0} } -func (x *Module) GetAdmins() []string { +func (x *Module) GetAuthority() string { if x != nil { - return x.Admins + return x.Authority } - return nil + return "" } var File_strangelove_ventures_poa_module_v1_module_proto protoreflect.FileDescriptor @@ -555,32 +495,32 @@ var file_strangelove_ventures_poa_module_v1_module_proto_rawDesc = []byte{ 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4d, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x3a, 0x2b, 0xba, 0xc0, 0x96, 0xda, 0x01, - 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x42, 0xb1, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, - 0x6f, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x4d, 0xaa, 0x02, 0x21, 0x53, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x21, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2d, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, - 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x24, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, - 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, + 0x2b, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, + 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x42, 0xb1, 0x02, 0x0a, + 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, + 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, + 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, + 0x4d, 0xaa, 0x02, 0x21, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, + 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x21, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, + 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2d, 0x53, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, + 0x50, 0x6f, 0x61, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x24, 0x53, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, + 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/module/depinject.go b/module/depinject.go index 78c9a43..00e4973 100644 --- a/module/depinject.go +++ b/module/depinject.go @@ -59,8 +59,8 @@ type ModuleOutputs struct { func ProvideModule(in ModuleInputs) ModuleOutputs { authority := authtypes.NewModuleAddress(govtypes.ModuleName) - if len(in.Config.Admins) > 0 && in.Config.Admins[0] != "" { - authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Admins[0]) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddress(in.Config.Authority) } k := keeper.NewKeeper(in.Cdc, in.StoreService, in.StakingKeeper, in.SlashingKeeper, in.BankKeeper, log.NewLogger(os.Stderr), authority.String()) diff --git a/proto/strangelove_ventures/poa/module/v1/module.proto b/proto/strangelove_ventures/poa/module/v1/module.proto index 84733d4..f5a7a87 100644 --- a/proto/strangelove_ventures/poa/module/v1/module.proto +++ b/proto/strangelove_ventures/poa/module/v1/module.proto @@ -11,7 +11,7 @@ message Module { go_import : "github.com/strangelove-ventures/poa" }; - // admins defines the custom module admins. + // authority defines the custom module authority. // if not set, defaults to the governance module. - repeated string admins = 1; + string authority = 1; } \ No newline at end of file From 936263202405fe7b91f866067631436d8710beb2 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:44:53 -0500 Subject: [PATCH 14/19] so stick of sim testing whatever get in hardcoded w/ admin bypass --- keeper/keeper.go | 4 +++ simulation/operations.go | 55 ++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/keeper/keeper.go b/keeper/keeper.go index 12e92a5..5200936 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -123,6 +123,10 @@ func (k Keeper) GetAdmin(ctx context.Context) string { // IsAdmin checks if the given address is an admin. func (k Keeper) IsAdmin(ctx context.Context, fromAddr string) bool { + if os.Getenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY") == "not_for-production" { + return true + } + return k.authority == fromAddr } diff --git a/simulation/operations.go b/simulation/operations.go index d643b2a..a3fccb3 100644 --- a/simulation/operations.go +++ b/simulation/operations.go @@ -3,6 +3,7 @@ package simulation import ( "math" "math/rand" + "os" "sort" "github.com/pkg/errors" @@ -11,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -29,7 +31,13 @@ const ( ) +func init() { + os.Setenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY", "not_for-production") +} + var ( + authority sdk.AccAddress = address.Module("gov") + weights = map[string]int{ OpWeightMsgPOASetPower: 100, OpWeightMsgPOARemoveValidator: 20, @@ -121,7 +129,7 @@ func SimulateMsgCreateValidator(txGen client.TxConfig, k keeper.Keeper) simtypes return simtypes.NoOpMsg(poatypes.ModuleName, msgType, errors.WithMessage(err, "unable to create MsgCreateValidator").Error()), nil, err } - return genAndDeliverTxWithRandFees(r, app, ctx, txGen, simAccount, msg, k) + return genAndDeliverTxWithNoFees(r, app, ctx, txGen, simAccount, msg, k) } } @@ -141,17 +149,15 @@ func SimulateMsgRemovePendingValidator(txGen client.TxConfig, k keeper.Keeper) s // Pick a random pending validator address valAddr := pending.Validators[r.Intn(len(pending.Validators))].OperatorAddress - adminAcc, err := getPOAAdmin(accs, k.GetAdmin(ctx)) - if err != nil { - return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err - } + admin := accs[0].Address.String() + k.SetTestAuthority(admin) msg := poatypes.MsgRemovePending{ - Sender: adminAcc.Address.String(), + Sender: admin, ValidatorAddress: valAddr, } - return genAndDeliverTxWithRandFees(r, app, ctx, txGen, adminAcc, &msg, k) + return genAndDeliverTxWithNoFees(r, app, ctx, txGen, accs[0], &msg, k) } } @@ -174,22 +180,20 @@ func SimulateMsgRemoveValidator(txGen client.TxConfig, k keeper.Keeper) simtypes // Select a random bonded validator to remove validator := validators[r.Intn(len(validators))] - adminAcc, err := getPOAAdmin(accs, k.GetAdmin(ctx)) - if err != nil { - return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err - } - power := validator.GetConsensusPower(k.GetStakingKeeper().PowerReduction(ctx)) if power == 0 { return simtypes.NoOpMsg(poatypes.ModuleName, msgType, "validator has no power"), nil, nil } + admin := accs[0].Address.String() + k.SetTestAuthority(admin) + msg := poatypes.MsgRemoveValidator{ - Sender: adminAcc.Address.String(), + Sender: admin, ValidatorAddress: validator.OperatorAddress, } - return genAndDeliverTxWithRandFees(r, app, ctx, txGen, adminAcc, &msg, k) + return genAndDeliverTxWithNoFees(r, app, ctx, txGen, accs[0], &msg, k) } } @@ -220,20 +224,18 @@ func SimulateMsgSetPower(txGen client.TxConfig, k keeper.Keeper) simtypes.Operat return simtypes.NoOpMsg(poatypes.ModuleName, msgType, errStr), nil, nil } - adminAcc, err := getPOAAdmin(accs, k.GetAdmin(ctx)) - if err != nil { - return simtypes.NoOpMsg(poatypes.ModuleName, msgType, err.Error()), nil, err - } + admin := accs[0].Address.String() + k.SetTestAuthority(admin) // Generate random transaction fees msg := poatypes.MsgSetPower{ - Sender: adminAcc.Address.String(), + Sender: admin, ValidatorAddress: validator.OperatorAddress, Power: newPower, Unsafe: false, // We only cover the case where the power is <= 30% of the total power } - return genAndDeliverTxWithRandFees(r, app, ctx, txGen, adminAcc, &msg, k) + return genAndDeliverTxWithNoFees(r, app, ctx, txGen, accs[0], &msg, k) } } @@ -299,15 +301,6 @@ func getNewPower(r *rand.Rand, k keeper.Keeper, ctx sdk.Context, validator staki return newPowerTokens.Uint64(), "", false } -func getPOAAdmin(accs []simtypes.Account, admin string) (simtypes.Account, error) { - acc, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(admin)) - if !found { - return simtypes.Account{}, errors.New("admin not found in simulator accounts") - } - - return acc, nil -} - func generateRandomDescription(r *rand.Rand) poatypes.Description { return poatypes.Description{ Moniker: simtypes.RandStringOfLength(r, 10), @@ -349,6 +342,6 @@ func newOperationInput(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, txGe } } -func genAndDeliverTxWithRandFees(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, txGen client.TxConfig, simAccount simtypes.Account, msg sdk.Msg, k keeper.Keeper) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - return simulation.GenAndDeliverTxWithRandFees(newOperationInput(r, app, ctx, txGen, simAccount, msg, k)) +func genAndDeliverTxWithNoFees(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, txGen client.TxConfig, simAccount simtypes.Account, msg sdk.Msg, k keeper.Keeper) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + return simulation.GenAndDeliverTx(newOperationInput(r, app, ctx, txGen, simAccount, msg, k), sdk.NewCoins()) } From 42bf6a5bd9684f6e4f3a557c1562a52e49ed2d79 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:47:47 -0500 Subject: [PATCH 15/19] fix unit test --- keeper/keeper_test.go | 3 +++ keeper/msg_server_test.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/keeper/keeper_test.go b/keeper/keeper_test.go index e95e4d5..7c4d1c2 100644 --- a/keeper/keeper_test.go +++ b/keeper/keeper_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "fmt" + "os" "testing" "time" @@ -114,6 +115,8 @@ func SetupTest(t *testing.T, baseValShares int64) *testFixture { f.createBaseStakingValidators(t, baseValShares) + os.Setenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY", "false") + return f } diff --git a/keeper/msg_server_test.go b/keeper/msg_server_test.go index 31d0af0..5c7b9c5 100644 --- a/keeper/msg_server_test.go +++ b/keeper/msg_server_test.go @@ -293,7 +293,7 @@ func TestRemoveValidator(t *testing.T) { _, err = f.msgServer.RemoveValidator(f.ctx, tc.request) if tc.expectErrMsg != "" { - require.Error(err) + require.Error(err, tc.expectErrMsg) require.ErrorContains(err, tc.expectErrMsg) } else { require.NoError(err) From a3a7692baaa7b1e1cb52af6b7fee4029bd4b4ccc Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 4 Aug 2024 23:48:04 -0500 Subject: [PATCH 16/19] lint --- simulation/operations.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/simulation/operations.go b/simulation/operations.go index a3fccb3..6a59f2f 100644 --- a/simulation/operations.go +++ b/simulation/operations.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -36,8 +35,6 @@ func init() { } var ( - authority sdk.AccAddress = address.Module("gov") - weights = map[string]int{ OpWeightMsgPOASetPower: 100, OpWeightMsgPOARemoveValidator: 20, From 37288d658dac00362ed7234afce7760d1e8f8d4a Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Mon, 5 Aug 2024 09:46:19 -0500 Subject: [PATCH 17/19] fix: dont init() bypass --- keeper/keeper.go | 3 +++ keeper/msg_server.go | 2 +- simulation/operations.go | 6 ++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/keeper/keeper.go b/keeper/keeper.go index 5200936..41cfb9e 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "os" "github.com/cosmos/cosmos-sdk/codec" @@ -123,7 +124,9 @@ func (k Keeper) GetAdmin(ctx context.Context) string { // IsAdmin checks if the given address is an admin. func (k Keeper) IsAdmin(ctx context.Context, fromAddr string) bool { + if os.Getenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY") == "not_for-production" { + fmt.Println("[!] POA: Bypassing admin check for simulation testing") return true } diff --git a/keeper/msg_server.go b/keeper/msg_server.go index e0d97e8..c0f9306 100644 --- a/keeper/msg_server.go +++ b/keeper/msg_server.go @@ -27,7 +27,7 @@ func NewMsgServerImpl(keeper Keeper) poa.MsgServer { } func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.MsgSetPowerResponse, error) { - if isAdmin := ms.k.IsAdmin(ctx, msg.Sender); !isAdmin { + if !ms.k.IsAdmin(ctx, msg.Sender) { return nil, errorsmod.Wrapf(poa.ErrNotAnAuthority, "sender %s is not an authority. allowed: %+v", msg.Sender, ms.k.GetAdmin(ctx)) } diff --git a/simulation/operations.go b/simulation/operations.go index 6a59f2f..552fb68 100644 --- a/simulation/operations.go +++ b/simulation/operations.go @@ -30,10 +30,6 @@ const ( ) -func init() { - os.Setenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY", "not_for-production") -} - var ( weights = map[string]int{ OpWeightMsgPOASetPower: 100, @@ -50,6 +46,8 @@ func WeightedOperations(appParams simtypes.AppParams, k keeper.Keeper) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + os.Setenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY", "not_for-production") + // Iterating over a map is non-deterministic in Go. To simulate determinism, we sort the keys in a slice and iterate over them. keys := make([]string, 0, len(weights)) for k := range weights { From e72e9760f4c8e3a4cca55d69caa2fe48e8134d94 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Mon, 5 Aug 2024 09:47:50 -0500 Subject: [PATCH 18/19] fix: codec --- e2e/helpers/action_builders.go | 22 +++++++++++++++++----- e2e/poa_test.go | 8 ++++++-- simapp/test_node.sh | 4 ---- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/e2e/helpers/action_builders.go b/e2e/helpers/action_builders.go index 2db639e..8707cab 100644 --- a/e2e/helpers/action_builders.go +++ b/e2e/helpers/action_builders.go @@ -44,9 +44,12 @@ func ExecuteExec(ctx context.Context, chain *cosmos.CosmosChain, cmd []string, i // If the codec can not properly unmarshal, then it may be a standard json Unmarshal request. // This is required since we are ExecuteExec'ing an interface{} instead of some concrete type. - err = chain.GetCodec().UnmarshalInterface(stdout, &i) - if err != nil && !strings.Contains(err.Error(), "illegal wireType") { - fmt.Println("chain.GetCodec.UnmarshalInterface", err) + cdc := chain.GetCodec() + if cdc != nil { + err = cdc.UnmarshalInterface(stdout, &i) + if err != nil && !strings.Contains(err.Error(), "illegal wireType") { + fmt.Println("chain.GetCodec.UnmarshalInterface", err) + } } } @@ -65,8 +68,17 @@ func ExecuteTransaction(ctx context.Context, chain *cosmos.CosmosChain, cmd []st } var res sdk.TxResponse - if err := chain.GetCodec().UnmarshalJSON(stdout, &res); err != nil { - return sdk.TxResponse{}, err + + cdc := chain.GetCodec() + + if cdc != nil { + if err := cdc.UnmarshalJSON(stdout, &res); err != nil { + // return sdk.TxResponse{}, fmt.Errorf("failed to cdc unmarshal tx response: %s", err) + fmt.Println("cdc.UnmarshalJSON err", err, "using json Unmarshal instead") + json.Unmarshal(stdout, &res) + } + } else { + json.Unmarshal(stdout, &res) } return res, err diff --git a/e2e/poa_test.go b/e2e/poa_test.go index cc062d7..dd52b49 100644 --- a/e2e/poa_test.go +++ b/e2e/poa_test.go @@ -2,6 +2,7 @@ package e2e import ( "context" + "os" "testing" sdk "github.com/cosmos/cosmos-sdk/types" @@ -34,6 +35,8 @@ func TestPOABase(t *testing.T) { t.Fatal(err) } + require.NoError(t, os.Setenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY", "false")) + users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), userFunds, chain) incorrectUser := users[0] @@ -120,8 +123,9 @@ func testPowerErrors(t *testing.T, ctx context.Context, chain *cosmos.CosmosChai var err error t.Run("fail: set-power message from a non authorized user", func(t *testing.T) { - // runtime error: index out of range [1] with length 1 [recovered] - res, _ = helpers.POASetPower(t, ctx, chain, incorrectUser, validators[0], 1_000_000) + res, _ = helpers.POASetPower(t, ctx, chain, incorrectUser, validators[0], 2_000_000, "--unsafe=true") + require.NoError(t, err) + res, err := chain.GetTransaction(res.TxHash) require.NoError(t, err) require.Contains(t, res.RawLog, poa.ErrNotAnAuthority.Error()) diff --git a/simapp/test_node.sh b/simapp/test_node.sh index 0e4e66f..6b026f6 100644 --- a/simapp/test_node.sh +++ b/simapp/test_node.sh @@ -128,10 +128,6 @@ from_scratch () { # crisis update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom": "stake","amount": "1000"}' - # x/POA - # allows gov & acc1 to perform actions on POA. - update_test_genesis '.app_state["poa"]["params"]["admins"]=["cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr"]' - # Allocate genesis accounts # stake should ONLY be as much as they gentx with. No more. BINARY genesis add-genesis-account $KEY 1000000000000stake,1000utest --keyring-backend $KEYRING From 94a32d50d0ae8df6208af319dd97e073999fc90a Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Mon, 5 Aug 2024 09:50:10 -0500 Subject: [PATCH 19/19] lint --- keeper/keeper.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keeper/keeper.go b/keeper/keeper.go index 41cfb9e..80858fd 100644 --- a/keeper/keeper.go +++ b/keeper/keeper.go @@ -124,9 +124,8 @@ func (k Keeper) GetAdmin(ctx context.Context) string { // IsAdmin checks if the given address is an admin. func (k Keeper) IsAdmin(ctx context.Context, fromAddr string) bool { - if os.Getenv("POA_BYPASS_ADMIN_CHECK_FOR_SIMULATION_TESTING_ONLY") == "not_for-production" { - fmt.Println("[!] POA: Bypassing admin check for simulation testing") + fmt.Println("[!] POA: Bypassing admin check for simulation testing") // nolint:forbidigo return true }