Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Removed unused field
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Apr 5, 2022
1 parent 1d91003 commit 863c9f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions model_paymails.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ type PaymailAddress struct {

// Model specific fields
ID string `json:"id" toml:"id" yaml:"id" gorm:"<-:create;type:char(64);primaryKey;comment:This is the unique paymail record id" bson:"_id"` // Unique identifier
XpubID string `json:"xpub_id" toml:"xpub_id" yaml:"xpub_id" gorm:"<-:create;type:char(64);index;comment:This is the related xPub" bson:"xpub_id"` // Related xPub ID
Alias string `json:"alias" toml:"alias" yaml:"alias" gorm:"<-;type:varchar(64);comment:This is alias@" bson:"alias"` // Alias part of the paymail
Domain string `json:"domain" toml:"domain" yaml:"domain" gorm:"<-;type:varchar(255);comment:This is @domain.com" bson:"domain"` // Domain of the paymail
Username string `json:"username" toml:"username" yaml:"username" gorm:"<-;type:varchar(255);uniqueIndex;comment:This is username" bson:"username"` // Full username
Avatar string `json:"avatar" toml:"avatar" yaml:"avatar" gorm:"<-;type:text;comment:This is avatar url" bson:"avatar"` // This is the url of the user (public profile)
ExternalXpubKey string `json:"external_xpub_key" toml:"external_xpub_key" yaml:"external_xpub_key" gorm:"<-:create;type:varchar(512);index;comment:This is full xPub for external use, encryption optional" bson:"external_xpub_key"` // PublicKey hex encoded
NextIdentityNum uint32 `json:"next_identity_num" toml:"next_identity_num" yaml:"next_identity_num" gorm:"<-;type:int;comment:The next index number for the identity xPub derivation" bson:"next_identity_num"`
XpubID string `json:"xpub_id" toml:"xpub_id" yaml:"xpub_id" gorm:"<-:create;type:char(64);index;comment:This is the related xPub" bson:"xpub_id"` // Related xPub ID
}

// newPaymail create new paymail model
Expand Down Expand Up @@ -134,7 +133,7 @@ func (m *PaymailAddress) GetIdentityXpub() (*bip32.ExtendedKey, error) {
return nil, err
}

// Get the child key
// Get the last possible key in the external key
return bitcoin.GetHDKeyChild(
xPub, uint32(utils.MaxInt32),
)
Expand Down
1 change: 0 additions & 1 deletion model_paymails_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func TestNewPaymail(t *testing.T) {
assert.Equal(t, "img url", p2.Avatar)
assert.Equal(t, "d8c2bed524071d72d859caf90da5f448b5861cd4d4fd47697f94166c13c5a987", p2.XpubID)
assert.Equal(t, paymailIdentityXPub, identityKey.String())
assert.Equal(t, uint32(0), p2.NextIdentityNum)

// Decrypt the external key
var decrypted string
Expand Down

0 comments on commit 863c9f1

Please sign in to comment.