Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

sharedpoll source realm

Package sharedpoll is the Remix Lab shared-membership composition demo: a poll app whose electorate comes from an exi...

Overview

Package sharedpoll is the Remix Lab shared-membership composition demo: a poll app whose electorate comes from an existing shared membership realm instead of its own member list.

The shared realm is consulted read-only, when a poll opens, to snapshot its members. People join or leave through the shared realm's own interface. This app's administrators (who may create and open polls) are a separate, local set seeded with the deployer.

Functions 14

func AddAdmin

crossing Action
1func AddAdmin(cur realm, addr address, role string)
source

AddAdmin grants addr a local administrative role ("reviewer" or "owner").

func AdminRole

Action
1func AdminRole(addr address) string
source

AdminRole returns addr's local administrative role name ("none" when addr is not an administrator).

func CancelPoll

crossing Action
1func CancelPoll(cur realm, id uint64)
source

CancelPoll deletes a draft poll that was never opened. The poll's creator may cancel it, and so may anyone allowed to open polls.

func CreatePoll

crossing Action
1func CreatePoll(cur realm, title string, options string, durationSeconds int64) uint64
source

CreatePoll creates a draft poll. options are separated by "|".

func Descriptor

Action
1func Descriptor() core.AppDescriptor
source

Descriptor identifies this app's recipe, components and bindings.

func Finalize

crossing Action
1func Finalize(cur realm, id uint64)
source

Finalize commits a poll's result once its deadline has passed.

func HasVoted

Action
1func HasVoted(id uint64, addr address) bool
source

HasVoted reports whether addr voted in poll id.

func OpenPoll

crossing Action
1func OpenPoll(cur realm, id uint64)
source

OpenPoll snapshots the shared realm's current members as the electorate.

func Poll

Action
1func Poll(id uint64) (core.BallotView, bool)
source

Poll returns an inert summary of poll id.

func Polls

Action
1func Polls(offset, limit int) []core.BallotView
source

Polls pages through polls, newest first.

func RemoveAdmin

crossing Action
1func RemoveAdmin(cur realm, addr address)
source

RemoveAdmin removes a local administrator.

func Render

1func Render(path string) string
source

Render serves the overview, the poll list and single polls.

func SetRule

crossing Action
1func SetRule(cur realm, op string, rule string)
source

SetRule changes the rule for an operation, within its floor.

func Vote

crossing Action
1func Vote(cur realm, id uint64, choice int)
source

Vote casts the caller's vote for option index choice.

Dependencies

Source Files 4