| 598 | var cachedReflectionService *runtimeservices.ReflectionService |
| 599 | |
| 600 | func getReflectionService() *runtimeservices.ReflectionService { |
| 601 | if cachedReflectionService != nil { |
| 602 | return cachedReflectionService |
| 603 | } |
| 604 | reflectionSvc, err := runtimeservices.NewReflectionService() |
| 605 | if err != nil { |
| 606 | panic(err) |
| 607 | } |
| 608 | cachedReflectionService = reflectionSvc |
| 609 | return reflectionSvc |
| 610 | } |
| 611 | |
| 612 | // NewProposalContext returns a context with a branched version of the state |
| 613 | // that is safe to query during ProcessProposal. |