@@ -682,78 +682,78 @@ func TestAuthzGRPCQueries(t *testing.T) {
682
682
683
683
grantTestCases := []systest.RestTestCase {
684
684
{
685
- "invalid granter address" ,
686
- fmt .Sprintf (grantURL , "invalid_granter" , grantee1Addr , msgSendTypeURL ),
687
- http .StatusInternalServerError ,
688
- bech32FailOutput ,
685
+ Name : "invalid granter address" ,
686
+ Url : fmt .Sprintf (grantURL , "invalid_granter" , grantee1Addr , msgSendTypeURL ),
687
+ ExpCodeGTE : http .StatusBadRequest ,
688
+ ExpOut : bech32FailOutput ,
689
689
},
690
690
{
691
- "invalid grantee address" ,
692
- fmt .Sprintf (grantURL , granterAddr , "invalid_grantee" , msgSendTypeURL ),
693
- http .StatusInternalServerError ,
694
- bech32FailOutput ,
691
+ Name : "invalid grantee address" ,
692
+ Url : fmt .Sprintf (grantURL , granterAddr , "invalid_grantee" , msgSendTypeURL ),
693
+ ExpCodeGTE : http .StatusBadRequest ,
694
+ ExpOut : bech32FailOutput ,
695
695
},
696
696
{
697
- "with empty granter" ,
698
- fmt .Sprintf (grantURL , "" , grantee1Addr , msgSendTypeURL ),
699
- http .StatusInternalServerError ,
700
- emptyStrOutput ,
697
+ Name : "with empty granter" ,
698
+ Url : fmt .Sprintf (grantURL , "" , grantee1Addr , msgSendTypeURL ),
699
+ ExpCodeGTE : http .StatusBadRequest ,
700
+ ExpOut : emptyStrOutput ,
701
701
},
702
702
{
703
- "with empty grantee" ,
704
- fmt .Sprintf (grantURL , granterAddr , "" , msgSendTypeURL ),
705
- http .StatusInternalServerError ,
706
- emptyStrOutput ,
703
+ Name : "with empty grantee" ,
704
+ Url : fmt .Sprintf (grantURL , granterAddr , "" , msgSendTypeURL ),
705
+ ExpCodeGTE : http .StatusBadRequest ,
706
+ ExpOut : emptyStrOutput ,
707
707
},
708
708
{
709
- "invalid msg-type" ,
710
- fmt .Sprintf (grantURL , granterAddr , grantee1Addr , "invalidMsg" ),
711
- http .StatusInternalServerError ,
712
- invalidMsgTypeOutput ,
709
+ Name : "invalid msg-type" ,
710
+ Url : fmt .Sprintf (grantURL , granterAddr , grantee1Addr , "invalidMsg" ),
711
+ ExpCode : http .StatusInternalServerError ,
712
+ ExpOut : invalidMsgTypeOutput ,
713
713
},
714
714
{
715
- "valid grant query" ,
716
- fmt .Sprintf (grantURL , granterAddr , grantee1Addr , msgSendTypeURL ),
717
- http .StatusOK ,
718
- expGrantOutput ,
715
+ Name : "valid grant query" ,
716
+ Url : fmt .Sprintf (grantURL , granterAddr , grantee1Addr , msgSendTypeURL ),
717
+ ExpCode : http .StatusOK ,
718
+ ExpOut : expGrantOutput ,
719
719
},
720
720
}
721
721
722
- systest .RunRestQueries (t , grantTestCases ... )
722
+ systest .RunRestQueriesIgnoreNumbers (t , grantTestCases ... )
723
723
724
724
// test query grants grpc endpoint
725
725
grantsURL := baseurl + "/cosmos/authz/v1beta1/grants?granter=%s&grantee=%s"
726
726
727
727
grantsTestCases := []systest.RestTestCase {
728
728
{
729
- "expect single grant" ,
730
- fmt .Sprintf (grantsURL , granterAddr , grantee1Addr ),
731
- http .StatusOK ,
732
- fmt .Sprintf (`{"grants":[{%s}],"pagination":{"next_key":null,"total":"1"}}` , grant1 ),
729
+ Name : "expect single grant" ,
730
+ Url : fmt .Sprintf (grantsURL , granterAddr , grantee1Addr ),
731
+ ExpCode : http .StatusOK ,
732
+ ExpOut : fmt .Sprintf (`{"grants":[{%s}],"pagination":{"next_key":null,"total":"1"}}` , grant1 ),
733
733
},
734
734
{
735
- "expect two grants" ,
736
- fmt .Sprintf (grantsURL , granterAddr , grantee2Addr ),
737
- http .StatusOK ,
738
- fmt .Sprintf (`{"grants":[{%s},{%s}],"pagination":{"next_key":null,"total":"2"}}` , grant2 , grant3 ),
735
+ Name : "expect two grants" ,
736
+ Url : fmt .Sprintf (grantsURL , granterAddr , grantee2Addr ),
737
+ ExpCode : http .StatusOK ,
738
+ ExpOut : fmt .Sprintf (`{"grants":[{%s},{%s}],"pagination":{"next_key":null,"total":"2"}}` , grant2 , grant3 ),
739
739
},
740
740
{
741
- "expect single grant with pagination" ,
742
- fmt .Sprintf (grantsURL + "&pagination.limit=1" , granterAddr , grantee2Addr ),
743
- http .StatusOK ,
744
- fmt .Sprintf (`{"grants":[{%s}],"pagination":{"next_key":"L2Nvc21vcy5nb3YudjEuTXNnVm90ZQ==","total":"0"}}` , grant2 ),
741
+ Name : "expect single grant with pagination" ,
742
+ Url : fmt .Sprintf (grantsURL + "&pagination.limit=1" , granterAddr , grantee2Addr ),
743
+ ExpCode : http .StatusOK ,
744
+ ExpOut : fmt .Sprintf (`{"grants":[{%s}],"pagination":{"next_key":"L2Nvc21vcy5nb3YudjEuTXNnVm90ZQ==","total":"0"}}` , grant2 ),
745
745
},
746
746
{
747
- "expect single grant with pagination limit and offset" ,
748
- fmt .Sprintf (grantsURL + "&pagination.limit=1&pagination.offset=1" , granterAddr , grantee2Addr ),
749
- http .StatusOK ,
750
- fmt .Sprintf (`{"grants":[{%s}],"pagination":{"next_key":null,"total":"0"}}` , grant3 ),
747
+ Name : "expect single grant with pagination limit and offset" ,
748
+ Url : fmt .Sprintf (grantsURL + "&pagination.limit=1&pagination.offset=1" , granterAddr , grantee2Addr ),
749
+ ExpCode : http .StatusOK ,
750
+ ExpOut : fmt .Sprintf (`{"grants":[{%s}],"pagination":{"next_key":null,"total":"0"}}` , grant3 ),
751
751
},
752
752
{
753
- "expect two grants with pagination" ,
754
- fmt .Sprintf (grantsURL + "&pagination.limit=2" , granterAddr , grantee2Addr ),
755
- http .StatusOK ,
756
- fmt .Sprintf (`{"grants":[{%s},{%s}],"pagination":{"next_key":null,"total":"0"}}` , grant2 , grant3 ),
753
+ Name : "expect two grants with pagination" ,
754
+ Url : fmt .Sprintf (grantsURL + "&pagination.limit=2" , granterAddr , grantee2Addr ),
755
+ ExpCode : http .StatusOK ,
756
+ ExpOut : fmt .Sprintf (`{"grants":[{%s},{%s}],"pagination":{"next_key":null,"total":"0"}}` , grant2 , grant3 ),
757
757
},
758
758
}
759
759
@@ -768,53 +768,53 @@ func TestAuthzGRPCQueries(t *testing.T) {
768
768
769
769
granterTestCases := []systest.RestTestCase {
770
770
{
771
- "invalid granter account address" ,
772
- fmt .Sprintf (grantsByGranterURL , "invalid address" ),
773
- http .StatusInternalServerError ,
774
- decodingFailedOutput ,
771
+ Name : "invalid granter account address" ,
772
+ Url : fmt .Sprintf (grantsByGranterURL , "invalid address" ),
773
+ ExpCodeGTE : http .StatusBadRequest ,
774
+ ExpOut : decodingFailedOutput ,
775
775
},
776
776
{
777
- "no authorizations found from granter" ,
778
- fmt .Sprintf (grantsByGranterURL , grantee2Addr ),
779
- http .StatusOK ,
780
- noAuthorizationsOutput ,
777
+ Name : "no authorizations found from granter" ,
778
+ Url : fmt .Sprintf (grantsByGranterURL , grantee2Addr ),
779
+ ExpCode : http .StatusOK ,
780
+ ExpOut : noAuthorizationsOutput ,
781
781
},
782
782
{
783
- "valid granter query" ,
784
- fmt .Sprintf (grantsByGranterURL , grantee1Addr ),
785
- http .StatusOK ,
786
- granterQueryOutput ,
783
+ Name : "valid granter query" ,
784
+ Url : fmt .Sprintf (grantsByGranterURL , grantee1Addr ),
785
+ ExpCode : http .StatusOK ,
786
+ ExpOut : granterQueryOutput ,
787
787
},
788
788
}
789
789
790
- systest .RunRestQueries (t , granterTestCases ... )
790
+ systest .RunRestQueriesIgnoreNumbers (t , granterTestCases ... )
791
791
792
792
// test query grants by grantee grpc endpoint
793
793
grantsByGranteeURL := baseurl + "/cosmos/authz/v1beta1/grants/grantee/%s"
794
794
grantee1GrantsOutput := fmt .Sprintf (`{"grants":[{"granter":"%s","grantee":"%s",%s}],"pagination":{"next_key":null,"total":"1"}}` , granterAddr , grantee1Addr , grant1 )
795
795
796
796
granteeTestCases := []systest.RestTestCase {
797
797
{
798
- "invalid grantee account address" ,
799
- fmt .Sprintf (grantsByGranteeURL , "invalid address" ),
800
- http .StatusInternalServerError ,
801
- decodingFailedOutput ,
798
+ Name : "invalid grantee account address" ,
799
+ Url : fmt .Sprintf (grantsByGranteeURL , "invalid address" ),
800
+ ExpCodeGTE : http .StatusBadRequest ,
801
+ ExpOut : decodingFailedOutput ,
802
802
},
803
803
{
804
- "no authorizations found from grantee" ,
805
- fmt .Sprintf (grantsByGranteeURL , granterAddr ),
806
- http .StatusOK ,
807
- noAuthorizationsOutput ,
804
+ Name : "no authorizations found from grantee" ,
805
+ Url : fmt .Sprintf (grantsByGranteeURL , granterAddr ),
806
+ ExpCode : http .StatusOK ,
807
+ ExpOut : noAuthorizationsOutput ,
808
808
},
809
809
{
810
- "valid grantee query" ,
811
- fmt .Sprintf (grantsByGranteeURL , grantee1Addr ),
812
- http .StatusOK ,
813
- grantee1GrantsOutput ,
810
+ Name : "valid grantee query" ,
811
+ Url : fmt .Sprintf (grantsByGranteeURL , grantee1Addr ),
812
+ ExpCode : http .StatusOK ,
813
+ ExpOut : grantee1GrantsOutput ,
814
814
},
815
815
}
816
816
817
- systest .RunRestQueries (t , granteeTestCases ... )
817
+ systest .RunRestQueriesIgnoreNumbers (t , granteeTestCases ... )
818
818
}
819
819
820
820
func setupChain (t * testing.T ) (* systest.CLIWrapper , string , string ) {
0 commit comments