diff --git a/data/base/number_data_test.go b/data/base/number_data_test.go index f65e40ed4..0e66523c7 100644 --- a/data/base/number_data_test.go +++ b/data/base/number_data_test.go @@ -4,6 +4,7 @@ package base import ( + "cosmossdk.io/math" sdkTypes "github.com/cosmos/cosmos-sdk/types" "reflect" "testing" @@ -81,7 +82,7 @@ func Test_NumberData_GenerateHashID(t *testing.T) { want ids.HashID }{ {"+ve", NewNumberData(sdkTypes.NewInt(10)), baseIDs.GenerateHashID([]byte("10")).(*baseIDs.HashID)}, - {"+ve", NewNumberData(sdkTypes.NewInt(0)), &baseIDs.HashID{[]byte{}}}, + {name: "+ve", args: NewNumberData(sdkTypes.NewInt(0)), want: &baseIDs.HashID{IDBytes: []byte{}}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/documents/base/asset_test.go b/documents/base/asset_test.go index 64c954b08..492b25f0a 100644 --- a/documents/base/asset_test.go +++ b/documents/base/asset_test.go @@ -1,6 +1,7 @@ package base import ( + "cosmossdk.io/math" "github.com/AssetMantle/schema/types" "reflect" "testing" diff --git a/documents/base/classification_test.go b/documents/base/classification_test.go index e1551bf2f..2f4f578d3 100644 --- a/documents/base/classification_test.go +++ b/documents/base/classification_test.go @@ -1,6 +1,7 @@ package base import ( + "cosmossdk.io/math" "github.com/AssetMantle/schema/properties/constants" sdkTypes "github.com/cosmos/cosmos-sdk/types" "reflect" diff --git a/documents/base/identity_test.go b/documents/base/identity_test.go index 3aaa8c1f5..095480eb5 100644 --- a/documents/base/identity_test.go +++ b/documents/base/identity_test.go @@ -155,9 +155,6 @@ func Test_identity_GetAuthentication(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - type fields struct { - Document documents.Identity - } tests := []struct { name string diff --git a/documents/base/maintainer_test.go b/documents/base/maintainer_test.go index f98acafec..fbeb91aff 100644 --- a/documents/base/maintainer_test.go +++ b/documents/base/maintainer_test.go @@ -27,8 +27,8 @@ func TestNewMaintainer(t *testing.T) { baseProperties.NewMetaProperty(constantProperties.MaintainedClassificationIDProperty.GetKey(), baseData.NewIDData(classificationID)), )), baseQualified.NewMutables(baseLists.NewPropertyList( - baseProperties.NewMetaProperty(constantProperties.MaintainedPropertiesProperty.GetKey(), idListToListData(maintainerProperties)), - baseProperties.NewMetaProperty(constantProperties.PermissionsProperty.GetKey(), idListToListData(permissions)), + baseProperties.NewMetaProperty(constantProperties.MaintainedPropertiesProperty.GetKey(), maintainerProperties.ToListData()), + baseProperties.NewMetaProperty(constantProperties.PermissionsProperty.GetKey(), permissions.ToListData()), )), ) type args struct { @@ -52,61 +52,3 @@ func TestNewMaintainer(t *testing.T) { }) } } - -//func Test_identity_GetExpiry(t *testing.T) { -// testImmutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) -// testMutables1 := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData().ZeroValue()), baseProperties.NewMetaProperty(baseIDs.NewStringID("expiry"), baseData.NewHeightData(baseTypes.NewHeight(10))), baseProperties.NewMetaProperty(baseIDs.NewStringID("expiryHeight"), baseData.NewHeightData(baseTypes.NewHeight(100))))) -// testMutables2 := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData().ZeroValue()), baseProperties.NewMetaProperty(baseIDs.NewStringID("expiry"), baseData.NewHeightData(baseTypes.NewHeight(10))))) -// classificationID := baseIDs.NewClassificationID(testImmutables, testMutables1) -// testDocument1 := NewDocument(classificationID, testImmutables, testMutables1) -// testIdentity1 := identity{testDocument1} -// testDocument2 := NewDocument(classificationID, testImmutables, testMutables2) -// testIdentity2 := identity{testDocument2} -// type fields struct { -// Document documents.Identity -// } -// tests := []struct { -// name string -// fields fields -// want types.Height -// }{ -// {"+ve", fields{testIdentity1}, baseTypes.NewHeight(100)}, -// {"+ve", fields{testIdentity2}, baseTypes.NewHeight(-1)}, -// } -// for _, tt := range tests { -// t.Run(tt.name, func(t *testing.T) { -// identity := tt.fields.Document -// -// if got := identity.GetExpiry(); !reflect.DeepEqual(got, tt.want) { -// t.Errorf("GetExpiry() = %v, want %v", got, tt.want) -// } -// }) -// } -//} -// -//func Test_identity_GetAuthentication(t *testing.T) { -// classificationID, immutables, mutables, _ := createTestInput() -// fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" -// fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) -// require.Nil(t, err) -// type fields struct { -// Document documents.Identity -// } -// -// tests := []struct { -// name string -// fields documents.Identity -// want data.ListData -// }{ -// {"+ve", NewIdentityFromDocument(NewDocument(classificationID, immutables, mutables)).ProvisionAddress(fromAccAddress), baseData.NewListData(baseData.NewAccAddressData(fromAccAddress))}, -// {"+ve", identity{NewDocument(classificationID, immutables, baseQualified.NewMutables(baseLists.NewPropertyList()))}, constants.AuthenticationProperty.GetData().Get().(data.ListData)}, -// } -// for _, tt := range tests { -// t.Run(tt.name, func(t *testing.T) { -// -// if got := tt.fields.GetAuthentication(); !reflect.DeepEqual(got, tt.want) { -// t.Errorf("GetAuthentication() = %v, want %v", got, tt.want) -// } -// }) -// } -//} diff --git a/properties/base/mesa_property_test.go b/properties/base/mesa_property_test.go index 0e8b336b9..636425449 100644 --- a/properties/base/mesa_property_test.go +++ b/properties/base/mesa_property_test.go @@ -4,6 +4,7 @@ package base import ( + "cosmossdk.io/math" dataConstants "github.com/AssetMantle/schema/data/constants" sdkTypes "github.com/cosmos/cosmos-sdk/types" "reflect" @@ -416,10 +417,10 @@ func Test_MesaPropertyValidateBasic(t *testing.T) { ID: testPropertyID.(*baseIDs.PropertyID), DataID: baseData.NewNumberData(sdkTypes.NewInt(10)).GetID().(*baseIDs.DataID), }, true}, - {"-ve", &MesaProperty{ + {name: "-ve", args: &MesaProperty{ ID: testPropertyID.(*baseIDs.PropertyID), - DataID: &baseIDs.DataID{&baseIDs.StringID{"S"}, &baseIDs.HashID{[]byte("a")}}}, - true}, + DataID: &baseIDs.DataID{TypeID: &baseIDs.StringID{IDString: "S"}, HashID: &baseIDs.HashID{IDBytes: []byte("a")}}}, + want: true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {