> For the complete documentation index, see [llms.txt](https://docs.gnoswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gnoswap.io/contracts/gov/governance/voting_info.gno.md).

# voting\_info.gno

{% embed url="<https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno>" %}

## Types

### VotingInfo

```go
type VotingInfo struct
```

VotingInfo tracks voting-related information for a specific user on a specific proposal. This structure maintains the user's voting eligibility, voting history, and voting power.

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L5)

#### Methods

**AvailableVoteWeight**

```go
func (v VotingInfo) AvailableVoteWeight() int64
```

AvailableVoteWeight returns the total voting weight available to this user. This weight is determined at proposal creation time based on delegation snapshots.

#### Return Values

| Name    | Type  | Description             |
| ------- | ----- | ----------------------- |
| `int64` | int64 | available voting weight |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L103)

**IsVoted**

```go
func (v VotingInfo) IsVoted() bool
```

IsVoted checks if the user has already cast their vote.

#### Return Values

| Name   | Type | Description                             |
| ------ | ---- | --------------------------------------- |
| `bool` | bool | true if user has voted on this proposal |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L76)

**VotedAt**

```go
func (v VotingInfo) VotedAt() int64
```

VotedAt returns the timestamp when the vote was cast. Returns 0 if the user hasn't voted yet.

#### Return Values

| Name    | Type  | Description                  |
| ------- | ----- | ---------------------------- |
| `int64` | int64 | timestamp when vote was cast |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L138)

**VotedHeight**

```go
func (v VotingInfo) VotedHeight() int64
```

VotedHeight returns the block height when the vote was cast. Returns 0 if the user hasn't voted yet.

#### Return Values

| Name    | Type  | Description                     |
| ------- | ----- | ------------------------------- |
| `int64` | int64 | block height when vote was cast |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L125)

**VotedNo**

```go
func (v VotingInfo) VotedNo() bool
```

VotedNo checks if the user voted "no" on the proposal. Only meaningful if IsVoted() returns true.

#### Return Values

| Name   | Type | Description             |
| ------ | ---- | ----------------------- |
| `bool` | bool | true if user voted "no" |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L94)

**VotedWeight**

```go
func (v VotingInfo) VotedWeight() int64
```

VotedWeight returns the weight actually used when voting. Returns 0 if the user hasn't voted yet.

#### Return Values

| Name    | Type  | Description                               |
| ------- | ----- | ----------------------------------------- |
| `int64` | int64 | weight used for voting, or 0 if not voted |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L112)

**VotedYes**

```go
func (v VotingInfo) VotedYes() bool
```

VotedYes checks if the user voted "yes" on the proposal. Only meaningful if IsVoted() returns true.

#### Return Values

| Name   | Type | Description              |
| ------ | ---- | ------------------------ |
| `bool` | bool | true if user voted "yes" |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L85)

**VotingType**

```go
func (v VotingInfo) VotingType() string
```

VotingType returns a human-readable string representation of the vote choice.

#### Return Values

| Name     | Type   | Description                          |
| -------- | ------ | ------------------------------------ |
| `string` | string | "yes" or "no" based on voting choice |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L64)

#### Constructors

* `func DefaultVotingInfo() VotingInfo` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L34))
* `func NewVotedVotingInfo(availableVoteWeight int64, votedYes bool, votedWeight int64, votedHeight int64, votedAt int64) VotingInfo` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L49))
* `func NewVotingInfo(availableVoteWeight int64) VotingInfo` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/governance/voting_info.gno#L22))
