cosmos-sdk/x/feegrant/msgs_test.go

135 lines
3.0 KiB
Go
Raw Normal View History

package feegrant_test
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
import (
"testing"
"time"
"github.com/stretchr/testify/require"
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
)
func TestMsgGrantAllowance(t *testing.T) {
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
cdc := codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
addr, _ := sdk.AccAddressFromBech32("cosmos1aeuqja06474dfrj7uqsvukm6rael982kk89mqr")
addr2, _ := sdk.AccAddressFromBech32("cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl")
atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555))
threeHours := time.Now().Add(3 * time.Hour)
basic := &feegrant.BasicAllowance{
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
SpendLimit: atom,
Expiration: &threeHours,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
}
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
cases := map[string]struct {
grantee sdk.AccAddress
granter sdk.AccAddress
grant *feegrant.BasicAllowance
valid bool
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
}{
"valid": {
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
grantee: addr,
granter: addr2,
grant: basic,
valid: true,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
"no grantee": {
granter: addr2,
grantee: sdk.AccAddress{},
grant: basic,
valid: false,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
"no granter": {
granter: sdk.AccAddress{},
grantee: addr,
grant: basic,
valid: false,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
"grantee == granter": {
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
grantee: addr,
granter: addr,
grant: basic,
valid: false,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
}
for _, tc := range cases {
msg, err := feegrant.NewMsgGrantAllowance(tc.grant, tc.granter, tc.grantee)
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
require.NoError(t, err)
err = msg.ValidateBasic()
if tc.valid {
require.NoError(t, err)
addrSlice := msg.GetSigners()
refactor!: change GetSigners return type to []sdk.AccAddress (#9915) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Changes the `sdk.Msg` interface method `GetSigners() []string` to `GetSigners() []sdk.AccAddress` Closes: #9885 +change GetSigner return type +defer address checking to each msg's `ValidateBasic` method +clean up consistency/redundancy issues in validate basic --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
2021-08-13 08:34:00 -07:00
require.True(t, tc.granter.Equals(addrSlice[0]))
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
allowance, err := msg.GetFeeAllowanceI()
require.NoError(t, err)
require.Equal(t, tc.grant, allowance)
err = msg.UnpackInterfaces(cdc)
require.NoError(t, err)
} else {
require.Error(t, err)
}
}
}
func TestMsgRevokeAllowance(t *testing.T) {
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
addr, _ := sdk.AccAddressFromBech32("cosmos1aeuqja06474dfrj7uqsvukm6rael982kk89mqr")
addr2, _ := sdk.AccAddressFromBech32("cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl")
atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555))
threeHours := time.Now().Add(3 * time.Hour)
basic := &feegrant.BasicAllowance{
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
SpendLimit: atom,
Expiration: &threeHours,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
}
cases := map[string]struct {
grantee sdk.AccAddress
granter sdk.AccAddress
grant *feegrant.BasicAllowance
valid bool
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
}{
"valid": {
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
grantee: addr,
granter: addr2,
grant: basic,
valid: true,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
"no grantee": {
granter: addr2,
grantee: sdk.AccAddress{},
grant: basic,
valid: false,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
"no granter": {
granter: sdk.AccAddress{},
grantee: addr,
grant: basic,
valid: false,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
"grantee == granter": {
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
grantee: addr,
granter: addr,
grant: basic,
valid: false,
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
},
}
for _, tc := range cases {
msg := feegrant.NewMsgRevokeAllowance(tc.granter, tc.grantee)
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
err := msg.ValidateBasic()
if tc.valid {
require.NoError(t, err)
addrSlice := msg.GetSigners()
refactor!: change GetSigners return type to []sdk.AccAddress (#9915) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Changes the `sdk.Msg` interface method `GetSigners() []string` to `GetSigners() []sdk.AccAddress` Closes: #9885 +change GetSigner return type +defer address checking to each msg's `ValidateBasic` method +clean up consistency/redundancy issues in validate basic --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
2021-08-13 08:34:00 -07:00
require.True(t, tc.granter.Equals(addrSlice[0]))
x/feegrant audit: clean up / add test coverage to types package (#9193) * Squashed commit of the following: commit 58dc50051226a9eeb8d0ebea5bb0908fe5b9637f Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:09:27 2021 -0700 remove comments commit a84107e1b3eaa31324cb0f4f097b49f02af79c69 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 15:02:41 2021 -0700 add tests for msgs.go commit 2ad16869237e9631b402c93cde650c3fc554daf2 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 13:20:21 2021 -0700 specify test name commit b7121277c9be586a7c80d010ec401e50b510e02a Merge: c0c134d971 3c65c3dacd Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Fri Apr 23 12:54:55 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit c0c134d97107194dc4f9d3c501a15d023ae083e5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 19:59:11 2021 -0700 -add test case to cli_test.go for filtered fee -clean up identifiers -remove redundant import alias from filtered_fee.go commit f7ab3699da39be3ab886f96962d28d23438d2e8e Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:57:31 2021 -0700 remove unecessary constant commit 9db59a82a7337cf5a7a3569c6900a44a6c81e8b4 Merge: a3e75ceb8a e28271b8e6 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Thu Apr 22 09:19:20 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit a3e75ceb8a510ad9db43dd96073c43b7a8b062b0 Merge: 4d3dafab85 bffcae54a1 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:04:39 2021 -0700 Merge branch 'master' into ty-9115-types_tests commit 4d3dafab85d85526a7c94b045289605289ee6b0d Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 12:03:41 2021 -0700 cleanup id's / add test case commit e8f6924931ba95e592bfc3057ba167700458da41 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Wed Apr 21 10:55:29 2021 -0700 add test for 0 allowance / remove unused field on exp test commit 516b6ef89a4582ad681cc6c5c101cf50a9a54fb5 Author: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Tue Apr 20 15:22:48 2021 -0700 make names more clear, remove unused field * fix imports * fix tests * rename test field Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com> Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
2021-04-28 07:18:38 -07:00
} else {
require.Error(t, err)
}
}
}