@@ -18,6 +18,7 @@ import (
1818 "errors"
1919 "fmt"
2020
21+ "github.com/blinklabs-io/dingo/database/types"
2122 "github.com/btcsuite/btcd/btcutil/bech32"
2223)
2324
@@ -57,7 +58,7 @@ func (a *Account) String() (string, error) {
5758}
5859
5960type Deregistration struct {
60- StakingKey []byte `gorm:"index "`
61+ StakingKey []byte `gorm:"unique "`
6162 ID uint `gorm:"primarykey"`
6263 CertificateID uint `gorm:"index"`
6364 AddedSlot uint64
@@ -69,19 +70,19 @@ func (Deregistration) TableName() string {
6970}
7071
7172type Registration struct {
72- StakingKey []byte `gorm:"index "`
73+ StakingKey []byte `gorm:"unique "`
7374 ID uint `gorm:"primarykey"`
7475 CertificateID uint `gorm:"index"`
7576 AddedSlot uint64
76- DepositAmount uint64
77+ DepositAmount types. Uint64
7778}
7879
7980func (Registration ) TableName () string {
8081 return "registration"
8182}
8283
8384type StakeDelegation struct {
84- StakingKey []byte `gorm:"index "`
85+ StakingKey []byte `gorm:"unique "`
8586 PoolKeyHash []byte `gorm:"index"`
8687 CertificateID uint `gorm:"index"`
8788 ID uint `gorm:"primarykey"`
@@ -93,7 +94,7 @@ func (StakeDelegation) TableName() string {
9394}
9495
9596type StakeDeregistration struct {
96- StakingKey []byte `gorm:"index "`
97+ StakingKey []byte `gorm:"unique "`
9798 CertificateID uint `gorm:"index"`
9899 ID uint `gorm:"primarykey"`
99100 AddedSlot uint64
@@ -104,32 +105,32 @@ func (StakeDeregistration) TableName() string {
104105}
105106
106107type StakeRegistration struct {
107- StakingKey []byte `gorm:"index "`
108+ StakingKey []byte `gorm:"unique "`
108109 CertificateID uint `gorm:"index"`
109110 ID uint `gorm:"primarykey"`
110111 AddedSlot uint64
111- DepositAmount uint64
112+ DepositAmount types. Uint64
112113}
113114
114115func (StakeRegistration ) TableName () string {
115116 return "stake_registration"
116117}
117118
118119type StakeRegistrationDelegation struct {
119- StakingKey []byte `gorm:"index "`
120+ StakingKey []byte `gorm:"unique "`
120121 PoolKeyHash []byte `gorm:"index"`
121122 CertificateID uint `gorm:"index"`
122123 ID uint `gorm:"primarykey"`
123124 AddedSlot uint64
124- DepositAmount uint64
125+ DepositAmount types. Uint64
125126}
126127
127128func (StakeRegistrationDelegation ) TableName () string {
128129 return "stake_registration_delegation"
129130}
130131
131132type StakeVoteDelegation struct {
132- StakingKey []byte `gorm:"index "`
133+ StakingKey []byte `gorm:"unique "`
133134 PoolKeyHash []byte `gorm:"index"`
134135 Drep []byte `gorm:"index"`
135136 CertificateID uint `gorm:"index"`
@@ -142,21 +143,21 @@ func (StakeVoteDelegation) TableName() string {
142143}
143144
144145type StakeVoteRegistrationDelegation struct {
145- StakingKey []byte `gorm:"index "`
146+ StakingKey []byte `gorm:"unique "`
146147 PoolKeyHash []byte `gorm:"index"`
147148 Drep []byte `gorm:"index"`
148149 CertificateID uint `gorm:"index"`
149150 ID uint `gorm:"primarykey"`
150151 AddedSlot uint64
151- DepositAmount uint64
152+ DepositAmount types. Uint64
152153}
153154
154155func (StakeVoteRegistrationDelegation ) TableName () string {
155156 return "stake_vote_registration_delegation"
156157}
157158
158159type VoteDelegation struct {
159- StakingKey []byte `gorm:"index "`
160+ StakingKey []byte `gorm:"unique "`
160161 Drep []byte `gorm:"index"`
161162 CertificateID uint `gorm:"index"`
162163 ID uint `gorm:"primarykey"`
@@ -168,12 +169,12 @@ func (VoteDelegation) TableName() string {
168169}
169170
170171type VoteRegistrationDelegation struct {
171- StakingKey []byte `gorm:"index "`
172+ StakingKey []byte `gorm:"unique "`
172173 Drep []byte `gorm:"index"`
173174 CertificateID uint `gorm:"index"`
174175 ID uint `gorm:"primarykey"`
175176 AddedSlot uint64
176- DepositAmount uint64
177+ DepositAmount types. Uint64
177178}
178179
179180func (VoteRegistrationDelegation ) TableName () string {
0 commit comments