mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
feat: add initial DID implementation
This commit is contained in:
parent
3fd84dbdda
commit
b3b176a25d
@ -616,6 +616,7 @@ func NewChainApp(
|
||||
appCodec,
|
||||
sdkruntime.NewKVStoreService(keys[didtypes.StoreKey]),
|
||||
app.AccountKeeper,
|
||||
app.StakingKeeper,
|
||||
logger,
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
)
|
||||
|
6
gen/transactions/Msg.pkl.go
Normal file
6
gen/transactions/Msg.pkl.go
Normal file
@ -0,0 +1,6 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
type Msg interface {
|
||||
GetTypeUrl() string
|
||||
}
|
44
gen/transactions/MsgDidAllocateVault.pkl.go
Normal file
44
gen/transactions/MsgDidAllocateVault.pkl.go
Normal file
@ -0,0 +1,44 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidAllocateVault interface {
|
||||
Msg
|
||||
|
||||
GetAuthority() string
|
||||
|
||||
GetSubject() string
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidAllocateVault = (*MsgDidAllocateVaultImpl)(nil)
|
||||
|
||||
type MsgDidAllocateVaultImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Authority string `pkl:"authority"`
|
||||
|
||||
Subject string `pkl:"subject"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidAllocateVaultImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAllocateVaultImpl) GetAuthority() string {
|
||||
return rcv.Authority
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAllocateVaultImpl) GetSubject() string {
|
||||
return rcv.Subject
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAllocateVaultImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
60
gen/transactions/MsgDidAuthorize.pkl.go
Normal file
60
gen/transactions/MsgDidAuthorize.pkl.go
Normal file
@ -0,0 +1,60 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidAuthorize interface {
|
||||
Msg
|
||||
|
||||
GetAuthority() string
|
||||
|
||||
GetController() string
|
||||
|
||||
GetAddress() string
|
||||
|
||||
GetOrigin() string
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidAuthorize = (*MsgDidAuthorizeImpl)(nil)
|
||||
|
||||
type MsgDidAuthorizeImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Authority string `pkl:"authority"`
|
||||
|
||||
Controller string `pkl:"controller"`
|
||||
|
||||
Address string `pkl:"address"`
|
||||
|
||||
Origin string `pkl:"origin"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidAuthorizeImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAuthorizeImpl) GetAuthority() string {
|
||||
return rcv.Authority
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAuthorizeImpl) GetController() string {
|
||||
return rcv.Controller
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAuthorizeImpl) GetAddress() string {
|
||||
return rcv.Address
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAuthorizeImpl) GetOrigin() string {
|
||||
return rcv.Origin
|
||||
}
|
||||
|
||||
func (rcv *MsgDidAuthorizeImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
52
gen/transactions/MsgDidProveWitness.pkl.go
Normal file
52
gen/transactions/MsgDidProveWitness.pkl.go
Normal file
@ -0,0 +1,52 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidProveWitness interface {
|
||||
Msg
|
||||
|
||||
GetAuthority() string
|
||||
|
||||
GetProperty() string
|
||||
|
||||
GetWitness() []int
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidProveWitness = (*MsgDidProveWitnessImpl)(nil)
|
||||
|
||||
type MsgDidProveWitnessImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Authority string `pkl:"authority"`
|
||||
|
||||
Property string `pkl:"property"`
|
||||
|
||||
Witness []int `pkl:"witness"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidProveWitnessImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidProveWitnessImpl) GetAuthority() string {
|
||||
return rcv.Authority
|
||||
}
|
||||
|
||||
func (rcv *MsgDidProveWitnessImpl) GetProperty() string {
|
||||
return rcv.Property
|
||||
}
|
||||
|
||||
func (rcv *MsgDidProveWitnessImpl) GetWitness() []int {
|
||||
return rcv.Witness
|
||||
}
|
||||
|
||||
func (rcv *MsgDidProveWitnessImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
60
gen/transactions/MsgDidRegisterController.pkl.go
Normal file
60
gen/transactions/MsgDidRegisterController.pkl.go
Normal file
@ -0,0 +1,60 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidRegisterController interface {
|
||||
Msg
|
||||
|
||||
GetAuthority() string
|
||||
|
||||
GetCid() string
|
||||
|
||||
GetOrigin() string
|
||||
|
||||
GetAuthentication() []*pkl.Object
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidRegisterController = (*MsgDidRegisterControllerImpl)(nil)
|
||||
|
||||
type MsgDidRegisterControllerImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Authority string `pkl:"authority"`
|
||||
|
||||
Cid string `pkl:"cid"`
|
||||
|
||||
Origin string `pkl:"origin"`
|
||||
|
||||
Authentication []*pkl.Object `pkl:"authentication"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidRegisterControllerImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterControllerImpl) GetAuthority() string {
|
||||
return rcv.Authority
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterControllerImpl) GetCid() string {
|
||||
return rcv.Cid
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterControllerImpl) GetOrigin() string {
|
||||
return rcv.Origin
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterControllerImpl) GetAuthentication() []*pkl.Object {
|
||||
return rcv.Authentication
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterControllerImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
76
gen/transactions/MsgDidRegisterService.pkl.go
Normal file
76
gen/transactions/MsgDidRegisterService.pkl.go
Normal file
@ -0,0 +1,76 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidRegisterService interface {
|
||||
Msg
|
||||
|
||||
GetController() string
|
||||
|
||||
GetOriginUri() string
|
||||
|
||||
GetScopes() *pkl.Object
|
||||
|
||||
GetDescription() string
|
||||
|
||||
GetServiceEndpoints() map[string]string
|
||||
|
||||
GetMetadata() *pkl.Object
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidRegisterService = (*MsgDidRegisterServiceImpl)(nil)
|
||||
|
||||
type MsgDidRegisterServiceImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Controller string `pkl:"controller"`
|
||||
|
||||
OriginUri string `pkl:"originUri"`
|
||||
|
||||
Scopes *pkl.Object `pkl:"scopes"`
|
||||
|
||||
Description string `pkl:"description"`
|
||||
|
||||
ServiceEndpoints map[string]string `pkl:"serviceEndpoints"`
|
||||
|
||||
Metadata *pkl.Object `pkl:"metadata"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetController() string {
|
||||
return rcv.Controller
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetOriginUri() string {
|
||||
return rcv.OriginUri
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetScopes() *pkl.Object {
|
||||
return rcv.Scopes
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetDescription() string {
|
||||
return rcv.Description
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetServiceEndpoints() map[string]string {
|
||||
return rcv.ServiceEndpoints
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetMetadata() *pkl.Object {
|
||||
return rcv.Metadata
|
||||
}
|
||||
|
||||
func (rcv *MsgDidRegisterServiceImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
36
gen/transactions/MsgDidSyncVault.pkl.go
Normal file
36
gen/transactions/MsgDidSyncVault.pkl.go
Normal file
@ -0,0 +1,36 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidSyncVault interface {
|
||||
Msg
|
||||
|
||||
GetController() string
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidSyncVault = (*MsgDidSyncVaultImpl)(nil)
|
||||
|
||||
type MsgDidSyncVaultImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Controller string `pkl:"controller"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidSyncVaultImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidSyncVaultImpl) GetController() string {
|
||||
return rcv.Controller
|
||||
}
|
||||
|
||||
func (rcv *MsgDidSyncVaultImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
44
gen/transactions/MsgDidUpdateParams.pkl.go
Normal file
44
gen/transactions/MsgDidUpdateParams.pkl.go
Normal file
@ -0,0 +1,44 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgDidUpdateParams interface {
|
||||
Msg
|
||||
|
||||
GetAuthority() string
|
||||
|
||||
GetParams() *pkl.Object
|
||||
|
||||
GetToken() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgDidUpdateParams = (*MsgDidUpdateParamsImpl)(nil)
|
||||
|
||||
type MsgDidUpdateParamsImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Authority string `pkl:"authority"`
|
||||
|
||||
Params *pkl.Object `pkl:"params"`
|
||||
|
||||
Token *pkl.Object `pkl:"token"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgDidUpdateParamsImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgDidUpdateParamsImpl) GetAuthority() string {
|
||||
return rcv.Authority
|
||||
}
|
||||
|
||||
func (rcv *MsgDidUpdateParamsImpl) GetParams() *pkl.Object {
|
||||
return rcv.Params
|
||||
}
|
||||
|
||||
func (rcv *MsgDidUpdateParamsImpl) GetToken() *pkl.Object {
|
||||
return rcv.Token
|
||||
}
|
44
gen/transactions/MsgGovDeposit.pkl.go
Normal file
44
gen/transactions/MsgGovDeposit.pkl.go
Normal file
@ -0,0 +1,44 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgGovDeposit interface {
|
||||
Msg
|
||||
|
||||
GetProposalId() int
|
||||
|
||||
GetDepositor() string
|
||||
|
||||
GetAmount() []*pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgGovDeposit = (*MsgGovDepositImpl)(nil)
|
||||
|
||||
type MsgGovDepositImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
ProposalId int `pkl:"proposalId"`
|
||||
|
||||
Depositor string `pkl:"depositor"`
|
||||
|
||||
Amount []*pkl.Object `pkl:"amount"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgGovDepositImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgGovDepositImpl) GetProposalId() int {
|
||||
return rcv.ProposalId
|
||||
}
|
||||
|
||||
func (rcv *MsgGovDepositImpl) GetDepositor() string {
|
||||
return rcv.Depositor
|
||||
}
|
||||
|
||||
func (rcv *MsgGovDepositImpl) GetAmount() []*pkl.Object {
|
||||
return rcv.Amount
|
||||
}
|
45
gen/transactions/MsgGovSubmitProposal.pkl.go
Normal file
45
gen/transactions/MsgGovSubmitProposal.pkl.go
Normal file
@ -0,0 +1,45 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgGovSubmitProposal interface {
|
||||
Msg
|
||||
|
||||
GetContent() *Proposal
|
||||
|
||||
GetInitialDeposit() []*pkl.Object
|
||||
|
||||
GetProposer() string
|
||||
}
|
||||
|
||||
var _ MsgGovSubmitProposal = (*MsgGovSubmitProposalImpl)(nil)
|
||||
|
||||
// Gov module messages
|
||||
type MsgGovSubmitProposalImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Content *Proposal `pkl:"content"`
|
||||
|
||||
InitialDeposit []*pkl.Object `pkl:"initialDeposit"`
|
||||
|
||||
Proposer string `pkl:"proposer"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgGovSubmitProposalImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgGovSubmitProposalImpl) GetContent() *Proposal {
|
||||
return rcv.Content
|
||||
}
|
||||
|
||||
func (rcv *MsgGovSubmitProposalImpl) GetInitialDeposit() []*pkl.Object {
|
||||
return rcv.InitialDeposit
|
||||
}
|
||||
|
||||
func (rcv *MsgGovSubmitProposalImpl) GetProposer() string {
|
||||
return rcv.Proposer
|
||||
}
|
42
gen/transactions/MsgGovVote.pkl.go
Normal file
42
gen/transactions/MsgGovVote.pkl.go
Normal file
@ -0,0 +1,42 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
type MsgGovVote interface {
|
||||
Msg
|
||||
|
||||
GetProposalId() int
|
||||
|
||||
GetVoter() string
|
||||
|
||||
GetOption() int
|
||||
}
|
||||
|
||||
var _ MsgGovVote = (*MsgGovVoteImpl)(nil)
|
||||
|
||||
type MsgGovVoteImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
ProposalId int `pkl:"proposalId"`
|
||||
|
||||
Voter string `pkl:"voter"`
|
||||
|
||||
Option int `pkl:"option"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgGovVoteImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgGovVoteImpl) GetProposalId() int {
|
||||
return rcv.ProposalId
|
||||
}
|
||||
|
||||
func (rcv *MsgGovVoteImpl) GetVoter() string {
|
||||
return rcv.Voter
|
||||
}
|
||||
|
||||
func (rcv *MsgGovVoteImpl) GetOption() int {
|
||||
return rcv.Option
|
||||
}
|
45
gen/transactions/MsgGroupCreateGroup.pkl.go
Normal file
45
gen/transactions/MsgGroupCreateGroup.pkl.go
Normal file
@ -0,0 +1,45 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgGroupCreateGroup interface {
|
||||
Msg
|
||||
|
||||
GetAdmin() string
|
||||
|
||||
GetMembers() []*pkl.Object
|
||||
|
||||
GetMetadata() string
|
||||
}
|
||||
|
||||
var _ MsgGroupCreateGroup = (*MsgGroupCreateGroupImpl)(nil)
|
||||
|
||||
// Group module messages
|
||||
type MsgGroupCreateGroupImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Admin string `pkl:"admin"`
|
||||
|
||||
Members []*pkl.Object `pkl:"members"`
|
||||
|
||||
Metadata string `pkl:"metadata"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgGroupCreateGroupImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupCreateGroupImpl) GetAdmin() string {
|
||||
return rcv.Admin
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupCreateGroupImpl) GetMembers() []*pkl.Object {
|
||||
return rcv.Members
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupCreateGroupImpl) GetMetadata() string {
|
||||
return rcv.Metadata
|
||||
}
|
60
gen/transactions/MsgGroupSubmitProposal.pkl.go
Normal file
60
gen/transactions/MsgGroupSubmitProposal.pkl.go
Normal file
@ -0,0 +1,60 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgGroupSubmitProposal interface {
|
||||
Msg
|
||||
|
||||
GetGroupPolicyAddress() string
|
||||
|
||||
GetProposers() []string
|
||||
|
||||
GetMetadata() string
|
||||
|
||||
GetMessages() []*pkl.Object
|
||||
|
||||
GetExec() int
|
||||
}
|
||||
|
||||
var _ MsgGroupSubmitProposal = (*MsgGroupSubmitProposalImpl)(nil)
|
||||
|
||||
type MsgGroupSubmitProposalImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
GroupPolicyAddress string `pkl:"groupPolicyAddress"`
|
||||
|
||||
Proposers []string `pkl:"proposers"`
|
||||
|
||||
Metadata string `pkl:"metadata"`
|
||||
|
||||
Messages []*pkl.Object `pkl:"messages"`
|
||||
|
||||
Exec int `pkl:"exec"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgGroupSubmitProposalImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupSubmitProposalImpl) GetGroupPolicyAddress() string {
|
||||
return rcv.GroupPolicyAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupSubmitProposalImpl) GetProposers() []string {
|
||||
return rcv.Proposers
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupSubmitProposalImpl) GetMetadata() string {
|
||||
return rcv.Metadata
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupSubmitProposalImpl) GetMessages() []*pkl.Object {
|
||||
return rcv.Messages
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupSubmitProposalImpl) GetExec() int {
|
||||
return rcv.Exec
|
||||
}
|
58
gen/transactions/MsgGroupVote.pkl.go
Normal file
58
gen/transactions/MsgGroupVote.pkl.go
Normal file
@ -0,0 +1,58 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
type MsgGroupVote interface {
|
||||
Msg
|
||||
|
||||
GetProposalId() int
|
||||
|
||||
GetVoter() string
|
||||
|
||||
GetOption() int
|
||||
|
||||
GetMetadata() string
|
||||
|
||||
GetExec() int
|
||||
}
|
||||
|
||||
var _ MsgGroupVote = (*MsgGroupVoteImpl)(nil)
|
||||
|
||||
type MsgGroupVoteImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
ProposalId int `pkl:"proposalId"`
|
||||
|
||||
Voter string `pkl:"voter"`
|
||||
|
||||
Option int `pkl:"option"`
|
||||
|
||||
Metadata string `pkl:"metadata"`
|
||||
|
||||
Exec int `pkl:"exec"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgGroupVoteImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupVoteImpl) GetProposalId() int {
|
||||
return rcv.ProposalId
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupVoteImpl) GetVoter() string {
|
||||
return rcv.Voter
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupVoteImpl) GetOption() int {
|
||||
return rcv.Option
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupVoteImpl) GetMetadata() string {
|
||||
return rcv.Metadata
|
||||
}
|
||||
|
||||
func (rcv *MsgGroupVoteImpl) GetExec() int {
|
||||
return rcv.Exec
|
||||
}
|
52
gen/transactions/MsgStakingBeginRedelegate.pkl.go
Normal file
52
gen/transactions/MsgStakingBeginRedelegate.pkl.go
Normal file
@ -0,0 +1,52 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgStakingBeginRedelegate interface {
|
||||
Msg
|
||||
|
||||
GetDelegatorAddress() string
|
||||
|
||||
GetValidatorSrcAddress() string
|
||||
|
||||
GetValidatorDstAddress() string
|
||||
|
||||
GetAmount() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgStakingBeginRedelegate = (*MsgStakingBeginRedelegateImpl)(nil)
|
||||
|
||||
type MsgStakingBeginRedelegateImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
DelegatorAddress string `pkl:"delegatorAddress"`
|
||||
|
||||
ValidatorSrcAddress string `pkl:"validatorSrcAddress"`
|
||||
|
||||
ValidatorDstAddress string `pkl:"validatorDstAddress"`
|
||||
|
||||
Amount *pkl.Object `pkl:"amount"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgStakingBeginRedelegateImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingBeginRedelegateImpl) GetDelegatorAddress() string {
|
||||
return rcv.DelegatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorSrcAddress() string {
|
||||
return rcv.ValidatorSrcAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorDstAddress() string {
|
||||
return rcv.ValidatorDstAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingBeginRedelegateImpl) GetAmount() *pkl.Object {
|
||||
return rcv.Amount
|
||||
}
|
77
gen/transactions/MsgStakingCreateValidator.pkl.go
Normal file
77
gen/transactions/MsgStakingCreateValidator.pkl.go
Normal file
@ -0,0 +1,77 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgStakingCreateValidator interface {
|
||||
Msg
|
||||
|
||||
GetDescription() *pkl.Object
|
||||
|
||||
GetCommission() *pkl.Object
|
||||
|
||||
GetMinSelfDelegation() string
|
||||
|
||||
GetDelegatorAddress() string
|
||||
|
||||
GetValidatorAddress() string
|
||||
|
||||
GetPubkey() *pkl.Object
|
||||
|
||||
GetValue() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgStakingCreateValidator = (*MsgStakingCreateValidatorImpl)(nil)
|
||||
|
||||
// Staking module messages
|
||||
type MsgStakingCreateValidatorImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
Description *pkl.Object `pkl:"description"`
|
||||
|
||||
Commission *pkl.Object `pkl:"commission"`
|
||||
|
||||
MinSelfDelegation string `pkl:"minSelfDelegation"`
|
||||
|
||||
DelegatorAddress string `pkl:"delegatorAddress"`
|
||||
|
||||
ValidatorAddress string `pkl:"validatorAddress"`
|
||||
|
||||
Pubkey *pkl.Object `pkl:"pubkey"`
|
||||
|
||||
Value *pkl.Object `pkl:"value"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetDescription() *pkl.Object {
|
||||
return rcv.Description
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetCommission() *pkl.Object {
|
||||
return rcv.Commission
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetMinSelfDelegation() string {
|
||||
return rcv.MinSelfDelegation
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetDelegatorAddress() string {
|
||||
return rcv.DelegatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetValidatorAddress() string {
|
||||
return rcv.ValidatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetPubkey() *pkl.Object {
|
||||
return rcv.Pubkey
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingCreateValidatorImpl) GetValue() *pkl.Object {
|
||||
return rcv.Value
|
||||
}
|
44
gen/transactions/MsgStakingDelegate.pkl.go
Normal file
44
gen/transactions/MsgStakingDelegate.pkl.go
Normal file
@ -0,0 +1,44 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgStakingDelegate interface {
|
||||
Msg
|
||||
|
||||
GetDelegatorAddress() string
|
||||
|
||||
GetValidatorAddress() string
|
||||
|
||||
GetAmount() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgStakingDelegate = (*MsgStakingDelegateImpl)(nil)
|
||||
|
||||
type MsgStakingDelegateImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
DelegatorAddress string `pkl:"delegatorAddress"`
|
||||
|
||||
ValidatorAddress string `pkl:"validatorAddress"`
|
||||
|
||||
Amount *pkl.Object `pkl:"amount"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgStakingDelegateImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingDelegateImpl) GetDelegatorAddress() string {
|
||||
return rcv.DelegatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingDelegateImpl) GetValidatorAddress() string {
|
||||
return rcv.ValidatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingDelegateImpl) GetAmount() *pkl.Object {
|
||||
return rcv.Amount
|
||||
}
|
44
gen/transactions/MsgStakingUndelegate.pkl.go
Normal file
44
gen/transactions/MsgStakingUndelegate.pkl.go
Normal file
@ -0,0 +1,44 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
type MsgStakingUndelegate interface {
|
||||
Msg
|
||||
|
||||
GetDelegatorAddress() string
|
||||
|
||||
GetValidatorAddress() string
|
||||
|
||||
GetAmount() *pkl.Object
|
||||
}
|
||||
|
||||
var _ MsgStakingUndelegate = (*MsgStakingUndelegateImpl)(nil)
|
||||
|
||||
type MsgStakingUndelegateImpl struct {
|
||||
// The type URL for the message
|
||||
TypeUrl string `pkl:"typeUrl"`
|
||||
|
||||
DelegatorAddress string `pkl:"delegatorAddress"`
|
||||
|
||||
ValidatorAddress string `pkl:"validatorAddress"`
|
||||
|
||||
Amount *pkl.Object `pkl:"amount"`
|
||||
}
|
||||
|
||||
// The type URL for the message
|
||||
func (rcv *MsgStakingUndelegateImpl) GetTypeUrl() string {
|
||||
return rcv.TypeUrl
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingUndelegateImpl) GetDelegatorAddress() string {
|
||||
return rcv.DelegatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingUndelegateImpl) GetValidatorAddress() string {
|
||||
return rcv.ValidatorAddress
|
||||
}
|
||||
|
||||
func (rcv *MsgStakingUndelegateImpl) GetAmount() *pkl.Object {
|
||||
return rcv.Amount
|
||||
}
|
11
gen/transactions/Proposal.pkl.go
Normal file
11
gen/transactions/Proposal.pkl.go
Normal file
@ -0,0 +1,11 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
// Base class for all proposals
|
||||
type Proposal struct {
|
||||
// The title of the proposal
|
||||
Title string `pkl:"title"`
|
||||
|
||||
// The description of the proposal
|
||||
Description string `pkl:"description"`
|
||||
}
|
36
gen/transactions/Transactions.pkl.go
Normal file
36
gen/transactions/Transactions.pkl.go
Normal file
@ -0,0 +1,36 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/apple/pkl-go/pkl"
|
||||
)
|
||||
|
||||
type Transactions struct {
|
||||
}
|
||||
|
||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a Transactions
|
||||
func LoadFromPath(ctx context.Context, path string) (ret *Transactions, err error) {
|
||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
cerr := evaluator.Close()
|
||||
if err == nil {
|
||||
err = cerr
|
||||
}
|
||||
}()
|
||||
ret, err = Load(ctx, evaluator, pkl.FileSource(path))
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Transactions
|
||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Transactions, error) {
|
||||
var ret Transactions
|
||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ret, nil
|
||||
}
|
17
gen/transactions/TxBody.pkl.go
Normal file
17
gen/transactions/TxBody.pkl.go
Normal file
@ -0,0 +1,17 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
// Represents a transaction body
|
||||
type TxBody struct {
|
||||
Messages []Msg `pkl:"messages"`
|
||||
|
||||
Memo *string `pkl:"memo"`
|
||||
|
||||
TimeoutHeight *int `pkl:"timeoutHeight"`
|
||||
|
||||
ExtensionOptions *[]*pkl.Object `pkl:"extensionOptions"`
|
||||
|
||||
NonCriticalExtensionOptions *[]*pkl.Object `pkl:"nonCriticalExtensionOptions"`
|
||||
}
|
27
gen/transactions/init.pkl.go
Normal file
27
gen/transactions/init.pkl.go
Normal file
@ -0,0 +1,27 @@
|
||||
// Code generated from Pkl module `transactions`. DO NOT EDIT.
|
||||
package transactions
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
func init() {
|
||||
pkl.RegisterMapping("transactions", Transactions{})
|
||||
pkl.RegisterMapping("transactions#Proposal", Proposal{})
|
||||
pkl.RegisterMapping("transactions#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgGovVote", MsgGovVoteImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgGovDeposit", MsgGovDepositImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgGroupVote", MsgGroupVoteImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgStakingDelegate", MsgStakingDelegateImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgStakingUndelegate", MsgStakingUndelegateImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidUpdateParams", MsgDidUpdateParamsImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidAllocateVault", MsgDidAllocateVaultImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidProveWitness", MsgDidProveWitnessImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidSyncVault", MsgDidSyncVaultImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidRegisterController", MsgDidRegisterControllerImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidAuthorize", MsgDidAuthorizeImpl{})
|
||||
pkl.RegisterMapping("transactions#MsgDidRegisterService", MsgDidRegisterServiceImpl{})
|
||||
pkl.RegisterMapping("transactions#TxBody", TxBody{})
|
||||
}
|
7
go.mod
7
go.mod
@ -49,9 +49,12 @@ require (
|
||||
cosmossdk.io/x/tx v0.13.3
|
||||
cosmossdk.io/x/upgrade v0.1.1
|
||||
github.com/a-h/templ v0.2.771
|
||||
github.com/apple/pkl-go v0.8.0
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.3
|
||||
github.com/charmbracelet/bubbles v0.19.0
|
||||
github.com/charmbracelet/bubbletea v1.1.0
|
||||
github.com/charmbracelet/huh v0.5.3
|
||||
github.com/charmbracelet/lipgloss v0.13.0
|
||||
github.com/cometbft/cometbft v0.38.8
|
||||
github.com/cosmos/cosmos-db v1.0.2
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.5
|
||||
@ -117,8 +120,6 @@ require (
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/charmbracelet/bubbles v0.19.0 // indirect
|
||||
github.com/charmbracelet/lipgloss v0.13.0 // indirect
|
||||
github.com/charmbracelet/x/ansi v0.2.3 // indirect
|
||||
github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
|
||||
github.com/charmbracelet/x/term v0.2.0 // indirect
|
||||
@ -311,6 +312,8 @@ require (
|
||||
github.com/tetratelabs/wazero v1.8.0 // indirect
|
||||
github.com/tidwall/btree v1.7.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.11 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
|
||||
github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect
|
||||
github.com/whyrusleeping/cbor-gen v0.1.2 // indirect
|
||||
|
10
go.sum
10
go.sum
@ -858,6 +858,8 @@ github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0I
|
||||
github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI=
|
||||
github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg=
|
||||
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
|
||||
github.com/apple/pkl-go v0.8.0 h1:GRcBvFWeXjT9rc7A5gHK89qrel2wGZ3/a7ge4rPlT5M=
|
||||
github.com/apple/pkl-go v0.8.0/go.mod h1:5Hwil5tyZGrOekh7JXLZJvIAcGHb4gT19lnv4WEiKeI=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
||||
@ -870,6 +872,8 @@ github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+
|
||||
github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||
github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8=
|
||||
github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
|
||||
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
@ -942,6 +946,8 @@ github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA
|
||||
github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY=
|
||||
github.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY=
|
||||
github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
|
||||
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q=
|
||||
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
|
||||
github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4=
|
||||
github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ=
|
||||
github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0=
|
||||
@ -2069,6 +2075,10 @@ github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o
|
||||
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
|
||||
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
|
||||
github.com/warpfork/go-testmark v0.12.1 h1:rMgCpJfwy1sJ50x0M0NgyphxYYPMOODIJHhsXyEHU0s=
|
||||
github.com/warpfork/go-testmark v0.12.1/go.mod h1:kHwy7wfvGSPh1rQJYKayD4AbtNaeyZdcGi9tNJTaa5Y=
|
||||
github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ=
|
||||
|
@ -3,7 +3,6 @@ package db
|
||||
import (
|
||||
"crypto/rand"
|
||||
|
||||
_ "github.com/ncruces/go-sqlite3/embed"
|
||||
"github.com/ncruces/go-sqlite3/gormlite"
|
||||
"github.com/ncruces/go-sqlite3/vfs"
|
||||
"golang.org/x/crypto/argon2"
|
||||
|
1
pkg/builder/bip32.go
Normal file
1
pkg/builder/bip32.go
Normal file
@ -0,0 +1 @@
|
||||
package builder
|
1
pkg/builder/cbor.go
Normal file
1
pkg/builder/cbor.go
Normal file
@ -0,0 +1 @@
|
||||
package builder
|
1
pkg/builder/did.go
Normal file
1
pkg/builder/did.go
Normal file
@ -0,0 +1 @@
|
||||
package builder
|
1
pkg/builder/jwks.go
Normal file
1
pkg/builder/jwks.go
Normal file
@ -0,0 +1 @@
|
||||
package builder
|
@ -1,5 +1,9 @@
|
||||
@go.Package { name = "github.com/onsonr/sonr/gen/transactions" }
|
||||
|
||||
module transactions
|
||||
|
||||
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
||||
|
||||
/// Common Cosmos SDK types
|
||||
typealias Coin = Dynamic
|
||||
typealias AccAddress = String
|
||||
|
@ -3,19 +3,17 @@ package module
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
modulev1 "github.com/onsonr/sonr/api/did/module/v1"
|
||||
"github.com/onsonr/sonr/x/did/keeper"
|
||||
@ -58,7 +56,7 @@ type ModuleOutputs struct {
|
||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, log.NewLogger(os.Stderr), govAddr)
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, &in.StakingKeeper, log.NewLogger(os.Stderr), govAddr)
|
||||
m := NewAppModule(in.Cdc, k)
|
||||
|
||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||
|
1
x/did/keeper/ipfs.go
Normal file
1
x/did/keeper/ipfs.go
Normal file
@ -0,0 +1 @@
|
||||
package keeper
|
@ -9,6 +9,7 @@ import (
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
stakkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
apiv1 "github.com/onsonr/sonr/api/did/v1"
|
||||
"github.com/onsonr/sonr/x/did/types"
|
||||
@ -26,12 +27,13 @@ type Keeper struct {
|
||||
Schema collections.Schema
|
||||
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
StakingKeeper *stakkeeper.Keeper
|
||||
|
||||
authority string
|
||||
}
|
||||
|
||||
// NewKeeper creates a new poa Keeper instance
|
||||
func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, logger log.Logger, authority string) Keeper {
|
||||
func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, stkKeeper *stakkeeper.Keeper, logger log.Logger, authority string) Keeper {
|
||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||
sb := collections.NewSchemaBuilder(storeService)
|
||||
if authority == "" {
|
||||
@ -52,6 +54,7 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, ac
|
||||
authority: authority,
|
||||
OrmDB: store,
|
||||
AccountKeeper: accKeeper,
|
||||
StakingKeeper: stkKeeper,
|
||||
}
|
||||
schema, err := sb.Build()
|
||||
if err != nil {
|
||||
|
@ -1,7 +1,38 @@
|
||||
package keeper
|
||||
|
||||
import sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
import (
|
||||
"time"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// CheckValidatorExists checks if a validator exists
|
||||
func (k Keeper) CheckValidatorExists(ctx sdk.Context, addr string) bool {
|
||||
address, err := sdk.ValAddressFromBech32(addr)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
ok, err := k.StakingKeeper.Validator(ctx, address)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if ok != nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetAverageBlockTime returns the average block time in seconds
|
||||
func (k Keeper) GetAverageBlockTime(ctx sdk.Context) float64 {
|
||||
return float64(ctx.BlockTime().Sub(ctx.BlockTime()).Seconds())
|
||||
}
|
||||
|
||||
// GetExpirationBlockHeight returns the block height at which the given duration will have passed
|
||||
func (k Keeper) GetExpirationBlockHeight(ctx sdk.Context, duration time.Duration) int64 {
|
||||
return ctx.BlockHeight() + int64(duration.Seconds()/k.GetAverageBlockTime(ctx))
|
||||
}
|
||||
|
||||
// ValidServiceOrigin checks if a service origin is valid
|
||||
func (k Keeper) ValidServiceOrigin(ctx sdk.Context, origin string) bool {
|
||||
rec, err := k.OrmDB.ServiceRecordTable().GetByOriginUri(ctx, origin)
|
||||
if err != nil {
|
||||
@ -12,3 +43,28 @@ func (k Keeper) ValidServiceOrigin(ctx sdk.Context, origin string) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// VerifyMinimumStake checks if a validator has a minimum stake
|
||||
func (k Keeper) VerifyMinimumStake(ctx sdk.Context, addr string) bool {
|
||||
address, err := sdk.AccAddressFromBech32(addr)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
addval, err := sdk.ValAddressFromBech32(addr)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
del, err := k.StakingKeeper.GetDelegation(ctx, address, addval)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if del.Shares.IsZero() {
|
||||
return false
|
||||
}
|
||||
return del.Shares.IsPositive()
|
||||
}
|
||||
|
||||
// VerifyServicePermissions checks if a service has permission
|
||||
func (k Keeper) VerifyServicePermissions(ctx sdk.Context, addr string, service string, permissions string) bool {
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user