Skip to content

Commit

Permalink
Renamed GetStatesInfo into GetPublicStatesInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
olomix committed Jan 14, 2025
1 parent 3960934 commit 48c5013
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 25 deletions.
5 changes: 3 additions & 2 deletions authV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ func (a AuthV2Inputs) InputsMarshal() ([]byte, error) {
return json.Marshal(s)
}

// GetStatesInfo returns states and gists information, implements StatesInfoProvider interface
func (a AuthV2Inputs) GetStatesInfo() (StatesInfo, error) {
// GetPublicStatesInfo returns states and gists information,
// implements PublicStatesInfoProvider interface
func (a AuthV2Inputs) GetPublicStatesInfo() (StatesInfo, error) {

if err := a.Validate(); err != nil {
return StatesInfo{}, err
Expand Down
4 changes: 2 additions & 2 deletions authV2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ func TestAuthV2Inputs_InputsMarshal(t *testing.T) {
require.JSONEq(t, exp, string(circuitInputJSON))
}

func TestAuthV2Inputs_GetStatesInfo(t *testing.T) {
func TestAuthV2Inputs_GetPublicStatesInfo(t *testing.T) {
inputs := authV2Inputs(t)
statesInfo, err := inputs.GetStatesInfo()
statesInfo, err := inputs.GetPublicStatesInfo()
require.NoError(t, err)

statesInfoJsonBytes, err := json.Marshal(statesInfo)
Expand Down
6 changes: 3 additions & 3 deletions circuits.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ type PubSignals interface {
PubSignalsMapper
}

// StatesInfoProvider interface should be implemented by types that can return
// PublicStatesInfoProvider interface should be implemented by types that can return
// states info
type StatesInfoProvider interface {
GetStatesInfo() (StatesInfo, error)
type PublicStatesInfoProvider interface {
GetPublicStatesInfo() (StatesInfo, error)
}

// StatesInfo struct. A collection of states and gists
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQueryMTPV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (a AtomicQueryMTPV2Inputs) InputsMarshal() ([]byte, error) {
return json.Marshal(s)
}

func (a AtomicQueryMTPV2Inputs) GetStatesInfo() (StatesInfo, error) {
func (a AtomicQueryMTPV2Inputs) GetPublicStatesInfo() (StatesInfo, error) {
if err := a.Validate(); err != nil {
return StatesInfo{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQueryMTPV2OnChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (a AtomicQueryMTPV2OnChainInputs) InputsMarshal() ([]byte, error) {
return json.Marshal(s)
}

func (a AtomicQueryMTPV2OnChainInputs) GetStatesInfo() (StatesInfo, error) {
func (a AtomicQueryMTPV2OnChainInputs) GetPublicStatesInfo() (StatesInfo, error) {
if err := a.Validate(); err != nil {
return StatesInfo{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQueryMTPV2OnChain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ func TestAttrQueryMTPV2OnChain_PrepareInputs(t *testing.T) {

}

func TestAttrQueryMTPV2OnChain_GetStatesInfo(t *testing.T) {
func TestAttrQueryMTPV2OnChain_GetPublicStatesInfo(t *testing.T) {
in := queryMTPV2OnChainInputs(t)
statesInfo, err := in.GetStatesInfo()
statesInfo, err := in.GetPublicStatesInfo()
require.NoError(t, err)

bs, err := json.Marshal(statesInfo)
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQueryMTPV2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ func TestAttrQueryMTPV2_PrepareInputs(t *testing.T) {
require.JSONEq(t, exp, string(bytesInputs))
}

func TestAttrQueryMTPV2_GetStatesInfo(t *testing.T) {
func TestAttrQueryMTPV2_GetPublicStatesInfo(t *testing.T) {
in := queryMTPV2Inputs(t)
statesInfo, err := in.GetStatesInfo()
statesInfo, err := in.GetPublicStatesInfo()
require.NoError(t, err)

bs, err := json.Marshal(statesInfo)
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQuerySigV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (a AtomicQuerySigV2Inputs) InputsMarshal() ([]byte, error) {
return json.Marshal(s)
}

func (a AtomicQuerySigV2Inputs) GetStatesInfo() (StatesInfo, error) {
func (a AtomicQuerySigV2Inputs) GetPublicStatesInfo() (StatesInfo, error) {
if err := a.Validate(); err != nil {
return StatesInfo{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQuerySigV2OnChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (a AtomicQuerySigV2OnChainInputs) InputsMarshal() ([]byte, error) {
return json.Marshal(s)
}

func (a AtomicQuerySigV2OnChainInputs) GetStatesInfo() (StatesInfo, error) {
func (a AtomicQuerySigV2OnChainInputs) GetPublicStatesInfo() (StatesInfo, error) {
if err := a.Validate(); err != nil {
return StatesInfo{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQuerySigV2OnChain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ func TestAttrQuerySigV2OnChain_PrepareInputs(t *testing.T) {
require.JSONEq(t, exp, string(bytesInputs))
}

func TestAttrQuerySigV2OnChain_GetStatesInfo(t *testing.T) {
func TestAttrQuerySigV2OnChain_GetPublicStatesInfo(t *testing.T) {
in := querySigV2OnChainInputs(t)
statesInfo, err := in.GetStatesInfo()
statesInfo, err := in.GetPublicStatesInfo()
require.NoError(t, err)

bs, err := json.Marshal(statesInfo)
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQuerySigV2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ func TestAttrQuerySigV2_PrepareInputs(t *testing.T) {

}

func TestAttrQuerySigV2_GetStatesInfo(t *testing.T) {
func TestAttrQuerySigV2_GetPublicStatesInfo(t *testing.T) {
in := querySigV2Inputs(t)
statesInfo, err := in.GetStatesInfo()
statesInfo, err := in.GetPublicStatesInfo()
require.NoError(t, err)

bs, err := json.Marshal(statesInfo)
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQueryV3.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (a AtomicQueryV3Inputs) fillSigProofWithZero(s *atomicQueryV3CircuitInputs)
s.IssuerAuthState = &merkletree.HashZero
}

func (a AtomicQueryV3Inputs) GetStatesInfo() (StatesInfo, error) {
func (a AtomicQueryV3Inputs) GetPublicStatesInfo() (StatesInfo, error) {

if err := a.Validate(); err != nil {
return StatesInfo{}, err
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQueryV3OnChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func (a AtomicQueryV3OnChainInputs) fillSigProofWithZero(s *atomicQueryV3OnChain
s.IssuerAuthState = &merkletree.HashZero
}

func (a AtomicQueryV3OnChainInputs) GetStatesInfo() (StatesInfo, error) {
func (a AtomicQueryV3OnChainInputs) GetPublicStatesInfo() (StatesInfo, error) {

if err := a.Validate(); err != nil {
return StatesInfo{}, err
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQueryV3OnChain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ func TestAttrQueryV3OnChain_SigPart_PrepareInputs(t *testing.T) {
require.JSONEq(t, exp, string(bytesInputs))
}

func TestAttrQueryV3OnChain_SigPart_GetStatesInfo(t *testing.T) {
func TestAttrQueryV3OnChain_SigPart_GetPublicStatesInfo(t *testing.T) {
in := createV3OnChaneInputs_Sig(t)

statesInfo, err := in.GetStatesInfo()
statesInfo, err := in.GetPublicStatesInfo()
require.NoError(t, err)

bs, err := json.Marshal(statesInfo)
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQueryV3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func TestAttrQueryV3_SigPart_PrepareInputs(t *testing.T) {
require.JSONEq(t, exp, string(bytesInputs))
}

func TestAttrQueryV3_SigPart_GetStateInfo(t *testing.T) {
func TestAttrQueryV3_SigPart_GetPublicStateInfo(t *testing.T) {
in := createV3Inputs_Sig(t)
statesInfo, err := in.GetStatesInfo()
statesInfo, err := in.GetPublicStatesInfo()
require.NoError(t, err)

statesInfoJsonBytes, err := json.Marshal(statesInfo)
Expand Down

0 comments on commit 48c5013

Please sign in to comment.