From df7408dae27d62aaed74554a0e648ff3e124146a Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Mon, 6 Nov 2023 11:16:05 -0500 Subject: [PATCH] Fix matching genesis state to be used as a current state for RHS --- inputs_sig.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inputs_sig.go b/inputs_sig.go index ad324b6..34d55a2 100644 --- a/inputs_sig.go +++ b/inputs_sig.go @@ -1790,7 +1790,7 @@ func identityStateForRHS(ctx context.Context, cfg EnvConfig, issuerID *core.ID, return nil, errors.New("current state is not found for the identity") } - stateIsGenesis, err := genesisStateMatch(state, *issuerID) + stateIsGenesis, err := genesisStateMatch(genesisState, *issuerID) if err != nil { return nil, err } @@ -1859,7 +1859,13 @@ func resolveRevStatusFromRHS(ctx context.Context, rhsURL string, cfg EnvConfig, } p.TreeState, err = treeStateFromRHS(ctx, rhsCli, state) - if err != nil { + if errors.Is(err, mp.ErrNodeNotFound) { + if genesisState != nil && state.Equals(genesisState) { + return p, errors.New("genesis state is not found in RHS") + } else { + return p, errors.New("current state is not found in RHS") + } + } else if err != nil { return p, err }