From 44e27ee9933210c90d106416a0ec65907cfca6dd Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 13 Nov 2023 19:08:20 -0800 Subject: [PATCH] rpc: update MultiverseRoot with new option API --- rpcserver.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index e875fb258..104905d92 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -2941,9 +2941,12 @@ func (r *rpcServer) MultiverseRoot(ctx context.Context, err) } - return &unirpc.MultiverseRootResponse{ - MultiverseRoot: marshalMssmtNode(rootNode), - }, nil + var resp unirpc.MultiverseRootResponse + rootNode.WhenSome(func(node universe.MultiverseRoot) { + resp.MultiverseRoot = marshalMssmtNode(node) + }) + + return &resp, nil } // AssetRoots queries for the known Universe roots associated with each known