code.vegaprotocol.io/vega@v0.79.0/protos/vega/commands/v1/governance.go (about) 1 package v1 2 3 import ( 4 "errors" 5 6 types "code.vegaprotocol.io/vega/protos/vega" 7 ) 8 9 func ProposalSubmissionFromProposal(p *types.Proposal) (*ProposalSubmission, error) { 10 terms := p.GetTerms() 11 if terms == nil { 12 return nil, errors.New("can not proposal submission from batch proposal") 13 } 14 15 return &ProposalSubmission{ 16 Reference: p.Reference, 17 Terms: terms, 18 }, nil 19 }