Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroga committed Jul 24, 2024
1 parent 413073c commit 30b97c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions pkg/services/blockchain/eth/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
stateNotFoundException = "execution reverted: State does not exist"
)

var IdentityStateApiTypes = apitypes.Types{
var IdentityStateAPITypes = apitypes.Types{
"IdentityState": []apitypes.Type{
{Name: "from", Type: "address"},
{Name: "timestamp", Type: "uint256"},
Expand All @@ -71,7 +71,7 @@ var IdentityStateApiTypes = apitypes.Types{
},
}

var GlobalStateApiTypes = apitypes.Types{
var GlobalStateAPITypes = apitypes.Types{
"GlobalState": []apitypes.Type{
{Name: "from", Type: "address"},
{Name: "timestamp", Type: "uint256"},
Expand Down Expand Up @@ -237,9 +237,9 @@ func (r *Resolver) Resolve(

signature := ""
if r.walletKey != "" && opts.Signature != "" {
primaryType := services.IDENTITY_STATE_TYPE
primaryType := services.IdentityStateType
if stateInfo == nil {
primaryType = services.GLOBAL_STATE_TYPE
primaryType = services.GlobalStateType
}
signature, err = r.signTypedData(primaryType, did, identityState)
if err != nil {
Expand Down Expand Up @@ -321,9 +321,9 @@ func (r *Resolver) TypedData(primaryType services.PrimaryType, did w3c.DID, iden
timestamp := TimeStamp()

switch primaryType {
case services.IDENTITY_STATE_TYPE:
case services.IdentityStateType:
primaryTypeString = "IdentityState"
apiTypes = IdentityStateApiTypes
apiTypes = IdentityStateAPITypes
message = apitypes.TypedDataMessage{
"from": walletAddress,
"timestamp": timestamp,
Expand All @@ -333,9 +333,9 @@ func (r *Resolver) TypedData(primaryType services.PrimaryType, did w3c.DID, iden
"createdAtTimestamp": createdAtTimestamp,
"replacedAtTimestamp": replacedAtTimestamp,
}
case services.GLOBAL_STATE_TYPE:
case services.GlobalStateType:
primaryTypeString = "GlobalState"
apiTypes = GlobalStateApiTypes
apiTypes = GlobalStateAPITypes
message = apitypes.TypedDataMessage{
"from": walletAddress,
"timestamp": timestamp,
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/blockchain/eth/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ func TestResolveSignature_Success(t *testing.T) {
require.NoError(t, err)
require.Equal(t, tt.expectedIdentityState, identityState)

primaryType := services.IDENTITY_STATE_TYPE
primaryType := services.IdentityStateType
if tt.expectedIdentityState.StateInfo == nil {
primaryType = services.GLOBAL_STATE_TYPE
primaryType = services.GlobalStateType
}

ok, _ := resolver.VerifyState(primaryType, identityState, *tt.userDID)
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ func (d *DidDocumentServices) GetDidDocument(ctx context.Context, did string, op
walletAddress, err := resolver.WalletAddress()

if err == nil && opts.Signature != "" {
primaryType := IDENTITY_STATE_TYPE
primaryType := IdentityStateType
if userDID.IDStrings[2] == "000000000000000000000000000000000000000000" {
primaryType = GLOBAL_STATE_TYPE
primaryType = GlobalStateType
}
eip712TypedData, err := resolver.TypedData(primaryType, *userDID, identityState, walletAddress)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ var (
type PrimaryType int32

const (
IDENTITY_STATE_TYPE PrimaryType = 0
GLOBAL_STATE_TYPE PrimaryType = 1
IdentityStateType PrimaryType = 0
GlobalStateType PrimaryType = 1
)

type IdentityState struct {
Expand Down

0 comments on commit 30b97c4

Please sign in to comment.