diff --git a/CODING_GUIDELINES.md b/CODING_GUIDELINES.md index 5d6891d86..6137fa514 100644 --- a/CODING_GUIDELINES.md +++ b/CODING_GUIDELINES.md @@ -78,6 +78,7 @@ In other words: we define a use case input, current state and the expected outco > And a sell order for 20 shares of MSFT stock should have been executed * + Reference: [writing acceptance tests](https://openclassrooms.com/en/courses/4544611-write-agile-documentation-user-stories-acceptance-tests/4810081-writing-acceptance-tests)* . diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index abd04f7ca..ad6cc7c86 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -169,10 +169,10 @@ Release Exception*. Correct [v0.43](https://github.com/persistenceone/persistence-sdk/milestone/26) to the issue. 2. Add a comment to the issue and ensure it contains the following information (see the bug template below): - * **[Impact]** An explanation of the bug on users and justification for backporting the fix to the stable release. - * A **[Test Case]** section containing detailed instructions on how to reproduce the bug. - * A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a - result of the pull request that aims to fix the bug in the target stable release. + * **[Impact]** An explanation of the bug on users and justification for backporting the fix to the stable release. + * A **[Test Case]** section containing detailed instructions on how to reproduce the bug. + * A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a + result of the pull request that aims to fix the bug in the target stable release. 3. **Stable Release Managers** will review and discuss the PR. Once *consensus* surrounding the rationale has been reached and the technical review has successfully concluded, the pull request will be merged in the respective diff --git a/modules/assets/internal/mappable/mappable_test.go b/modules/assets/internal/mappable/mappable_test.go index 82d7a5921..fb97b2541 100644 --- a/modules/assets/internal/mappable/mappable_test.go +++ b/modules/assets/internal/mappable/mappable_test.go @@ -4,6 +4,12 @@ package mappable import ( + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/stretchr/testify/require" + "github.com/AssetMantle/modules/modules/assets/internal/key" baseData "github.com/AssetMantle/modules/schema/data/base" documentsSchema "github.com/AssetMantle/modules/schema/documents" @@ -15,10 +21,6 @@ import ( baseProperties "github.com/AssetMantle/modules/schema/properties/base" "github.com/AssetMantle/modules/schema/qualified" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/stretchr/testify/require" - "reflect" - "testing" ) func createTestInput() (ids.ClassificationID, qualified.Immutables, qualified.Mutables, mappable) { diff --git a/modules/assets/internal/parameters/dummy/validator_test.go b/modules/assets/internal/parameters/dummy/validator_test.go index a18cb72f3..95e7b514e 100644 --- a/modules/assets/internal/parameters/dummy/validator_test.go +++ b/modules/assets/internal/parameters/dummy/validator_test.go @@ -4,12 +4,14 @@ package dummy import ( + "testing" + + sdkTypes "github.com/cosmos/cosmos-sdk/types" + baseData "github.com/AssetMantle/modules/schema/data/base" errorConstants "github.com/AssetMantle/modules/schema/errors/constants" baseIDs "github.com/AssetMantle/modules/schema/ids/base" baseTypes "github.com/AssetMantle/modules/schema/parameters/base" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "testing" ) func Test_validator(t *testing.T) { @@ -30,7 +32,7 @@ func Test_validator(t *testing.T) { {"-ve with different type of Data", args{baseData.NewStringData("stringData")}, errorConstants.IncorrectFormat}, {"-ve InvalidParameter", args{baseTypes.NewParameter(baseIDs.NewStringID(""), baseData.NewStringData(""), validator)}, errorConstants.InvalidParameter}, {"-ve with -ve decData", args{baseTypes.NewParameter(baseIDs.NewStringID("ID"), baseData.NewDecData(sdkTypes.NewDec(-1)), validator)}, errorConstants.InvalidParameter}, - {"+ve with +ve decData", args{baseTypes.NewParameter(baseIDs.NewStringID("ID"), baseData.NewDecData(sdkTypes.NewDec(1)), validator)}, nil}, //TODO: Check whether input provided is right + {"+ve with +ve decData", args{baseTypes.NewParameter(baseIDs.NewStringID("ID"), baseData.NewDecData(sdkTypes.NewDec(1)), validator)}, nil}, // TODO: Check whether input provided is right {"-ve nil", args{}, errorConstants.IncorrectFormat}, } for _, tt := range tests { diff --git a/modules/classifications/auxiliaries/define/keeper_test.go b/modules/classifications/auxiliaries/define/keeper_test.go index 1847c583d..4e88f4f4e 100644 --- a/modules/classifications/auxiliaries/define/keeper_test.go +++ b/modules/classifications/auxiliaries/define/keeper_test.go @@ -4,10 +4,11 @@ package define import ( - baseDocuments "github.com/AssetMantle/modules/schema/documents/base" "reflect" "testing" + baseDocuments "github.com/AssetMantle/modules/schema/documents/base" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store" sdkTypes "github.com/cosmos/cosmos-sdk/types" diff --git a/modules/classifications/internal/genesis/prototype_test.go b/modules/classifications/internal/genesis/prototype_test.go index 04a5b9d41..c30674629 100644 --- a/modules/classifications/internal/genesis/prototype_test.go +++ b/modules/classifications/internal/genesis/prototype_test.go @@ -4,9 +4,10 @@ package genesis import ( - "github.com/AssetMantle/modules/schema/documents/constants" "testing" + "github.com/AssetMantle/modules/schema/documents/constants" + "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/modules/classifications/internal/key" diff --git a/modules/classifications/internal/mappable/mappable_test.go b/modules/classifications/internal/mappable/mappable_test.go index ad43d626b..82ac2a4fb 100644 --- a/modules/classifications/internal/mappable/mappable_test.go +++ b/modules/classifications/internal/mappable/mappable_test.go @@ -4,6 +4,12 @@ package mappable import ( + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/stretchr/testify/require" + "github.com/AssetMantle/modules/modules/classifications/internal/key" baseData "github.com/AssetMantle/modules/schema/data/base" documentsSchema "github.com/AssetMantle/modules/schema/documents" @@ -15,10 +21,6 @@ import ( baseProperties "github.com/AssetMantle/modules/schema/properties/base" "github.com/AssetMantle/modules/schema/qualified" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/stretchr/testify/require" - "reflect" - "testing" ) func createTestInput() (ids.ClassificationID, qualified.Immutables, qualified.Mutables, mappable) { diff --git a/modules/identities/auxiliaries/authenticate/keeper_test.go b/modules/identities/auxiliaries/authenticate/keeper_test.go index f194dc5a9..d1c89c0cb 100644 --- a/modules/identities/auxiliaries/authenticate/keeper_test.go +++ b/modules/identities/auxiliaries/authenticate/keeper_test.go @@ -5,6 +5,19 @@ package authenticate import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/identities/internal/key" "github.com/AssetMantle/modules/modules/identities/internal/mappable" "github.com/AssetMantle/modules/modules/identities/internal/parameters" @@ -18,17 +31,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) var ( diff --git a/modules/identities/auxiliaries/authenticate/request_test.go b/modules/identities/auxiliaries/authenticate/request_test.go index 95c005fc9..4c400acf2 100644 --- a/modules/identities/auxiliaries/authenticate/request_test.go +++ b/modules/identities/auxiliaries/authenticate/request_test.go @@ -4,6 +4,11 @@ package authenticate import ( + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/types" + baseData "github.com/AssetMantle/modules/schema/data/base" "github.com/AssetMantle/modules/schema/helpers" "github.com/AssetMantle/modules/schema/ids" @@ -11,9 +16,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/types" - "reflect" - "testing" ) var ( diff --git a/modules/identities/internal/mappable/mappable_test.go b/modules/identities/internal/mappable/mappable_test.go index 0d0229cba..d8f160108 100644 --- a/modules/identities/internal/mappable/mappable_test.go +++ b/modules/identities/internal/mappable/mappable_test.go @@ -4,10 +4,13 @@ package mappable import ( - "github.com/stretchr/testify/require" "reflect" "testing" + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/AssetMantle/modules/modules/identities/internal/key" baseData "github.com/AssetMantle/modules/schema/data/base" "github.com/AssetMantle/modules/schema/documents" @@ -19,7 +22,6 @@ import ( baseProperties "github.com/AssetMantle/modules/schema/properties/base" "github.com/AssetMantle/modules/schema/qualified" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" ) func createTestInput() (documents.Identity, ids.ClassificationID, qualified.Immutables, qualified.Mutables) { diff --git a/modules/identities/internal/queries/identity/keeper_test.go b/modules/identities/internal/queries/identity/keeper_test.go index 41cb2b4d2..5eca611bf 100644 --- a/modules/identities/internal/queries/identity/keeper_test.go +++ b/modules/identities/internal/queries/identity/keeper_test.go @@ -5,6 +5,19 @@ package identity import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/identities/internal/key" "github.com/AssetMantle/modules/modules/identities/internal/mappable" "github.com/AssetMantle/modules/modules/identities/internal/parameters" @@ -17,17 +30,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) type TestKeepers struct { diff --git a/modules/identities/internal/transactions/define/keeper_test.go b/modules/identities/internal/transactions/define/keeper_test.go index 6688207d8..1c0c8b87c 100644 --- a/modules/identities/internal/transactions/define/keeper_test.go +++ b/modules/identities/internal/transactions/define/keeper_test.go @@ -5,6 +5,19 @@ package define import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + sdkTypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/classifications/auxiliaries/define" "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/identities/internal/key" @@ -22,17 +35,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) type TestKeepers struct { diff --git a/modules/identities/internal/transactions/define/request_test.go b/modules/identities/internal/transactions/define/request_test.go index 15dc9065a..1d1be83f5 100644 --- a/modules/identities/internal/transactions/define/request_test.go +++ b/modules/identities/internal/transactions/define/request_test.go @@ -5,10 +5,11 @@ package define import ( "encoding/json" - "github.com/AssetMantle/modules/schema/lists/utilities" "reflect" "testing" + "github.com/AssetMantle/modules/schema/lists/utilities" + "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/schema" diff --git a/modules/identities/internal/transactions/deputize/keeper_test.go b/modules/identities/internal/transactions/deputize/keeper_test.go index 25b57c86b..6383c9f20 100644 --- a/modules/identities/internal/transactions/deputize/keeper_test.go +++ b/modules/identities/internal/transactions/deputize/keeper_test.go @@ -5,6 +5,19 @@ package deputize import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/identities/internal/key" "github.com/AssetMantle/modules/modules/identities/internal/mappable" @@ -19,17 +32,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) type TestKeepers struct { diff --git a/modules/identities/internal/transactions/deputize/message_test.go b/modules/identities/internal/transactions/deputize/message_test.go index 6b242fcb9..2a3bf559f 100644 --- a/modules/identities/internal/transactions/deputize/message_test.go +++ b/modules/identities/internal/transactions/deputize/message_test.go @@ -4,10 +4,11 @@ package deputize import ( - "github.com/AssetMantle/modules/schema/lists/utilities" "reflect" "testing" + "github.com/AssetMantle/modules/schema/lists/utilities" + "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" diff --git a/modules/identities/internal/transactions/issue/keeper_test.go b/modules/identities/internal/transactions/issue/keeper_test.go index d600c52ed..cd57f1929 100644 --- a/modules/identities/internal/transactions/issue/keeper_test.go +++ b/modules/identities/internal/transactions/issue/keeper_test.go @@ -5,6 +5,19 @@ package issue import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/classifications/auxiliaries/conform" "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/identities/internal/key" @@ -21,17 +34,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) type TestKeepers struct { diff --git a/modules/identities/internal/transactions/quash/keeper_test.go b/modules/identities/internal/transactions/quash/keeper_test.go index c5283c289..8d61751c7 100644 --- a/modules/identities/internal/transactions/quash/keeper_test.go +++ b/modules/identities/internal/transactions/quash/keeper_test.go @@ -5,6 +5,19 @@ package quash import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/identities/internal/key" "github.com/AssetMantle/modules/modules/identities/internal/mappable" @@ -19,17 +32,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) var ( diff --git a/modules/identities/internal/transactions/revoke/keeper_test.go b/modules/identities/internal/transactions/revoke/keeper_test.go index c731cbbfd..ba2128fe8 100644 --- a/modules/identities/internal/transactions/revoke/keeper_test.go +++ b/modules/identities/internal/transactions/revoke/keeper_test.go @@ -4,6 +4,19 @@ package revoke import ( + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/identities/internal/key" "github.com/AssetMantle/modules/modules/identities/internal/mappable" @@ -18,17 +31,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) var ( diff --git a/modules/maintainers/internal/parameters/prototype_test.go b/modules/maintainers/internal/parameters/prototype_test.go index 7a3365e55..4ee248e27 100644 --- a/modules/maintainers/internal/parameters/prototype_test.go +++ b/modules/maintainers/internal/parameters/prototype_test.go @@ -5,11 +5,12 @@ package parameters import ( "fmt" + "reflect" + "testing" + "github.com/AssetMantle/modules/modules/maintainers/internal/parameters/dummy" "github.com/AssetMantle/modules/schema/helpers" baseHelpers "github.com/AssetMantle/modules/schema/helpers/base" - "reflect" - "testing" ) func TestPrototype(t *testing.T) { diff --git a/modules/maintainers/internal/simulator/genesis.go b/modules/maintainers/internal/simulator/genesis.go index 1d50c9e0f..ee1a46ada 100644 --- a/modules/maintainers/internal/simulator/genesis.go +++ b/modules/maintainers/internal/simulator/genesis.go @@ -4,18 +4,20 @@ package simulator import ( + "math/rand" + "github.com/AssetMantle/modules/modules/maintainers/internal/utilities" "github.com/AssetMantle/modules/schema/documents/base" "github.com/AssetMantle/modules/schema/ids" baseIDs "github.com/AssetMantle/modules/schema/ids/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" baseSimulation "github.com/AssetMantle/modules/simulation/schema/types/base" - "math/rand" - "github.com/AssetMantle/modules/utilities/random" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/AssetMantle/modules/utilities/random" + "github.com/AssetMantle/modules/modules/maintainers/internal/common" "github.com/AssetMantle/modules/modules/maintainers/internal/key" "github.com/AssetMantle/modules/modules/maintainers/internal/mappable" diff --git a/modules/maintainers/internal/utilities/permissions_test.go b/modules/maintainers/internal/utilities/permissions_test.go index 811ccb2b5..c9478f3e0 100644 --- a/modules/maintainers/internal/utilities/permissions_test.go +++ b/modules/maintainers/internal/utilities/permissions_test.go @@ -4,12 +4,13 @@ package utilities import ( + "reflect" + "testing" + "github.com/AssetMantle/modules/schema/ids" "github.com/AssetMantle/modules/schema/ids/constansts" "github.com/AssetMantle/modules/schema/lists" "github.com/AssetMantle/modules/schema/lists/base" - "reflect" - "testing" ) func TestSetPermissions(t *testing.T) { diff --git a/modules/metas/auxiliaries/scrub/request_test.go b/modules/metas/auxiliaries/scrub/request_test.go index 5c7339a22..7391380f8 100644 --- a/modules/metas/auxiliaries/scrub/request_test.go +++ b/modules/metas/auxiliaries/scrub/request_test.go @@ -4,9 +4,10 @@ package scrub import ( - "github.com/AssetMantle/modules/schema/lists/base" "testing" + "github.com/AssetMantle/modules/schema/lists/base" + "github.com/stretchr/testify/require" baseData "github.com/AssetMantle/modules/schema/data/base" diff --git a/modules/metas/auxiliaries/scrub/response_test.go b/modules/metas/auxiliaries/scrub/response_test.go index 67080ef79..cc3e3d9b7 100644 --- a/modules/metas/auxiliaries/scrub/response_test.go +++ b/modules/metas/auxiliaries/scrub/response_test.go @@ -4,9 +4,10 @@ package scrub import ( - baseProperties "github.com/AssetMantle/modules/schema/properties/base" "testing" + baseProperties "github.com/AssetMantle/modules/schema/properties/base" + "github.com/stretchr/testify/require" baseData "github.com/AssetMantle/modules/schema/data/base" diff --git a/modules/orders/internal/transactions/define/keeper_test.go b/modules/orders/internal/transactions/define/keeper_test.go index 464a4c447..25dca4299 100644 --- a/modules/orders/internal/transactions/define/keeper_test.go +++ b/modules/orders/internal/transactions/define/keeper_test.go @@ -5,6 +5,19 @@ package define import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/classifications/auxiliaries/define" "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/maintainers/auxiliaries/super" @@ -20,17 +33,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) var ( diff --git a/modules/orders/internal/transactions/deputize/keeper_test.go b/modules/orders/internal/transactions/deputize/keeper_test.go index b47a3338b..c4edcf6e3 100644 --- a/modules/orders/internal/transactions/deputize/keeper_test.go +++ b/modules/orders/internal/transactions/deputize/keeper_test.go @@ -5,6 +5,19 @@ package deputize import ( "fmt" + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store" + "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/params" + "github.com/stretchr/testify/require" + abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tendermintDB "github.com/tendermint/tm-db" + "github.com/AssetMantle/modules/modules/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/modules/maintainers/auxiliaries/deputize" "github.com/AssetMantle/modules/modules/orders/internal/key" @@ -19,17 +32,6 @@ import ( baseLists "github.com/AssetMantle/modules/schema/lists/base" baseProperties "github.com/AssetMantle/modules/schema/properties/base" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/stretchr/testify/require" - abciTypes "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tendermintDB "github.com/tendermint/tm-db" - "reflect" - "testing" ) var ( diff --git a/modules/orders/internal/transactions/deputize/message_test.go b/modules/orders/internal/transactions/deputize/message_test.go index b0331f0f3..579aeba87 100644 --- a/modules/orders/internal/transactions/deputize/message_test.go +++ b/modules/orders/internal/transactions/deputize/message_test.go @@ -4,10 +4,11 @@ package deputize import ( - "github.com/AssetMantle/modules/schema/lists/utilities" "reflect" "testing" + "github.com/AssetMantle/modules/schema/lists/utilities" + "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" diff --git a/modules/orders/internal/transactions/revoke/keeper_test.go b/modules/orders/internal/transactions/revoke/keeper_test.go index b63790c65..57223b78a 100644 --- a/modules/orders/internal/transactions/revoke/keeper_test.go +++ b/modules/orders/internal/transactions/revoke/keeper_test.go @@ -4,10 +4,12 @@ package revoke import ( - "github.com/AssetMantle/modules/schema/helpers" - "github.com/cosmos/cosmos-sdk/types" "reflect" "testing" + + "github.com/cosmos/cosmos-sdk/types" + + "github.com/AssetMantle/modules/schema/helpers" ) func Test_keeperPrototype(t *testing.T) { diff --git a/schema/applications/base/application.go b/schema/applications/base/application.go index b0a4b082b..17a78150a 100644 --- a/schema/applications/base/application.go +++ b/schema/applications/base/application.go @@ -5,6 +5,10 @@ package base import ( "encoding/json" + "io" + "os" + "path/filepath" + "github.com/CosmWasm/wasmd/x/wasm" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -32,9 +36,6 @@ import ( tendermintTypes "github.com/tendermint/tendermint/types" tendermintDB "github.com/tendermint/tm-db" "honnef.co/go/tools/version" - "io" - "os" - "path/filepath" "github.com/AssetMantle/modules/modules/assets" "github.com/AssetMantle/modules/modules/classifications" diff --git a/schema/applications/base/simulationApplication.go b/schema/applications/base/simulationApplication.go index f236156c0..ce3e218ec 100644 --- a/schema/applications/base/simulationApplication.go +++ b/schema/applications/base/simulationApplication.go @@ -5,14 +5,11 @@ package base import ( "encoding/json" - "github.com/AssetMantle/modules/modules/assets" - "github.com/AssetMantle/modules/modules/classifications" - "github.com/AssetMantle/modules/modules/identities" - "github.com/AssetMantle/modules/modules/maintainers" - "github.com/AssetMantle/modules/modules/metas" - "github.com/AssetMantle/modules/modules/orders" - "github.com/AssetMantle/modules/modules/splits" - wasmUtilities "github.com/AssetMantle/modules/utilities/wasm" + "io" + "os" + "path/filepath" + "testing" + "github.com/CosmWasm/wasmd/x/wasm" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -40,10 +37,15 @@ import ( "github.com/tendermint/tendermint/libs/log" tendermintTypes "github.com/tendermint/tendermint/types" tendermintDB "github.com/tendermint/tm-db" - "io" - "os" - "path/filepath" - "testing" + + "github.com/AssetMantle/modules/modules/assets" + "github.com/AssetMantle/modules/modules/classifications" + "github.com/AssetMantle/modules/modules/identities" + "github.com/AssetMantle/modules/modules/maintainers" + "github.com/AssetMantle/modules/modules/metas" + "github.com/AssetMantle/modules/modules/orders" + "github.com/AssetMantle/modules/modules/splits" + wasmUtilities "github.com/AssetMantle/modules/utilities/wasm" "github.com/AssetMantle/modules/schema/applications" ) diff --git a/schema/applications/simulationApplication.go b/schema/applications/simulationApplication.go index a4340a4b0..ffae89eb5 100644 --- a/schema/applications/simulationApplication.go +++ b/schema/applications/simulationApplication.go @@ -4,10 +4,11 @@ package applications import ( - tendermintDB "github.com/tendermint/tm-db" "io" "testing" + tendermintDB "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/tendermint/tendermint/libs/log" diff --git a/schema/codec.go b/schema/codec.go index 54dccf9ac..48dc7eaf8 100644 --- a/schema/codec.go +++ b/schema/codec.go @@ -4,6 +4,8 @@ package schema import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/AssetMantle/modules/schema/data" baseData "github.com/AssetMantle/modules/schema/data/base" "github.com/AssetMantle/modules/schema/documents" @@ -24,8 +26,6 @@ import ( "github.com/AssetMantle/modules/schema/traits" typesSchema "github.com/AssetMantle/modules/schema/types" baseTypes "github.com/AssetMantle/modules/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" - typesGov "github.com/cosmos/cosmos-sdk/x/gov/types" ) func RegisterCodec(codec *codec.Codec) { @@ -58,7 +58,6 @@ func RegisterCodec(codec *codec.Codec) { traits.RegisterCodec(codec) - typesGov.RegisterCodec(codec) typesSchema.RegisterCodec(codec) baseTypes.RegisterCodec(codec) } diff --git a/schema/data/base/decData_test.go b/schema/data/base/decData_test.go index 1b64f2404..78e8f60ba 100644 --- a/schema/data/base/decData_test.go +++ b/schema/data/base/decData_test.go @@ -5,10 +5,11 @@ package base import ( "fmt" - "github.com/stretchr/testify/require" "reflect" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" diff --git a/schema/data/base/stringData.go b/schema/data/base/stringData.go index cdc931a7e..3fad6e21f 100644 --- a/schema/data/base/stringData.go +++ b/schema/data/base/stringData.go @@ -4,13 +4,14 @@ package base import ( + "strings" + "github.com/AssetMantle/modules/schema/data" dataConstants "github.com/AssetMantle/modules/schema/data/constants" "github.com/AssetMantle/modules/schema/errors/constants" "github.com/AssetMantle/modules/schema/ids" baseIDs "github.com/AssetMantle/modules/schema/ids/base" "github.com/AssetMantle/modules/schema/traits" - "strings" ) type stringData struct { diff --git a/schema/data/utilities/string_test.go b/schema/data/utilities/string_test.go index 327560781..2a847a470 100644 --- a/schema/data/utilities/string_test.go +++ b/schema/data/utilities/string_test.go @@ -4,11 +4,12 @@ package utilities import ( + "reflect" + "testing" + baseIDs "github.com/AssetMantle/modules/schema/ids/base" baseLists "github.com/AssetMantle/modules/schema/lists/base" baseTypes "github.com/AssetMantle/modules/schema/types/base" - "reflect" - "testing" "github.com/cosmos/cosmos-sdk/types" diff --git a/schema/documents/base/asset_test.go b/schema/documents/base/asset_test.go index 2d8aec7c2..6530360d9 100644 --- a/schema/documents/base/asset_test.go +++ b/schema/documents/base/asset_test.go @@ -1,6 +1,11 @@ package base import ( + "reflect" + "testing" + + "github.com/cosmos/cosmos-sdk/types" + baseData "github.com/AssetMantle/modules/schema/data/base" documentsSchema "github.com/AssetMantle/modules/schema/documents" "github.com/AssetMantle/modules/schema/ids" @@ -11,9 +16,6 @@ import ( "github.com/AssetMantle/modules/schema/qualified" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" baseTypes "github.com/AssetMantle/modules/schema/types/base" - "github.com/cosmos/cosmos-sdk/types" - "reflect" - "testing" ) func TestNewAsset(t *testing.T) { diff --git a/schema/documents/base/classification_test.go b/schema/documents/base/classification_test.go index bc06e4892..cc1253659 100644 --- a/schema/documents/base/classification_test.go +++ b/schema/documents/base/classification_test.go @@ -1,6 +1,9 @@ package base import ( + "reflect" + "testing" + baseData "github.com/AssetMantle/modules/schema/data/base" "github.com/AssetMantle/modules/schema/documents" baseIDs "github.com/AssetMantle/modules/schema/ids/base" @@ -8,8 +11,6 @@ import ( baseProperties "github.com/AssetMantle/modules/schema/properties/base" "github.com/AssetMantle/modules/schema/qualified" baseQualified "github.com/AssetMantle/modules/schema/qualified/base" - "reflect" - "testing" ) func Test_new_Classification(t *testing.T) { diff --git a/schema/documents/base/document_test.go b/schema/documents/base/document_test.go index 12a7683c4..854195b44 100644 --- a/schema/documents/base/document_test.go +++ b/schema/documents/base/document_test.go @@ -4,10 +4,11 @@ package base import ( - "github.com/stretchr/testify/require" "reflect" "testing" + "github.com/stretchr/testify/require" + baseData "github.com/AssetMantle/modules/schema/data/base" "github.com/AssetMantle/modules/schema/documents" "github.com/AssetMantle/modules/schema/ids" @@ -184,8 +185,8 @@ func Test_document_GetProperty(t *testing.T) { {"+ve with nil classificationID for Mutable Property", fields{ClassificationID: nil, Immutables: testImmutables, Mutables: testMutables}, args{testMutablePropertyID}, testMutables.GetMutablePropertyList().GetProperty(testMutablePropertyID), false}, {"+ve with nil immutables for Mutable Property", fields{ClassificationID: classificationID, Immutables: baseQualified.NewImmutables(baseLists.NewPropertyList()), Mutables: testMutables}, args{testMutablePropertyID}, testMutables.GetMutablePropertyList().GetProperty(testMutablePropertyID), false}, // TODO: panics for empty immutable struct {"+ve with nil mutables for Mutable Property", fields{ClassificationID: classificationID, Immutables: testImmutables, Mutables: baseQualified.NewMutables(baseLists.NewPropertyList())}, args{testMutablePropertyID}, nil, false}, - //Panics for empty structs - //GetProperty() searches by traversing through Immutables and Mutables of a document, hence setting them as nil should cause a fatal panic + // Panics for empty structs + // GetProperty() searches by traversing through Immutables and Mutables of a document, hence setting them as nil should cause a fatal panic {"panic case nil immutables", fields{classificationID, nil, testMutables}, args{testImmutablePropertyID}, nil, true}, {"panic case nil mutables", fields{classificationID, testImmutables, nil}, args{testImmutablePropertyID}, nil, true}, {"panic case nil document", fields{nil, nil, nil}, args{testImmutablePropertyID}, nil, true}, diff --git a/schema/documents/base/identity_test.go b/schema/documents/base/identity_test.go index c9899aaad..4a5879fb6 100644 --- a/schema/documents/base/identity_test.go +++ b/schema/documents/base/identity_test.go @@ -2,6 +2,12 @@ package base import ( "fmt" + "reflect" + "testing" + + sdkTypes "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/AssetMantle/modules/schema/data" "github.com/AssetMantle/modules/schema/data/base" "github.com/AssetMantle/modules/schema/documents" @@ -12,10 +18,6 @@ import ( "github.com/AssetMantle/modules/schema/properties/constants" "github.com/AssetMantle/modules/schema/qualified" "github.com/AssetMantle/modules/schema/types" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - "reflect" - "testing" ) func TestNewIdentity(t *testing.T) { diff --git a/schema/ids/base/dataID_test.go b/schema/ids/base/dataID_test.go index 626d5e29c..906b3c81e 100644 --- a/schema/ids/base/dataID_test.go +++ b/schema/ids/base/dataID_test.go @@ -4,11 +4,12 @@ package base import ( - "github.com/AssetMantle/modules/schema/data" - "github.com/AssetMantle/modules/schema/traits" "reflect" "testing" + "github.com/AssetMantle/modules/schema/data" + "github.com/AssetMantle/modules/schema/traits" + "github.com/AssetMantle/modules/schema/ids" ) diff --git a/simulation/make/TestAppImportExport_test.go b/simulation/make/TestAppImportExport_test.go index 05ce67992..8534d8449 100644 --- a/simulation/make/TestAppImportExport_test.go +++ b/simulation/make/TestAppImportExport_test.go @@ -5,10 +5,11 @@ package make import ( "fmt" - "github.com/CosmWasm/wasmd/x/wasm" "os" "testing" + "github.com/CosmWasm/wasmd/x/wasm" + "github.com/cosmos/cosmos-sdk/store" "github.com/AssetMantle/modules/schema/applications/base" diff --git a/simulation/make/TestAppSimulationAfterImport_test.go b/simulation/make/TestAppSimulationAfterImport_test.go index d228d5240..a56e27077 100644 --- a/simulation/make/TestAppSimulationAfterImport_test.go +++ b/simulation/make/TestAppSimulationAfterImport_test.go @@ -8,12 +8,13 @@ import ( "os" "testing" - "github.com/AssetMantle/modules/schema/applications/base" "github.com/CosmWasm/wasmd/x/wasm" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + + "github.com/AssetMantle/modules/schema/applications/base" ) func TestAppSimulationAfterImport(t *testing.T) { diff --git a/simulation/make/TestAppStateDeterminism_test.go b/simulation/make/TestAppStateDeterminism_test.go index 69853f94a..ab2018314 100644 --- a/simulation/make/TestAppStateDeterminism_test.go +++ b/simulation/make/TestAppStateDeterminism_test.go @@ -10,10 +10,11 @@ import ( "os" "testing" - "github.com/AssetMantle/modules/schema/applications/base" "github.com/CosmWasm/wasmd/x/wasm" "github.com/cosmos/cosmos-sdk/simapp" + "github.com/AssetMantle/modules/schema/applications/base" + "github.com/cosmos/cosmos-sdk/simapp/helpers" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/stretchr/testify/require" diff --git a/simulation/make/TestFullAppSimulation_test.go b/simulation/make/TestFullAppSimulation_test.go index 9cda0d80f..93f371138 100644 --- a/simulation/make/TestFullAppSimulation_test.go +++ b/simulation/make/TestFullAppSimulation_test.go @@ -7,11 +7,12 @@ import ( "os" "testing" - "github.com/AssetMantle/modules/schema/applications/base" "github.com/CosmWasm/wasmd/x/wasm" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/stretchr/testify/require" + + "github.com/AssetMantle/modules/schema/applications/base" ) func TestFullAppSimulation(t *testing.T) { diff --git a/simulation/make/utils.go b/simulation/make/utilities.go similarity index 99% rename from simulation/make/utils.go rename to simulation/make/utilities.go index adeb59029..2e46cbb5d 100644 --- a/simulation/make/utils.go +++ b/simulation/make/utilities.go @@ -4,11 +4,12 @@ package make import ( + "os" + "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/tendermint/tendermint/libs/log" db "github.com/tendermint/tm-db" - "os" ) type testingLogging interface { diff --git a/swagger/configurations/modules.go b/swagger/configurations/modules.go index 09bda8ebd..ed149c32f 100644 --- a/swagger/configurations/modules.go +++ b/swagger/configurations/modules.go @@ -4,13 +4,6 @@ package configurations import ( - "github.com/AssetMantle/modules/modules/assets" - "github.com/AssetMantle/modules/modules/classifications" - "github.com/AssetMantle/modules/modules/identities" - "github.com/AssetMantle/modules/modules/maintainers" - "github.com/AssetMantle/modules/modules/metas" - "github.com/AssetMantle/modules/modules/orders" - "github.com/AssetMantle/modules/modules/splits" "github.com/CosmWasm/wasmd/x/wasm" wasmClient "github.com/CosmWasm/wasmd/x/wasm/client" "github.com/cosmos/cosmos-sdk/types/module" @@ -29,6 +22,14 @@ import ( "github.com/cosmos/cosmos-sdk/x/supply" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeClient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + + "github.com/AssetMantle/modules/modules/assets" + "github.com/AssetMantle/modules/modules/classifications" + "github.com/AssetMantle/modules/modules/identities" + "github.com/AssetMantle/modules/modules/maintainers" + "github.com/AssetMantle/modules/modules/metas" + "github.com/AssetMantle/modules/modules/orders" + "github.com/AssetMantle/modules/modules/splits" ) var ModuleBasicManager = module.NewBasicManager(