Skip to content

Commit

Permalink
Fix matching genesis state to be used as a current state for RHS
Browse files Browse the repository at this point in the history
  • Loading branch information
olomix committed Nov 6, 2023
1 parent 05d2ee3 commit df7408d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions inputs_sig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit df7408d

Please sign in to comment.