From 8db3d0d30410c61421b668e3d9cfb9d53d0762e0 Mon Sep 17 00:00:00 2001 From: go7066 Date: Fri, 29 Dec 2023 08:38:59 +0800 Subject: [PATCH] Add vrfAdmin initializer to avoid interruption during the deployment process --- examples/gno.land/r/demo/teritori/vrf/vrf.gno | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/gno.land/r/demo/teritori/vrf/vrf.gno b/examples/gno.land/r/demo/teritori/vrf/vrf.gno index d78f83f3fd6..ad22b70858d 100644 --- a/examples/gno.land/r/demo/teritori/vrf/vrf.gno +++ b/examples/gno.land/r/demo/teritori/vrf/vrf.gno @@ -52,6 +52,10 @@ const ( "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" ) +func init() { + config.vrfAdmin = std.GetOrigCaller().String() +} + // ErrLength reports an attempt to decode an odd-length input // using Decode or DecodeString. // The stream-based Decoder returns io.ErrUnexpectedEOF instead of ErrLength. @@ -159,10 +163,6 @@ func RenderRequests(startAfter uint64, limit uint64) string { } func SetVRFAdmin(vrfAdmin string) { - if config.vrfAdmin == "" { - config.vrfAdmin = vrfAdmin - return - } caller := std.GetOrigCaller() if config.vrfAdmin != caller.String() { panic("not allowed to update vrfAdmin") @@ -172,12 +172,12 @@ func SetVRFAdmin(vrfAdmin string) { } func SetFeeders(feedersText string) { - feeders := strings.Split(feedersText, ",") caller := std.GetOrigCaller() if config.vrfAdmin != caller.String() { panic("not allowed set feeders") } + feeders := strings.Split(feedersText, ",") config.feeders = feeders }