PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gnoswap/gov/governance/v1

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v1
Namespace
gnoswap / gov / governance
Files
23 (README)(gnomod.toml)
Exported functions
n/a — Gnoland RPC unavailable (functions): rpc abci_query: HTTP 500
Module
gno.land/r/gnoswap/gov/governance/v1
gno
0.9

Files (23)

  • README.mdmarkdown
  • gnomod.tomltoml
  • assert.gnogno
  • config.gnogno
  • consts.gnogno
  • doc.gnogno
  • errors.gnogno
  • getter_utils.gnogno
  • getter.gnogno
  • governance_execute.gnogno
  • governance_propose.gnogno
  • governance_vote.gnogno
  • init.gnogno
  • instance.gnogno
  • parameter_registry.gnogno
  • proposal_action_status.gnogno
  • proposal_data.gnogno
  • proposal_schedule_status.gnogno
  • proposal_status.gnogno
  • proposal_vote_status.gnogno
  • proposal.gnogno
  • render.gnogno
  • utils.gnogno
  • proposal_vote_status.gnogno
    1package governance23import (4	gnsmath "gno.land/p/gnoswap/gnsmath/v1"56	"gno.land/r/gnoswap/gov/governance"7)89type ProposalVoteStatusResolver struct {10	*governance.ProposalVoteStatus11}1213// NewProposalVoteStatusResolver wraps persisted vote status for vote tally14// calculations and mutation.15//16// Parameters:17//   - voteStatus: persisted proposal vote status to resolve18//19// Returns:20//   - *ProposalVoteStatusResolver: resolver backed by voteStatus21func NewProposalVoteStatusResolver(voteStatus *governance.ProposalVoteStatus) *ProposalVoteStatusResolver {22	return &ProposalVoteStatusResolver{voteStatus}23}2425// TotalVoteWeight returns the total weight of all votes cast (yes + no).26//27// Returns:28//   - int64: combined "yes" and "no" vote weight29func (p *ProposalVoteStatusResolver) TotalVoteWeight() int64 {30	return gnsmath.SafeAddInt64(p.YesWeight(), p.NoWeight())31}3233// IsPassed determines if the proposal has passed the voting requirements.34// A proposal passes when total vote weight reaches quorum and "yes" votes35// strictly exceed "no" votes.36//37// Returns:38//   - bool: true when quorum is met and yes weight is greater than no weight39func (p *ProposalVoteStatusResolver) IsPassed() bool {40	if p.TotalVoteWeight() < p.QuorumAmount() {41		return false42	}4344	return p.YesWeight() > p.NoWeight()45}4647// addYesVoteWeight adds the specified weight to the "yes" vote tally.48// This is called when a user votes "yes" on the proposal.49//50// Parameters:51//   - yea: vote weight to add to "yes" votes52//53// Returns:54//   - error: always nil (reserved for future validation)55func (p *ProposalVoteStatusResolver) AddYesVoteWeight(yea int64) error {56	p.SetYesWeight(gnsmath.SafeAddInt64(p.YesWeight(), yea))57	return nil58}5960// addNoVoteWeight adds the specified weight to the "no" vote tally.61// This is called when a user votes "no" on the proposal.62//63// Parameters:64//   - nay: vote weight to add to "no" votes65//66// Returns:67//   - error: always nil (reserved for future validation)68func (p *ProposalVoteStatusResolver) AddNoVoteWeight(nay int64) error {69	p.SetNoWeight(gnsmath.SafeAddInt64(p.NoWeight(), nay))70	return nil71}72

    Functions

    Gnoland RPC unavailable (functions): rpc abci_query: HTTP 500

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

    Rendered

    RenderedRawgnoweb ↗
    This realm does not provide renderable output (vm/qrender → NoRenderDeclError). View on gnoweb ↗

    vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.