-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from AssetMantle/deepanshu
Deepanshu
- Loading branch information
Showing
15 changed files
with
166 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ package data | |
|
||
type StringData interface { | ||
ListableData | ||
AsString() string | ||
Get() string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package base | ||
|
||
import ( | ||
"github.com/AssetMantle/schema/go/data" | ||
baseData "github.com/AssetMantle/schema/go/data/base" | ||
"github.com/AssetMantle/schema/go/documents" | ||
"github.com/AssetMantle/schema/go/ids" | ||
baseIDs "github.com/AssetMantle/schema/go/ids/base" | ||
baseLists "github.com/AssetMantle/schema/go/lists/base" | ||
"github.com/AssetMantle/schema/go/properties" | ||
baseProperties "github.com/AssetMantle/schema/go/properties/base" | ||
constantProperties "github.com/AssetMantle/schema/go/properties/constants" | ||
baseQualified "github.com/AssetMantle/schema/go/qualified/base" | ||
) | ||
|
||
var _ documents.CoinAsset = (*asset)(nil) | ||
|
||
var coinAssetClassificationID = baseIDs.NewClassificationID(baseQualified.NewImmutables(baseLists.NewPropertyList(constantProperties.DenomIDProperty)), baseQualified.NewMutables(baseLists.NewPropertyList())) | ||
|
||
func (asset asset) GetDenomID() ids.StringID { | ||
if property := asset.Document.GetProperty(constantProperties.DenomIDProperty.GetID()); property != nil && property.IsMeta() { | ||
return property.Get().(properties.MetaProperty).GetData().Get().(data.IDData).Get().Get().(ids.StringID) | ||
} | ||
|
||
return constantProperties.DenomIDProperty.GetData().Get().(data.IDData).Get().Get().(ids.StringID) | ||
} | ||
|
||
func PrototypeCoinAsset() documents.CoinAsset { | ||
return NewCoinAsset(baseIDs.PrototypeStringID()) | ||
} | ||
|
||
func NewCoinAsset(denomID ids.StringID) documents.CoinAsset { | ||
return NewAsset(coinAssetClassificationID, baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.DenomIDProperty.GetKey(), baseData.NewIDData(denomID)))), baseQualified.NewMutables(baseLists.NewPropertyList())).(asset) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package base | ||
|
||
import ( | ||
"github.com/AssetMantle/schema/go/data" | ||
baseData "github.com/AssetMantle/schema/go/data/base" | ||
"github.com/AssetMantle/schema/go/documents" | ||
"github.com/AssetMantle/schema/go/ids" | ||
baseIDs "github.com/AssetMantle/schema/go/ids/base" | ||
baseLists "github.com/AssetMantle/schema/go/lists/base" | ||
"github.com/AssetMantle/schema/go/properties" | ||
baseProperties "github.com/AssetMantle/schema/go/properties/base" | ||
constantProperties "github.com/AssetMantle/schema/go/properties/constants" | ||
baseQualified "github.com/AssetMantle/schema/go/qualified/base" | ||
) | ||
|
||
var _ documents.NubIdentity = (*identity)(nil) | ||
|
||
var nubIdentityClassificationID = baseIDs.NewClassificationID(baseQualified.NewImmutables(baseLists.NewPropertyList(constantProperties.NubIDProperty)), baseQualified.NewMutables(baseLists.NewPropertyList(constantProperties.AuthenticationProperty))) | ||
|
||
func (identity identity) GetNubID() ids.StringID { | ||
if property := identity.Document.GetProperty(constantProperties.NubIDProperty.GetID()); property != nil && property.IsMeta() { | ||
return property.Get().(properties.MetaProperty).GetData().Get().(data.IDData).Get().Get().(ids.StringID) | ||
} | ||
|
||
return constantProperties.NubIDProperty.GetData().Get().(data.IDData).Get().Get().(ids.StringID) | ||
} | ||
|
||
func PrototypeNubIdentity() documents.NubIdentity { | ||
return NewNubIdentity(baseIDs.PrototypeStringID(), baseData.PrototypeListData()) | ||
} | ||
|
||
func NewNubIdentity(nubID ids.StringID, authentication data.ListData) documents.NubIdentity { | ||
return NewIdentity(nubIdentityClassificationID, baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.NubIDProperty.GetKey(), baseData.NewIDData(nubID)))), baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.AuthenticationProperty.GetKey(), authentication)))).(identity) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package documents | ||
|
||
import "github.com/AssetMantle/schema/go/ids" | ||
|
||
type CoinAsset interface { | ||
Asset | ||
GetDenomID() ids.StringID | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package documents | ||
|
||
import "github.com/AssetMantle/schema/go/ids" | ||
|
||
type NubIdentity interface { | ||
Identity | ||
GetNubID() ids.StringID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.