arcade_reads.gno
1.14 Kb · 16 lines
1package memba_weighted_host
2
3import "strconv"
4
5func (h *Host) arcadeConfigJSON() string {
6 if h.arcadePolicy == nil {
7 return ""
8 }
9 return `,"arcadePolicy":{"target":` + quoteJSON(ArcadePath) + `,"successor":` + quoteJSON(string(h.arcadePolicy.Successor())) + `,"attesterCategory":"critical","unpauseCategory":"financial","emergencyPause":true,"returnStagesOnly":true,"invalidatesOtherProposals":true}`
10}
11func arcadeStateJSON(s ArcadeState) string {
12 return `{"owner":` + quoteJSON(string(s.Owner)) + `,"pendingOwner":` + quoteJSON(string(s.PendingOwner)) + `,"paused":` + strconv.FormatBool(s.Paused) + `,"ownerListed":` + strconv.FormatBool(s.OwnerListed) + `,"daoListed":` + strconv.FormatBool(s.DAOListed) + `,"successorListed":` + strconv.FormatBool(s.SuccessorListed) + `,"subjectListed":` + strconv.FormatBool(s.SubjectListed) + `}`
13}
14func arcadeActionJSON(a ArcadeAction, s ArcadeState) string {
15 return `{"type":"arcade","target":` + quoteJSON(ArcadePath) + `,"operation":` + quoteJSON(string(a.Kind())) + `,"recipient":` + quoteJSON(string(a.Recipient())) + `,"attester":` + quoteJSON(string(a.Attester())) + `,"before":` + arcadeStateJSON(s) + `}`
16}