Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions database/plugin/metadata/sqlite/models/auth_committee_hot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type AuthCommitteeHot struct {
ID uint `gorm:"primarykey"`
ColdCredential []byte `gorm:"index"`
HostCredential []byte `gorm:"index"`
AddedSlot uint64
}

func (AuthCommitteeHot) TableName() string {
return "auth_committee_hot"
}
25 changes: 25 additions & 0 deletions database/plugin/metadata/sqlite/models/deregistration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type Deregistration struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
AddedSlot uint64
}

func (Deregistration) TableName() string {
return "deregistration"
}
26 changes: 26 additions & 0 deletions database/plugin/metadata/sqlite/models/deregistration_drep.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type DeregistrationDrep struct {
ID uint `gorm:"primarykey"`
DrepCredential []byte `gorm:"index"`
AddedSlot uint64
DepositAmount uint64
}

func (DeregistrationDrep) TableName() string {
return "deregistration_drep"
}
27 changes: 27 additions & 0 deletions database/plugin/metadata/sqlite/models/drep.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type Drep struct {
ID uint `gorm:"primarykey"`
Credential []byte `gorm:"index"`
AnchorUrl string
AnchorHash []byte
AddedSlot uint64
}

func (d *Drep) TableName() string {
return "drep"
}
12 changes: 12 additions & 0 deletions database/plugin/metadata/sqlite/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,28 @@ package models

// MigrateModels contains a list of model objects that should have DB migrations applied
var MigrateModels = []any{
&AuthCommitteeHot{},
&Deregistration{},
&Drep{},
&Epoch{},
&PoolRegistration{},
&PoolRegistrationOwner{},
&PoolRegistrationRelay{},
&PoolRetirement{},
&PParams{},
&PParamUpdate{},
&Registration{},
&RegistrationDrep{},
&ResignCommitteeCold{},
&StakeDelegation{},
&StakeDeregistration{},
&StakeRegistration{},
&StakeRegistrationDelegation{},
&StakeVoteDelegation{},
&StakeVoteRegistrationDelegation{},
&Tip{},
&UpdateDrep{},
&Utxo{},
&VoteDelegation{},
&VoteRegistrationDelegation{},
}
26 changes: 26 additions & 0 deletions database/plugin/metadata/sqlite/models/registration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type Registration struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
AddedSlot uint64
DepositAmount uint64
}

func (Registration) TableName() string {
return "registration"
}
28 changes: 28 additions & 0 deletions database/plugin/metadata/sqlite/models/registration_drep.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type RegistrationDrep struct {
ID uint `gorm:"primarykey"`
DrepCredential []byte `gorm:"index"`
AddedSlot uint64
DepositAmount uint64
AnchorUrl string
AnchorHash []byte
}

func (RegistrationDrep) TableName() string {
return "registration_drep"
}
27 changes: 27 additions & 0 deletions database/plugin/metadata/sqlite/models/resign_committee_cold.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type ResignCommitteeCold struct {
ID uint `gorm:"primarykey"`
ColdCredential []byte `gorm:"index"`
AnchorUrl string
AnchorHash []byte
AddedSlot uint64
}

func (ResignCommitteeCold) TableName() string {
return "resign_committee_cold"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type StakeRegistrationDelegation struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
PoolKeyHash []byte `gorm:"index"`
AddedSlot uint64
DepositAmount uint64
}

func (StakeRegistrationDelegation) TableName() string {
return "stake_registration_delegation"
}
27 changes: 27 additions & 0 deletions database/plugin/metadata/sqlite/models/stake_vote_delegation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type StakeVoteDelegation struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
PoolKeyHash []byte `gorm:"index"`
Drep []byte `gorm:"index"`
AddedSlot uint64
}

func (StakeVoteDelegation) TableName() string {
return "stake_vote_delegation"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type StakeVoteRegistrationDelegation struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
PoolKeyHash []byte `gorm:"index"`
Drep []byte `gorm:"index"`
AddedSlot uint64
}

func (StakeVoteRegistrationDelegation) TableName() string {
return "stake_vote_registration_delegation"
}
27 changes: 27 additions & 0 deletions database/plugin/metadata/sqlite/models/update_drep.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type UpdateDrep struct {
ID uint `gorm:"primarykey"`
Credential []byte `gorm:"index"`
AnchorUrl string
AnchorHash []byte
AddedSlot uint64
}

func (UpdateDrep) TableName() string {
return "update_drep"
}
26 changes: 26 additions & 0 deletions database/plugin/metadata/sqlite/models/vote_delegation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type VoteDelegation struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
Drep []byte `gorm:"index"`
AddedSlot uint64
}

func (VoteDelegation) TableName() string {
return "vote_delegation"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package models

type VoteRegistrationDelegation struct {
ID uint `gorm:"primarykey"`
StakingKey []byte `gorm:"index"`
Drep []byte `gorm:"index"`
AddedSlot uint64
}

func (VoteRegistrationDelegation) TableName() string {
return "vote_registration_delegation"
}
Loading