admin.gno
0.79 Kb · 36 lines
1package valopers
2
3import (
4 "gno.land/p/moul/authz"
5)
6
7var auth *authz.Authorizer
8
9func Auth() *authz.Authorizer {
10 return auth
11}
12
13func updateInstructions(newInstructions string) {
14 err := auth.DoByCurrent("update-instructions", func() error {
15 instructions = newInstructions
16 return nil
17 })
18 if err != nil {
19 panic(err)
20 }
21}
22
23func NewInstructionsProposalCallback(newInstructions string) func(realm) error {
24 cb := func(cur realm) error {
25 updateInstructions(newInstructions)
26 return nil
27 }
28
29 return cb
30}
31
32// The min-fee callback was removed: the fee now lives in sysparams
33// under node:valoper:register_fee, and
34// proposal.ProposeNewMinFeeProposalRequest delegates to
35// sys/params.NewSysParamUint64PropRequest. Removing avoids the
36// forward-compat hazard of a no-op shim with no caller-auth gating.