diff --git a/Dockerfile b/Dockerfile index 9c0f1ee..16d00d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.19-alpine as buildbase RUN apk add git build-base -WORKDIR /go/src/github.com/rarimo/identity-relayer-svc +WORKDIR /go/src/github.com/rarimo/worldcoin-relayer-svc COPY vendor . COPY . . @@ -10,7 +10,7 @@ ENV GO111MODULE="on" ENV CGO_ENABLED=1 ENV GOOS="linux" -RUN GOOS=linux go build -o /usr/local/bin/relayer-svc /go/src/github.com/rarimo/identity-relayer-svc +RUN GOOS=linux go build -o /usr/local/bin/relayer-svc /go/src/github.com/rarimo/worldcoin-relayer-svc FROM alpine:3.9 diff --git a/README.md b/README.md index 04af59e..8801192 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,9 @@ The Relayer service as a part of Rarimo cross-chain system designed to finalize transferring flow by submitting final transaction to the target chain. -The goal of identity relayer is to observe and fetch information about new signatures for -`IDENTITY_STATE_TRANSFER` and `IDENTITY_GIST_TRANSFER` operations and after submit the state transit transactions to -configured EVM chain by request. - -For more information about how the PolygonID identity transfer works -visit: [rarimo-core docs](https://rarimo.github.io/rarimo-core/docs/common/bridging/002-identity.html). +The goal of WorldCoin identity relayer is to observe and fetch information about new signatures +for `WORLDCOIN_IDENTITY_TRANSFER` operations and after submit the state transit transactions to configured EVM chain by +request. ---- @@ -132,16 +129,6 @@ volumes: } ``` -2. Execute the POST `/integrations/relayer/gist/relay` request with the following body to perform gist publishing: - -```json -{ - "chain": "The name of chain submit to according to the service configuration", - "hash": "The GIST hash (the same as on state contract) in 0x... hex format", - "waitConfirm": true -} -``` - `"waitConfirm": true` - indicates if request should wait until transaction will be included into the block. Default - `false`. diff --git a/docs/static/service.swagger.json b/docs/static/service.swagger.json index 13d0104..351006d 100644 --- a/docs/static/service.swagger.json +++ b/docs/static/service.swagger.json @@ -16,69 +16,7 @@ "application/json" ], "paths": { - "/integrations/relayer/gist/relay": { - "post": { - "operationId": "Service_GistRelay", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/MsgRelayResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RelayBody" - } - } - ], - "tags": [ - "Service" - ] - } - }, - "/integrations/relayer/gist/relay/{hash}": { - "get": { - "operationId": "Service_GISTRelays", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/MsgRelaysResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "hash", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Service" - ] - } - }, - "/integrations/relayer/state/relay": { + "/integrations/relayer-wc/state/relay": { "post": { "operationId": "Service_StateRelay", "responses": { @@ -110,7 +48,7 @@ ] } }, - "/integrations/relayer/state/relay/{hash}": { + "/integrations/relayer-wc/state/relay/{hash}": { "get": { "operationId": "Service_StateRelays", "responses": { diff --git a/go.mod b/go.mod index 74d20d3..281119f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/rarimo/identity-relayer-svc +module github.com/rarimo/worldcoin-relayer-svc go 1.19 @@ -6,7 +6,7 @@ require ( github.com/alecthomas/kingpin v2.2.6+incompatible github.com/cosmos/cosmos-sdk v0.46.12 github.com/ethereum/go-ethereum v1.10.26 - github.com/rarimo/rarimo-core v1.0.7-0.20231123231906-566dc0033e75 + github.com/rarimo/rarimo-core v1.0.7-0.20231208125434-eaf4ddf6c070 github.com/spf13/cast v1.5.1 github.com/stretchr/testify v1.8.3 // indirect github.com/tendermint/tendermint v0.34.27 diff --git a/go.sum b/go.sum index fb83d52..b5db815 100644 --- a/go.sum +++ b/go.sum @@ -551,8 +551,8 @@ github.com/rarimo/cosmos-sdk v0.46.7 h1:jU2PiWzc+19SF02cXM0O0puKPeH1C6Q6t2lzJ9s1 github.com/rarimo/cosmos-sdk v0.46.7/go.mod h1:fqKqz39U5IlEFb4nbQ72951myztsDzFKKDtffYJ63nk= github.com/rarimo/go-merkle v0.0.0-20231004122345-36fa49031c66 h1:1KAU4rfWWJwAJ/kencagL3k5BXN3HhP004QNkEUgvDE= github.com/rarimo/go-merkle v0.0.0-20231004122345-36fa49031c66/go.mod h1:5Pt9Lk8w7fWhyRO/NMb5x8DRhF2lESRVPT5uOlezInQ= -github.com/rarimo/rarimo-core v1.0.7-0.20231123231906-566dc0033e75 h1:gCVlgChRHbV6aemA+WM6BDyexRvr/V8MtG7cInwF/k4= -github.com/rarimo/rarimo-core v1.0.7-0.20231123231906-566dc0033e75/go.mod h1:S8d3kZWPFuNsy7llrzUd8Rj92WSCrjSH2YEUD+2A+Ww= +github.com/rarimo/rarimo-core v1.0.7-0.20231208125434-eaf4ddf6c070 h1:gug/AW6noXk5m1yff/1u2CBz8UDSWRonZPhfPAdm04k= +github.com/rarimo/rarimo-core v1.0.7-0.20231208125434-eaf4ddf6c070/go.mod h1:auP3KgxaSwkOUrLWBifjnMbbSQTSBA9Y/gVgq1WU/B4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= diff --git a/internal/assets/migrations/002_gist.sql b/internal/assets/migrations/002_gist.sql deleted file mode 100644 index e5535ea..0000000 --- a/internal/assets/migrations/002_gist.sql +++ /dev/null @@ -1,21 +0,0 @@ --- +migrate Up - -create table gists -( - id text primary key not null, - operation text unique not null, - confirmation text not null -); - -create table gist_transitions -( - tx text primary key not null, - gist text not null, - chain text not null -); - -create index gist_transitions_index on gist_transitions (gist); - --- +migrate Down -drop table gists; -drop table gist_transitions; \ No newline at end of file diff --git a/internal/cli/main.go b/internal/cli/main.go index 4a5ec85..df50a34 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -3,10 +3,10 @@ package cli import ( "context" - "github.com/rarimo/identity-relayer-svc/internal/services" - "github.com/rarimo/identity-relayer-svc/internal/services/ingester" + "github.com/rarimo/worldcoin-relayer-svc/internal/services" + "github.com/rarimo/worldcoin-relayer-svc/internal/services/ingester" - "github.com/rarimo/identity-relayer-svc/internal/config" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" "github.com/alecthomas/kingpin" "gitlab.com/distributed_lab/kit/kv" @@ -46,7 +46,6 @@ func Run(args []string) bool { switch cmd { case runAllCmd.FullCommand(): go ingester.NewService(cfg, ingester.NewStateIngester(cfg)).Run(ctx) - go ingester.NewService(cfg, ingester.NewGistIngester(cfg)).Run(ctx) err = services.NewServer(cfg).Run() case migrateUpCmd.FullCommand(): err = MigrateUp(cfg) diff --git a/internal/cli/migrate.go b/internal/cli/migrate.go index b37db20..e1928bb 100644 --- a/internal/cli/migrate.go +++ b/internal/cli/migrate.go @@ -1,8 +1,8 @@ package cli import ( - "github.com/rarimo/identity-relayer-svc/internal/assets" - "github.com/rarimo/identity-relayer-svc/internal/config" + "github.com/rarimo/worldcoin-relayer-svc/internal/assets" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" migrate "github.com/rubenv/sql-migrate" "gitlab.com/distributed_lab/logan/v3/errors" ) diff --git a/internal/config/relay.go b/internal/config/relay.go index 0abaf4a..b2674cb 100644 --- a/internal/config/relay.go +++ b/internal/config/relay.go @@ -7,9 +7,7 @@ import ( ) type RelayConfig struct { - CatchupDisabled bool `fig:"catchup_disabled"` - IssuerID []string `fig:"issuer_id"` - DisableFiltration bool `fig:"disable_filtration"` + CatchupDisabled bool `fig:"catchup_disabled"` } func (c *config) Relay() RelayConfig { diff --git a/internal/core/main.go b/internal/core/main.go index 268c16a..1f4d2c5 100644 --- a/internal/core/main.go +++ b/internal/core/main.go @@ -8,8 +8,8 @@ import ( "github.com/ava-labs/subnet-evm/accounts/abi" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/rarimo/identity-relayer-svc/internal/config" rarimocore "github.com/rarimo/rarimo-core/x/rarimocore/types" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" "gitlab.com/distributed_lab/logan/v3" "gitlab.com/distributed_lab/logan/v3/errors" ) @@ -60,7 +60,7 @@ func (c *Core) GetIdentityStateTransferProof(ctx context.Context, operationID st return nil, errors.Wrap(err, "failed to get the operation") } - transfer, err := pkg.GetIdentityStateTransfer(operation.Operation) + transfer, err := pkg.GetWorldCoinIdentityTransfer(operation.Operation) if err != nil { return nil, errors.Wrap(err, "failed to parse operation details") } @@ -74,37 +74,3 @@ func (c *Core) GetIdentityStateTransferProof(ctx context.Context, operationID st return &result, nil } - -func (c *Core) GetIdentityGISTTransferProof(ctx context.Context, operationID string) (*IdentityGISTTransferDetails, error) { - proof, err := c.core.OperationProof(ctx, &rarimocore.QueryGetOperationProofRequest{Index: operationID}) - if err != nil { - return nil, errors.Wrap(err, "failed to get the operation proof") - } - - pathHashes := make([]common.Hash, 0, len(proof.Path)) - for _, p := range proof.Path { - pathHashes = append(pathHashes, common.HexToHash(p)) - } - - signature := hexutil.MustDecode(proof.Signature) - signature[64] += 27 - - operation, err := c.core.Operation(context.TODO(), &rarimocore.QueryGetOperationRequest{Index: operationID}) - if err != nil { - return nil, errors.Wrap(err, "failed to get the operation") - } - - transfer, err := pkg.GetIdentityGISTTransfer(operation.Operation) - if err != nil { - return nil, errors.Wrap(err, "failed to parse operation details") - } - - result := IdentityGISTTransferDetails{Operation: transfer} - - result.Proof, err = proofArgs.Pack(pathHashes, signature) - if err != nil { - return nil, errors.Wrap(err, "failed to encode the proof") - } - - return &result, nil -} diff --git a/internal/core/types.go b/internal/core/types.go index be9593f..2b35fb3 100644 --- a/internal/core/types.go +++ b/internal/core/types.go @@ -3,11 +3,6 @@ package core import rarimocore "github.com/rarimo/rarimo-core/x/rarimocore/types" type IdentityStateTransferDetails struct { - Operation *rarimocore.IdentityStateTransfer - Proof []byte -} - -type IdentityGISTTransferDetails struct { - Operation *rarimocore.IdentityGISTTransfer + Operation *rarimocore.WorldCoinIdentityTransfer Proof []byte } diff --git a/internal/data/pg/schema.xo.go b/internal/data/pg/schema.xo.go index 3100bbc..08d94ad 100644 --- a/internal/data/pg/schema.xo.go +++ b/internal/data/pg/schema.xo.go @@ -7,7 +7,7 @@ import ( "context" "database/sql" - "github.com/rarimo/identity-relayer-svc/internal/data" + "github.com/rarimo/worldcoin-relayer-svc/internal/data" "gitlab.com/distributed_lab/kit/pgdb" "gitlab.com/distributed_lab/logan/v3/errors" ) diff --git a/internal/proto/service.proto b/internal/proto/service.proto index 8b04614..07458f2 100644 --- a/internal/proto/service.proto +++ b/internal/proto/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/rarimo/identity-relayer-svc/internal/types"; +option go_package = "github.com/rarimo/worldcoin-relayer-svc/internal/types"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; @@ -8,27 +8,14 @@ import "google/api/annotations.proto"; service Service { rpc StateRelay(MsgStateRelayRequest) returns (MsgRelayResponse){ option (google.api.http) = { - post: "/integrations/relayer/state/relay" - body: "body" - }; - }; - - rpc GistRelay(MsgGISTRelayRequest) returns (MsgRelayResponse){ - option (google.api.http) = { - post: "/integrations/relayer/gist/relay" + post: "/integrations/relayer-wc/state/relay" body: "body" }; }; rpc StateRelays(MsgRelaysRequest) returns (MsgRelaysResponse){ option (google.api.http) = { - get: "/integrations/relayer/state/relay/{hash}" - }; - }; - - rpc GISTRelays(MsgRelaysRequest) returns (MsgRelaysResponse){ - option (google.api.http) = { - get: "/integrations/relayer/gist/relay/{hash}" + get: "/integrations/relayer-wc/state/relay/{hash}" }; }; } @@ -37,10 +24,6 @@ message MsgStateRelayRequest { RelayBody body = 1; } -message MsgGISTRelayRequest { - RelayBody body = 1; -} - message RelayBody { string hash = 1; string chain = 2; diff --git a/internal/services/ingester/gist_transfer.go b/internal/services/ingester/gist_transfer.go deleted file mode 100644 index 9119653..0000000 --- a/internal/services/ingester/gist_transfer.go +++ /dev/null @@ -1,122 +0,0 @@ -package ingester - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/rarimo/identity-relayer-svc/internal/config" - "github.com/rarimo/identity-relayer-svc/internal/data" - "github.com/rarimo/identity-relayer-svc/internal/data/pg" - "github.com/rarimo/rarimo-core/x/rarimocore/crypto/pkg" - rarimocore "github.com/rarimo/rarimo-core/x/rarimocore/types" - "gitlab.com/distributed_lab/logan/v3" - "gitlab.com/distributed_lab/logan/v3/errors" -) - -type gistIngester struct { - log *logan.Entry - rarimocore rarimocore.QueryClient - storage *pg.Storage -} - -var _ Processor = &gistIngester{} - -func NewGistIngester(cfg config.Config) Processor { - return &gistIngester{ - log: cfg.Log(), - rarimocore: rarimocore.NewQueryClient(cfg.Cosmos()), - storage: pg.New(cfg.DB()), - } -} - -func (s *gistIngester) query() string { - return gistQuery -} - -func (s *gistIngester) name() string { - return "identity-gist-ingester" -} - -func (s *gistIngester) catchup(ctx context.Context) error { - s.log.Info("Starting catchup") - defer s.log.Info("Catchup finished") - - var nextKey []byte - - for { - operations, err := s.rarimocore.OperationAll(ctx, &rarimocore.QueryAllOperationRequest{Pagination: &query.PageRequest{Key: nextKey}}) - if err != nil { - panic(err) - } - - for _, op := range operations.Operation { - if op.Status == rarimocore.OpStatus_SIGNED && op.OperationType == rarimocore.OpType_IDENTITY_GIST_TRANSFER { - if err := s.trySave(ctx, op); err != nil { - return err - } - } - } - - nextKey = operations.Pagination.NextKey - if nextKey == nil { - return nil - } - } -} - -func (s *gistIngester) process( - ctx context.Context, - confirmationID string, -) error { - log := s.log.WithField("confirmation_id", confirmationID) - log.Info("processing a confirmation") - - rawConf, err := s.rarimocore.Confirmation(ctx, &rarimocore.QueryGetConfirmationRequest{Root: confirmationID}) - if err != nil { - return errors.Wrap(err, "failed to get confirmation", logan.F{ - "confirmation_id": confirmationID, - }) - } - - for _, index := range rawConf.Confirmation.Indexes { - operation, err := s.rarimocore.Operation(ctx, &rarimocore.QueryGetOperationRequest{Index: index}) - if err != nil { - return errors.Wrap(err, "failed to get operation", logan.F{ - "operation_index": operation.Operation.Index, - }) - } - - if err := s.trySave(ctx, operation.Operation); err != nil { - return err - } - } - - return nil - -} - -func (s *gistIngester) trySave(ctx context.Context, operation rarimocore.Operation) error { - if operation.OperationType == rarimocore.OpType_IDENTITY_GIST_TRANSFER { - s.log.WithField("operation_index", operation.Index).Info("Trying to save op") - - op, err := pkg.GetIdentityGISTTransfer(operation) - if err != nil { - return errors.Wrap(err, "failed to parse identity gist transfer", logan.F{ - "operation_index": operation.Index, - }) - } - - err = s.storage.GistQ().UpsertCtx(ctx, &data.Gist{ - ID: op.GISTHash, - Operation: operation.Index, - }) - - if err != nil { - return errors.Wrap(err, "failed to upsert identity gist transfer", logan.F{ - "operation_index": operation.Index, - }) - } - } - - return nil -} diff --git a/internal/services/ingester/main.go b/internal/services/ingester/main.go index 37d9987..58a660c 100644 --- a/internal/services/ingester/main.go +++ b/internal/services/ingester/main.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/rarimo/identity-relayer-svc/internal/config" rarimocore "github.com/rarimo/rarimo-core/x/rarimocore/types" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" "github.com/tendermint/tendermint/rpc/client/http" "gitlab.com/distributed_lab/logan/v3" "gitlab.com/distributed_lab/logan/v3/errors" @@ -14,8 +14,7 @@ import ( ) const ( - stateQuery = "tm.event='Tx' AND operation_signed.operation_type='IDENTITY_STATE_TRANSFER'" - gistQuery = "tm.event='Tx' AND operation_signed.operation_type='IDENTITY_GIST_TRANSFER'" + stateQuery = "tm.event='Tx' AND operation_signed.operation_type='WORLDCOIN_IDENTITY_TRANSFER'" ) type Service struct { diff --git a/internal/services/ingester/state_transfer.go b/internal/services/ingester/state_transfer.go index ce71ea9..28db6b6 100644 --- a/internal/services/ingester/state_transfer.go +++ b/internal/services/ingester/state_transfer.go @@ -4,11 +4,11 @@ import ( "context" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/rarimo/identity-relayer-svc/internal/config" - "github.com/rarimo/identity-relayer-svc/internal/data" - "github.com/rarimo/identity-relayer-svc/internal/data/pg" "github.com/rarimo/rarimo-core/x/rarimocore/crypto/pkg" rarimocore "github.com/rarimo/rarimo-core/x/rarimocore/types" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" + "github.com/rarimo/worldcoin-relayer-svc/internal/data" + "github.com/rarimo/worldcoin-relayer-svc/internal/data/pg" "gitlab.com/distributed_lab/logan/v3" "gitlab.com/distributed_lab/logan/v3/errors" ) @@ -17,28 +17,15 @@ type stateIngester struct { log *logan.Entry rarimocore rarimocore.QueryClient storage *pg.Storage - filter func(string) bool } var _ Processor = &stateIngester{} func NewStateIngester(cfg config.Config) Processor { - filtrationDisabled := cfg.Relay().DisableFiltration - allowList := mp(cfg.Relay().IssuerID) - - filter := func(id string) bool { - if filtrationDisabled { - return true - } - _, ok := allowList[id] - return ok - } - return &stateIngester{ log: cfg.Log(), rarimocore: rarimocore.NewQueryClient(cfg.Cosmos()), storage: pg.New(cfg.DB()), - filter: filter, } } @@ -47,7 +34,7 @@ func (s *stateIngester) query() string { } func (s *stateIngester) name() string { - return "identity-state-ingester" + return "worldcoin-identity-state-ingester" } func (s *stateIngester) catchup(ctx context.Context) error { @@ -63,7 +50,7 @@ func (s *stateIngester) catchup(ctx context.Context) error { } for _, op := range operations.Operation { - if op.Status == rarimocore.OpStatus_SIGNED && op.OperationType == rarimocore.OpType_IDENTITY_DEFAULT_TRANSFER { + if op.Status == rarimocore.OpStatus_SIGNED && op.OperationType == rarimocore.OpType_WORLDCOIN_IDENTITY_TRANSFER { if err := s.trySave(ctx, op); err != nil { return err } @@ -109,28 +96,23 @@ func (s *stateIngester) process( } func (s *stateIngester) trySave(ctx context.Context, operation rarimocore.Operation) error { - if operation.OperationType == rarimocore.OpType_IDENTITY_STATE_TRANSFER { + if operation.OperationType == rarimocore.OpType_WORLDCOIN_IDENTITY_TRANSFER { s.log.WithField("operation_index", operation.Index).Info("Trying to save op") - op, err := pkg.GetIdentityStateTransfer(operation) + op, err := pkg.GetWorldCoinIdentityTransfer(operation) if err != nil { - return errors.Wrap(err, "failed to parse identity default transfer", logan.F{ + return errors.Wrap(err, "failed to parse worldcoin identity transfer", logan.F{ "operation_index": operation.Index, }) } - if !s.filter(op.Id) { - s.log.WithField("operation_index", operation.Index).Info("Issuer ID is not supported") - return nil - } - err = s.storage.StateQ().UpsertCtx(ctx, &data.State{ - ID: op.StateHash, + ID: op.State, Operation: operation.Index, }) if err != nil { - return errors.Wrap(err, "failed to upsert identity default transfer", logan.F{ + return errors.Wrap(err, "failed to upsert worldcoin identity transfer", logan.F{ "operation_index": operation.Index, }) } diff --git a/internal/services/ingester/util.go b/internal/services/ingester/util.go deleted file mode 100644 index 694ea74..0000000 --- a/internal/services/ingester/util.go +++ /dev/null @@ -1,10 +0,0 @@ -package ingester - -func mp(arr []string) map[string]struct{} { - res := make(map[string]struct{}, len(arr)) - - for _, v := range arr { - res[v] = struct{}{} - } - return res -} diff --git a/internal/services/relayer/main.go b/internal/services/relayer/main.go index 5272931..b9d70c6 100644 --- a/internal/services/relayer/main.go +++ b/internal/services/relayer/main.go @@ -7,13 +7,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" - "github.com/rarimo/identity-relayer-svc/internal/config" - "github.com/rarimo/identity-relayer-svc/internal/core" - "github.com/rarimo/identity-relayer-svc/internal/data" - "github.com/rarimo/identity-relayer-svc/internal/data/pg" - "github.com/rarimo/identity-relayer-svc/internal/utils" - "github.com/rarimo/identity-relayer-svc/pkg/polygonid/contracts" - rarimocore "github.com/rarimo/rarimo-core/x/rarimocore/types" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" + "github.com/rarimo/worldcoin-relayer-svc/internal/core" + "github.com/rarimo/worldcoin-relayer-svc/internal/data" + "github.com/rarimo/worldcoin-relayer-svc/internal/data/pg" + "github.com/rarimo/worldcoin-relayer-svc/internal/utils" + "github.com/rarimo/worldcoin-relayer-svc/pkg/polygonid/contracts" "gitlab.com/distributed_lab/logan/v3" "gitlab.com/distributed_lab/logan/v3/errors" ) @@ -58,24 +57,6 @@ func (c *Service) StateRelays(ctx context.Context, state string) ([]data.Transit return transitions, nil } -func (c *Service) GistRelays(ctx context.Context, gist string) ([]data.GistTransition, error) { - entry, err := c.storage.GistQ().GistByIDCtx(ctx, gist, false) - if err != nil { - return nil, errors.Wrap(err, "failed to get entry by state") - } - - if entry == nil { - return nil, ErrEntryNotFound - } - - transitions, err := c.storage.GistTransitionQ().GistTransitionsByGistCtx(ctx, gist, false) - if err != nil { - return nil, errors.Wrap(err, "failed to get transition") - } - - return transitions, nil -} - func (c *Service) StateRelay(ctx context.Context, state string, chainName string, waitTxConfirm bool) (txhash string, err error) { chain, ok := c.chains.GetChainByName(chainName) if !ok { @@ -98,28 +79,6 @@ func (c *Service) StateRelay(ctx context.Context, state string, chainName string return c.processIdentityStateTransfer(ctx, chain, entry, waitTxConfirm) } -func (c *Service) GistRelay(ctx context.Context, gist string, chainName string, waitTxConfirm bool) (txhash string, err error) { - chain, ok := c.chains.GetChainByName(chainName) - if !ok { - return "", ErrChainNotFound - } - - entry, err := c.storage.GistQ().GistByIDCtx(ctx, gist, false) - if err != nil { - return "", errors.Wrap(err, "failed to get entry by gist") - } - - if entry == nil { - return "", ErrEntryNotFound - } - - if err := c.checkGISTTransitionNotExist(ctx, gist, chainName); err != nil { - return "", err - } - - return c.processIdentityGISTTransfer(ctx, chain, entry, waitTxConfirm) -} - func (c *Service) checkTransitionNotExist(ctx context.Context, state, chain string) error { transitions, err := c.storage.TransitionQ().TransitionsByStateCtx(ctx, state, false) if err != nil { @@ -139,25 +98,6 @@ func (c *Service) checkTransitionNotExist(ctx context.Context, state, chain stri return nil } -func (c *Service) checkGISTTransitionNotExist(ctx context.Context, state, chain string) error { - transitions, err := c.storage.GistTransitionQ().GistTransitionsByGistCtx(ctx, state, false) - if err != nil { - return errors.Wrap(err, "failed to get transition") - } - - if len(transitions) == 0 { - return nil - } - - for _, transition := range transitions { - if transition.Chain == chain { - return ErrAlreadySubmitted - } - } - - return nil -} - func (c *Service) processIdentityStateTransfer(ctx context.Context, chain *config.EVMChain, entry *data.State, waitTxConfirm bool) (txhash string, err error) { opts := chain.TransactorOpts() @@ -178,24 +118,22 @@ func (c *Service) processIdentityStateTransfer(ctx context.Context, chain *confi return "", errors.Wrap(err, "failed to get operation proof details") } - stateInfo, err := getStateInfo(details.Operation) - if err != nil { - return "", errors.Wrap(err, "failed to get state info from transfer") - } - - contract, err := contracts.NewLightweightStateV2(chain.ContractAddress, chain.RPC) + contract, err := contracts.NewIdentityManager(chain.ContractAddress, chain.RPC) if err != nil { return "", errors.Wrap(err, "failed to create contract instance") } - prevState := new(big.Int).SetBytes(hexutil.MustDecode(details.Operation.ReplacedStateHash)) + prevRoot := new(big.Int).SetBytes(hexutil.MustDecode(details.Operation.PrevState)) + root := new(big.Int).SetBytes(hexutil.MustDecode(details.Operation.State)) + timestamp, _ := new(big.Int).SetString(details.Operation.Timestamp, 10) - tx, err := contract.SignedTransitStateData(opts, prevState, stateInfo, details.Proof) + tx, err := contract.SignedTransitRoot(opts, prevRoot, root, timestamp, details.Proof) if err != nil { c.log.Debugf( - "Tx args: %s, %v, %s", - prevState.String(), - stateInfo, + "Tx args: %s, %s, %s, %s", + prevRoot.String(), + root.String(), + timestamp.String(), hexutil.Encode(details.Proof), ) return "", errors.Wrap(err, "failed to send state transition tx") @@ -218,66 +156,6 @@ func (c *Service) processIdentityStateTransfer(ctx context.Context, chain *confi return tx.Hash().Hex(), nil } -func (c *Service) processIdentityGISTTransfer(ctx context.Context, chain *config.EVMChain, entry *data.Gist, waitTxConfirm bool) (txhash string, err error) { - opts := chain.TransactorOpts() - - nonce, err := chain.RPC.PendingNonceAt(context.TODO(), chain.SubmitterAddress) - if err != nil { - return "", errors.Wrap(err, "failed to fetch a nonce") - } - - opts.Nonce = big.NewInt(int64(nonce)) - - opts.GasPrice, err = chain.RPC.SuggestGasPrice(ctx) - if err != nil { - return "", errors.Wrap(err, "failed to get suggested gas price") - } - - details, err := c.core.GetIdentityGISTTransferProof(ctx, entry.Operation) - if err != nil { - return "", errors.Wrap(err, "failed to get operation proof details") - } - - gistInfo, err := getGistRootInfo(details.Operation) - if err != nil { - return "", errors.Wrap(err, "failed to get gist info from transfer") - } - - contract, err := contracts.NewLightweightStateV2(chain.ContractAddress, chain.RPC) - if err != nil { - return "", errors.Wrap(err, "failed to create contract instance") - } - - prevGist := new(big.Int).SetBytes(hexutil.MustDecode(details.Operation.ReplacedGISTHash)) - - tx, err := contract.SignedTransitGISTData(opts, prevGist, gistInfo, details.Proof) - if err != nil { - c.log.Debugf( - "Tx args: %s, %v, %s", - prevGist.String(), - gistInfo, - hexutil.Encode(details.Proof), - ) - return "", errors.Wrap(err, "failed to send gist transition tx") - } - - transition := data.GistTransition{ - Tx: tx.Hash().String(), - Gist: entry.ID, - Chain: chain.Name, - } - - if err := c.storage.GistTransitionQ().InsertCtx(ctx, &transition); err != nil { - c.log.WithError(err).Error("failed to create transition entry") - } - - if waitTxConfirm { - c.waitTxConfirmation(ctx, chain, tx) - } - - return tx.Hash().Hex(), nil -} - func (c *Service) waitTxConfirmation(ctx context.Context, chain *config.EVMChain, tx *types.Transaction) { receipt, err := bind.WaitMined(ctx, chain.RPC, tx) if err != nil { @@ -302,43 +180,3 @@ func (c *Service) waitTxConfirmation(ctx context.Context, chain *config.EVMChain }). Info("evm transaction confirmed") } - -func getStateInfo(transfer *rarimocore.IdentityStateTransfer) (state contracts.ILightweightStateV2StateData, err error) { - state.Id = new(big.Int).SetBytes(hexutil.MustDecode(transfer.Id)) - - state.State = new(big.Int).SetBytes(hexutil.MustDecode(transfer.StateHash)) - - var ok bool - state.CreatedAtTimestamp, ok = big.NewInt(0).SetString(transfer.StateCreatedAtTimestamp, 10) - if !ok { - return contracts.ILightweightStateV2StateData{}, errors.New("failed to decode state created at timestamp") - } - - state.CreatedAtBlock, ok = big.NewInt(0).SetString(transfer.StateCreatedAtBlock, 10) - if !ok { - return contracts.ILightweightStateV2StateData{}, errors.New("failed to decode state created at block") - } - - // Will not be used in proof - state.ReplacedByState = big.NewInt(0) - return -} - -func getGistRootInfo(transfer *rarimocore.IdentityGISTTransfer) (gistRoot contracts.ILightweightStateV2GistRootData, err error) { - gistRoot.Root = new(big.Int).SetBytes(hexutil.MustDecode(transfer.GISTHash)) - - var ok bool - gistRoot.CreatedAtTimestamp, ok = big.NewInt(0).SetString(transfer.GISTCreatedAtTimestamp, 10) - if !ok { - return contracts.ILightweightStateV2GistRootData{}, errors.New("failed to decode GIST created at timestamp") - } - - gistRoot.CreatedAtBlock, ok = big.NewInt(0).SetString(transfer.GISTCreatedAtBlock, 10) - if !ok { - return contracts.ILightweightStateV2GistRootData{}, errors.New("failed to decode GIST created at block") - } - - // Will not be used in proof - gistRoot.ReplacedByRoot = big.NewInt(0) - return -} diff --git a/internal/services/server.go b/internal/services/server.go index ca4f617..3941e9d 100644 --- a/internal/services/server.go +++ b/internal/services/server.go @@ -6,11 +6,11 @@ import ( "net/http" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/rarimo/identity-relayer-svc/docs" - "github.com/rarimo/identity-relayer-svc/internal/config" - "github.com/rarimo/identity-relayer-svc/internal/data/pg" - "github.com/rarimo/identity-relayer-svc/internal/services/relayer" - "github.com/rarimo/identity-relayer-svc/internal/types" + "github.com/rarimo/worldcoin-relayer-svc/docs" + "github.com/rarimo/worldcoin-relayer-svc/internal/config" + "github.com/rarimo/worldcoin-relayer-svc/internal/data/pg" + "github.com/rarimo/worldcoin-relayer-svc/internal/services/relayer" + "github.com/rarimo/worldcoin-relayer-svc/internal/types" "gitlab.com/distributed_lab/logan/v3" "gitlab.com/distributed_lab/logan/v3/errors" "google.golang.org/grpc/codes" @@ -79,35 +79,6 @@ func (s *ServerImpl) StateRelay(ctx context.Context, req *types.MsgStateRelayReq return &types.MsgRelayResponse{Tx: tx}, nil } -func (s *ServerImpl) GistRelay(ctx context.Context, req *types.MsgGISTRelayRequest) (*types.MsgRelayResponse, error) { - if req.Body == nil { - return nil, status.Errorf(codes.InvalidArgument, "empty body") - } - - s.log.Infof("Relay request: GIST - %s; chain - %s", req.Body.Hash, req.Body.Chain) - - tx, err := s.relayer.GistRelay(ctx, req.Body.Hash, req.Body.Chain, req.Body.WaitConfirm) - - if err != nil { - s.log.WithError(err).Debugf("Request failed") - - switch errors.Cause(err) { - case relayer.ErrEntryNotFound, relayer.ErrChainNotFound: - return nil, status.Errorf(codes.NotFound, err.Error()) - case relayer.ErrAlreadySubmitted: - return nil, status.Errorf( - codes.InvalidArgument, - "can not resubmit state transition tx for state: %s on chain: %s", req.Body.Hash, req.Body.Chain, - ) - default: - s.log.WithError(err).Error("Got internal error while processing relay request") - return nil, status.Errorf(codes.Internal, "Internal error") - } - } - - return &types.MsgRelayResponse{Tx: tx}, nil -} - func (s *ServerImpl) StateRelays(ctx context.Context, req *types.MsgRelaysRequest) (*types.MsgRelaysResponse, error) { relays, err := s.relayer.StateRelays(ctx, req.Hash) if err != nil { @@ -131,27 +102,3 @@ func (s *ServerImpl) StateRelays(ctx context.Context, req *types.MsgRelaysReques return resp, nil } - -func (s *ServerImpl) GistRelays(ctx context.Context, req *types.MsgRelaysRequest) (*types.MsgRelaysResponse, error) { - relays, err := s.relayer.GistRelays(ctx, req.Hash) - if err != nil { - switch errors.Cause(err) { - case relayer.ErrEntryNotFound: - return nil, status.Errorf(codes.NotFound, err.Error()) - default: - s.log.WithError(err).Error("got internal error while processing relay request") - return nil, status.Errorf(codes.Internal, "Internal error") - } - } - - resp := &types.MsgRelaysResponse{Relays: make([]*types.Transition, 0, len(relays))} - - for _, r := range relays { - resp.Relays = append(resp.Relays, &types.Transition{ - Chain: r.Chain, - Tx: r.Tx, - }) - } - - return resp, nil -} diff --git a/internal/types/service.pb.go b/internal/types/service.pb.go index d8756d6..67cedc3 100644 --- a/internal/types/service.pb.go +++ b/internal/types/service.pb.go @@ -69,53 +69,6 @@ func (x *MsgStateRelayRequest) GetBody() *RelayBody { return nil } -type MsgGISTRelayRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *RelayBody `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` -} - -func (x *MsgGISTRelayRequest) Reset() { - *x = MsgGISTRelayRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgGISTRelayRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgGISTRelayRequest) ProtoMessage() {} - -func (x *MsgGISTRelayRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgGISTRelayRequest.ProtoReflect.Descriptor instead. -func (*MsgGISTRelayRequest) Descriptor() ([]byte, []int) { - return file_service_proto_rawDescGZIP(), []int{1} -} - -func (x *MsgGISTRelayRequest) GetBody() *RelayBody { - if x != nil { - return x.Body - } - return nil -} - type RelayBody struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -129,7 +82,7 @@ type RelayBody struct { func (x *RelayBody) Reset() { *x = RelayBody{} if protoimpl.UnsafeEnabled { - mi := &file_service_proto_msgTypes[2] + mi := &file_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -142,7 +95,7 @@ func (x *RelayBody) String() string { func (*RelayBody) ProtoMessage() {} func (x *RelayBody) ProtoReflect() protoreflect.Message { - mi := &file_service_proto_msgTypes[2] + mi := &file_service_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -155,7 +108,7 @@ func (x *RelayBody) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayBody.ProtoReflect.Descriptor instead. func (*RelayBody) Descriptor() ([]byte, []int) { - return file_service_proto_rawDescGZIP(), []int{2} + return file_service_proto_rawDescGZIP(), []int{1} } func (x *RelayBody) GetHash() string { @@ -190,7 +143,7 @@ type MsgRelayResponse struct { func (x *MsgRelayResponse) Reset() { *x = MsgRelayResponse{} if protoimpl.UnsafeEnabled { - mi := &file_service_proto_msgTypes[3] + mi := &file_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -203,7 +156,7 @@ func (x *MsgRelayResponse) String() string { func (*MsgRelayResponse) ProtoMessage() {} func (x *MsgRelayResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_proto_msgTypes[3] + mi := &file_service_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -216,7 +169,7 @@ func (x *MsgRelayResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MsgRelayResponse.ProtoReflect.Descriptor instead. func (*MsgRelayResponse) Descriptor() ([]byte, []int) { - return file_service_proto_rawDescGZIP(), []int{3} + return file_service_proto_rawDescGZIP(), []int{2} } func (x *MsgRelayResponse) GetTx() string { @@ -237,7 +190,7 @@ type MsgRelaysRequest struct { func (x *MsgRelaysRequest) Reset() { *x = MsgRelaysRequest{} if protoimpl.UnsafeEnabled { - mi := &file_service_proto_msgTypes[4] + mi := &file_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -250,7 +203,7 @@ func (x *MsgRelaysRequest) String() string { func (*MsgRelaysRequest) ProtoMessage() {} func (x *MsgRelaysRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_proto_msgTypes[4] + mi := &file_service_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -263,7 +216,7 @@ func (x *MsgRelaysRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MsgRelaysRequest.ProtoReflect.Descriptor instead. func (*MsgRelaysRequest) Descriptor() ([]byte, []int) { - return file_service_proto_rawDescGZIP(), []int{4} + return file_service_proto_rawDescGZIP(), []int{3} } func (x *MsgRelaysRequest) GetHash() string { @@ -285,7 +238,7 @@ type Transition struct { func (x *Transition) Reset() { *x = Transition{} if protoimpl.UnsafeEnabled { - mi := &file_service_proto_msgTypes[5] + mi := &file_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -298,7 +251,7 @@ func (x *Transition) String() string { func (*Transition) ProtoMessage() {} func (x *Transition) ProtoReflect() protoreflect.Message { - mi := &file_service_proto_msgTypes[5] + mi := &file_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -311,7 +264,7 @@ func (x *Transition) ProtoReflect() protoreflect.Message { // Deprecated: Use Transition.ProtoReflect.Descriptor instead. func (*Transition) Descriptor() ([]byte, []int) { - return file_service_proto_rawDescGZIP(), []int{5} + return file_service_proto_rawDescGZIP(), []int{4} } func (x *Transition) GetChain() string { @@ -339,7 +292,7 @@ type MsgRelaysResponse struct { func (x *MsgRelaysResponse) Reset() { *x = MsgRelaysResponse{} if protoimpl.UnsafeEnabled { - mi := &file_service_proto_msgTypes[6] + mi := &file_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -352,7 +305,7 @@ func (x *MsgRelaysResponse) String() string { func (*MsgRelaysResponse) ProtoMessage() {} func (x *MsgRelaysResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_proto_msgTypes[6] + mi := &file_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -365,7 +318,7 @@ func (x *MsgRelaysResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MsgRelaysResponse.ProtoReflect.Descriptor instead. func (*MsgRelaysResponse) Descriptor() ([]byte, []int) { - return file_service_proto_rawDescGZIP(), []int{6} + return file_service_proto_rawDescGZIP(), []int{5} } func (x *MsgRelaysResponse) GetRelays() []*Transition { @@ -386,58 +339,42 @@ var file_service_proto_rawDesc = []byte{ 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0x35, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x47, 0x49, 0x53, 0x54, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6f, 0x64, - 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x57, 0x0a, 0x09, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x20, - 0x0a, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, - 0x22, 0x22, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x74, 0x78, 0x22, 0x26, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x32, 0x0a, 0x0a, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x78, - 0x22, 0x38, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x32, 0xa6, 0x03, 0x0a, 0x07, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x12, 0x15, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x21, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x12, - 0x64, 0x0a, 0x09, 0x47, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x14, 0x2e, 0x4d, - 0x73, 0x67, 0x47, 0x49, 0x53, 0x54, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x22, 0x20, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x67, 0x69, 0x73, 0x74, 0x2f, - 0x72, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x66, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x6c, 0x61, 0x79, 0x73, 0x12, 0x11, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, - 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2f, 0x7b, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x12, 0x64, 0x0a, - 0x0a, 0x47, 0x49, 0x53, 0x54, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x11, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2f, 0x67, 0x69, 0x73, 0x74, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2f, 0x7b, 0x68, 0x61, - 0x73, 0x68, 0x7d, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x72, 0x61, 0x72, 0x69, 0x6d, 0x6f, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2d, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2d, 0x73, 0x76, 0x63, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x57, 0x0a, 0x09, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x77, 0x61, 0x69, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x61, + 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x22, 0x22, 0x0a, 0x10, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x78, 0x22, 0x26, 0x0a, + 0x10, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x32, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x78, 0x22, 0x38, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, + 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x6c, + 0x61, 0x79, 0x73, 0x32, 0xe0, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x6a, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x15, 0x2e, + 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x24, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2d, 0x77, 0x63, 0x2f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x69, 0x0a, 0x0b, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x11, 0x2e, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2d, 0x77, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2f, + 0x7b, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x61, 0x72, 0x69, 0x6d, 0x6f, 0x2f, 0x77, 0x6f, 0x72, 0x6c, + 0x64, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2d, 0x73, 0x76, + 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -452,33 +389,27 @@ func file_service_proto_rawDescGZIP() []byte { return file_service_proto_rawDescData } -var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_service_proto_goTypes = []interface{}{ (*MsgStateRelayRequest)(nil), // 0: MsgStateRelayRequest - (*MsgGISTRelayRequest)(nil), // 1: MsgGISTRelayRequest - (*RelayBody)(nil), // 2: RelayBody - (*MsgRelayResponse)(nil), // 3: MsgRelayResponse - (*MsgRelaysRequest)(nil), // 4: MsgRelaysRequest - (*Transition)(nil), // 5: Transition - (*MsgRelaysResponse)(nil), // 6: MsgRelaysResponse + (*RelayBody)(nil), // 1: RelayBody + (*MsgRelayResponse)(nil), // 2: MsgRelayResponse + (*MsgRelaysRequest)(nil), // 3: MsgRelaysRequest + (*Transition)(nil), // 4: Transition + (*MsgRelaysResponse)(nil), // 5: MsgRelaysResponse } var file_service_proto_depIdxs = []int32{ - 2, // 0: MsgStateRelayRequest.body:type_name -> RelayBody - 2, // 1: MsgGISTRelayRequest.body:type_name -> RelayBody - 5, // 2: MsgRelaysResponse.relays:type_name -> Transition - 0, // 3: Service.StateRelay:input_type -> MsgStateRelayRequest - 1, // 4: Service.GistRelay:input_type -> MsgGISTRelayRequest - 4, // 5: Service.StateRelays:input_type -> MsgRelaysRequest - 4, // 6: Service.GISTRelays:input_type -> MsgRelaysRequest - 3, // 7: Service.StateRelay:output_type -> MsgRelayResponse - 3, // 8: Service.GistRelay:output_type -> MsgRelayResponse - 6, // 9: Service.StateRelays:output_type -> MsgRelaysResponse - 6, // 10: Service.GISTRelays:output_type -> MsgRelaysResponse - 7, // [7:11] is the sub-list for method output_type - 3, // [3:7] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 1, // 0: MsgStateRelayRequest.body:type_name -> RelayBody + 4, // 1: MsgRelaysResponse.relays:type_name -> Transition + 0, // 2: Service.StateRelay:input_type -> MsgStateRelayRequest + 3, // 3: Service.StateRelays:input_type -> MsgRelaysRequest + 2, // 4: Service.StateRelay:output_type -> MsgRelayResponse + 5, // 5: Service.StateRelays:output_type -> MsgRelaysResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_service_proto_init() } @@ -500,18 +431,6 @@ func file_service_proto_init() { } } file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgGISTRelayRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RelayBody); i { case 0: return &v.state @@ -523,7 +442,7 @@ func file_service_proto_init() { return nil } } - file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRelayResponse); i { case 0: return &v.state @@ -535,7 +454,7 @@ func file_service_proto_init() { return nil } } - file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRelaysRequest); i { case 0: return &v.state @@ -547,7 +466,7 @@ func file_service_proto_init() { return nil } } - file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Transition); i { case 0: return &v.state @@ -559,7 +478,7 @@ func file_service_proto_init() { return nil } } - file_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRelaysResponse); i { case 0: return &v.state @@ -578,7 +497,7 @@ func file_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/types/service.pb.gw.go b/internal/types/service.pb.gw.go index 585031b..13e9c5b 100644 --- a/internal/types/service.pb.gw.go +++ b/internal/types/service.pb.gw.go @@ -65,40 +65,6 @@ func local_request_Service_StateRelay_0(ctx context.Context, marshaler runtime.M } -func request_Service_GistRelay_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgGISTRelayRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Body); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GistRelay(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GistRelay_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgGISTRelayRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Body); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GistRelay(ctx, &protoReq) - return msg, metadata, err - -} - func request_Service_StateRelays_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq MsgRelaysRequest var metadata runtime.ServerMetadata @@ -151,58 +117,6 @@ func local_request_Service_StateRelays_0(ctx context.Context, marshaler runtime. } -func request_Service_GISTRelays_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgRelaysRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["hash"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") - } - - protoReq.Hash, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) - } - - msg, err := client.GISTRelays(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GISTRelays_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgRelaysRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["hash"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") - } - - protoReq.Hash, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) - } - - msg, err := server.GISTRelays(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterServiceHandlerServer registers the http handlers for service Service to "mux". // UnaryRPC :call ServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -217,7 +131,7 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Service/StateRelay", runtime.WithHTTPPathPattern("/integrations/relayer/state/relay")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Service/StateRelay", runtime.WithHTTPPathPattern("/integrations/relayer-wc/state/relay")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -234,31 +148,6 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) - mux.Handle("POST", pattern_Service_GistRelay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Service/GistRelay", runtime.WithHTTPPathPattern("/integrations/relayer/gist/relay")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GistRelay_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GistRelay_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Service_StateRelays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -267,7 +156,7 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Service/StateRelays", runtime.WithHTTPPathPattern("/integrations/relayer/state/relay/{hash}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Service/StateRelays", runtime.WithHTTPPathPattern("/integrations/relayer-wc/state/relay/{hash}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -284,31 +173,6 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) - mux.Handle("GET", pattern_Service_GISTRelays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Service/GISTRelays", runtime.WithHTTPPathPattern("/integrations/relayer/gist/relay/{hash}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GISTRelays_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GISTRelays_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -356,7 +220,7 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Service/StateRelay", runtime.WithHTTPPathPattern("/integrations/relayer/state/relay")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Service/StateRelay", runtime.WithHTTPPathPattern("/integrations/relayer-wc/state/relay")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -372,35 +236,13 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) - mux.Handle("POST", pattern_Service_GistRelay_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Service/GistRelay", runtime.WithHTTPPathPattern("/integrations/relayer/gist/relay")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GistRelay_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GistRelay_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Service_StateRelays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Service/StateRelays", runtime.WithHTTPPathPattern("/integrations/relayer/state/relay/{hash}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Service/StateRelays", runtime.WithHTTPPathPattern("/integrations/relayer-wc/state/relay/{hash}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -416,47 +258,17 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) - mux.Handle("GET", pattern_Service_GISTRelays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Service/GISTRelays", runtime.WithHTTPPathPattern("/integrations/relayer/gist/relay/{hash}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GISTRelays_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GISTRelays_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( - pattern_Service_StateRelay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"integrations", "relayer", "state", "relay"}, "")) + pattern_Service_StateRelay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"integrations", "relayer-wc", "state", "relay"}, "")) - pattern_Service_GistRelay_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"integrations", "relayer", "gist", "relay"}, "")) - - pattern_Service_StateRelays_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"integrations", "relayer", "state", "relay", "hash"}, "")) - - pattern_Service_GISTRelays_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"integrations", "relayer", "gist", "relay", "hash"}, "")) + pattern_Service_StateRelays_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"integrations", "relayer-wc", "state", "relay", "hash"}, "")) ) var ( forward_Service_StateRelay_0 = runtime.ForwardResponseMessage - forward_Service_GistRelay_0 = runtime.ForwardResponseMessage - forward_Service_StateRelays_0 = runtime.ForwardResponseMessage - - forward_Service_GISTRelays_0 = runtime.ForwardResponseMessage ) diff --git a/internal/types/service_grpc.pb.go b/internal/types/service_grpc.pb.go index e624130..d17cbb3 100644 --- a/internal/types/service_grpc.pb.go +++ b/internal/types/service_grpc.pb.go @@ -23,9 +23,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ServiceClient interface { StateRelay(ctx context.Context, in *MsgStateRelayRequest, opts ...grpc.CallOption) (*MsgRelayResponse, error) - GistRelay(ctx context.Context, in *MsgGISTRelayRequest, opts ...grpc.CallOption) (*MsgRelayResponse, error) StateRelays(ctx context.Context, in *MsgRelaysRequest, opts ...grpc.CallOption) (*MsgRelaysResponse, error) - GISTRelays(ctx context.Context, in *MsgRelaysRequest, opts ...grpc.CallOption) (*MsgRelaysResponse, error) } type serviceClient struct { @@ -45,15 +43,6 @@ func (c *serviceClient) StateRelay(ctx context.Context, in *MsgStateRelayRequest return out, nil } -func (c *serviceClient) GistRelay(ctx context.Context, in *MsgGISTRelayRequest, opts ...grpc.CallOption) (*MsgRelayResponse, error) { - out := new(MsgRelayResponse) - err := c.cc.Invoke(ctx, "/Service/GistRelay", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *serviceClient) StateRelays(ctx context.Context, in *MsgRelaysRequest, opts ...grpc.CallOption) (*MsgRelaysResponse, error) { out := new(MsgRelaysResponse) err := c.cc.Invoke(ctx, "/Service/StateRelays", in, out, opts...) @@ -63,23 +52,12 @@ func (c *serviceClient) StateRelays(ctx context.Context, in *MsgRelaysRequest, o return out, nil } -func (c *serviceClient) GISTRelays(ctx context.Context, in *MsgRelaysRequest, opts ...grpc.CallOption) (*MsgRelaysResponse, error) { - out := new(MsgRelaysResponse) - err := c.cc.Invoke(ctx, "/Service/GISTRelays", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // ServiceServer is the server API for Service service. // All implementations should embed UnimplementedServiceServer // for forward compatibility type ServiceServer interface { StateRelay(context.Context, *MsgStateRelayRequest) (*MsgRelayResponse, error) - GistRelay(context.Context, *MsgGISTRelayRequest) (*MsgRelayResponse, error) StateRelays(context.Context, *MsgRelaysRequest) (*MsgRelaysResponse, error) - GISTRelays(context.Context, *MsgRelaysRequest) (*MsgRelaysResponse, error) } // UnimplementedServiceServer should be embedded to have forward compatible implementations. @@ -89,15 +67,9 @@ type UnimplementedServiceServer struct { func (UnimplementedServiceServer) StateRelay(context.Context, *MsgStateRelayRequest) (*MsgRelayResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StateRelay not implemented") } -func (UnimplementedServiceServer) GistRelay(context.Context, *MsgGISTRelayRequest) (*MsgRelayResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GistRelay not implemented") -} func (UnimplementedServiceServer) StateRelays(context.Context, *MsgRelaysRequest) (*MsgRelaysResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StateRelays not implemented") } -func (UnimplementedServiceServer) GISTRelays(context.Context, *MsgRelaysRequest) (*MsgRelaysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GISTRelays not implemented") -} // UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ServiceServer will @@ -128,24 +100,6 @@ func _Service_StateRelay_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _Service_GistRelay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgGISTRelayRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GistRelay(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Service/GistRelay", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GistRelay(ctx, req.(*MsgGISTRelayRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Service_StateRelays_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgRelaysRequest) if err := dec(in); err != nil { @@ -164,24 +118,6 @@ func _Service_StateRelays_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Service_GISTRelays_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRelaysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GISTRelays(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Service/GISTRelays", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GISTRelays(ctx, req.(*MsgRelaysRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Service_ServiceDesc is the grpc.ServiceDesc for Service service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -193,18 +129,10 @@ var Service_ServiceDesc = grpc.ServiceDesc{ MethodName: "StateRelay", Handler: _Service_StateRelay_Handler, }, - { - MethodName: "GistRelay", - Handler: _Service_GistRelay_Handler, - }, { MethodName: "StateRelays", Handler: _Service_StateRelays_Handler, }, - { - MethodName: "GISTRelays", - Handler: _Service_GISTRelays_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", diff --git a/main.go b/main.go index 607e879..e0022e0 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/rarimo/identity-relayer-svc/internal/cli" + "github.com/rarimo/worldcoin-relayer-svc/internal/cli" ) func main() { diff --git a/pkg/polygonid/contracts/IdentityManager.go b/pkg/polygonid/contracts/IdentityManager.go new file mode 100644 index 0000000..78caaef --- /dev/null +++ b/pkg/polygonid/contracts/IdentityManager.go @@ -0,0 +1,952 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contracts + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IIdentityManagerRootInfo is an auto generated low-level Go binding around an user-defined struct. +type IIdentityManagerRootInfo struct { + ReplacedBy *big.Int + ReplacedAt *big.Int + IsLatest bool + IsExpired bool +} + +// IdentityManagerMetaData contains all meta data concerning the IdentityManager contract. +var IdentityManagerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevRoot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"replacedAt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"latestRoot\",\"type\":\"uint256\"}],\"name\":\"SignedRootTransited\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"P\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ROOT_EXPIRATION_TIME\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sourceStateContract_\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"chainName_\",\"type\":\"string\"}],\"name\":\"__IdentityManager_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer_\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"chainName_\",\"type\":\"string\"}],\"name\":\"__Signers_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"methodId_\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"contractAddress_\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"signHash_\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"checkSignatureAndIncrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root_\",\"type\":\"uint256\"}],\"name\":\"getRootInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"replacedBy\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAt\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isLatest\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isExpired\",\"type\":\"bool\"}],\"internalType\":\"structIIdentityManager.RootInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"methodId_\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"contractAddress_\",\"type\":\"address\"}],\"name\":\"getSigComponents\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"chainName_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root_\",\"type\":\"uint256\"}],\"name\":\"isExpiredRoot\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isLatestRoot\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root_\",\"type\":\"uint256\"}],\"name\":\"rootExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"prevRoot_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"postRoot_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAt_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"proof_\",\"type\":\"bytes\"}],\"name\":\"signedTransitRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"signer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceStateContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"methodId_\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"contractAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newAddress_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"validateChangeAddressSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// IdentityManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use IdentityManagerMetaData.ABI instead. +var IdentityManagerABI = IdentityManagerMetaData.ABI + +// IdentityManager is an auto generated Go binding around an Ethereum contract. +type IdentityManager struct { + IdentityManagerCaller // Read-only binding to the contract + IdentityManagerTransactor // Write-only binding to the contract + IdentityManagerFilterer // Log filterer for contract events +} + +// IdentityManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type IdentityManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IdentityManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IdentityManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IdentityManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IdentityManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IdentityManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IdentityManagerSession struct { + Contract *IdentityManager // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IdentityManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IdentityManagerCallerSession struct { + Contract *IdentityManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IdentityManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IdentityManagerTransactorSession struct { + Contract *IdentityManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IdentityManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type IdentityManagerRaw struct { + Contract *IdentityManager // Generic contract binding to access the raw methods on +} + +// IdentityManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IdentityManagerCallerRaw struct { + Contract *IdentityManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// IdentityManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IdentityManagerTransactorRaw struct { + Contract *IdentityManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIdentityManager creates a new instance of IdentityManager, bound to a specific deployed contract. +func NewIdentityManager(address common.Address, backend bind.ContractBackend) (*IdentityManager, error) { + contract, err := bindIdentityManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IdentityManager{IdentityManagerCaller: IdentityManagerCaller{contract: contract}, IdentityManagerTransactor: IdentityManagerTransactor{contract: contract}, IdentityManagerFilterer: IdentityManagerFilterer{contract: contract}}, nil +} + +// NewIdentityManagerCaller creates a new read-only instance of IdentityManager, bound to a specific deployed contract. +func NewIdentityManagerCaller(address common.Address, caller bind.ContractCaller) (*IdentityManagerCaller, error) { + contract, err := bindIdentityManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IdentityManagerCaller{contract: contract}, nil +} + +// NewIdentityManagerTransactor creates a new write-only instance of IdentityManager, bound to a specific deployed contract. +func NewIdentityManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*IdentityManagerTransactor, error) { + contract, err := bindIdentityManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IdentityManagerTransactor{contract: contract}, nil +} + +// NewIdentityManagerFilterer creates a new log filterer instance of IdentityManager, bound to a specific deployed contract. +func NewIdentityManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*IdentityManagerFilterer, error) { + contract, err := bindIdentityManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IdentityManagerFilterer{contract: contract}, nil +} + +// bindIdentityManager binds a generic wrapper to an already deployed contract. +func bindIdentityManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IdentityManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IdentityManager *IdentityManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IdentityManager.Contract.IdentityManagerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IdentityManager *IdentityManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IdentityManager.Contract.IdentityManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IdentityManager *IdentityManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IdentityManager.Contract.IdentityManagerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IdentityManager *IdentityManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IdentityManager.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IdentityManager *IdentityManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IdentityManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IdentityManager *IdentityManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IdentityManager.Contract.contract.Transact(opts, method, params...) +} + +// P is a free data retrieval call binding the contract method 0x8b8fbd92. +// +// Solidity: function P() view returns(uint256) +func (_IdentityManager *IdentityManagerCaller) P(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "P") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// P is a free data retrieval call binding the contract method 0x8b8fbd92. +// +// Solidity: function P() view returns(uint256) +func (_IdentityManager *IdentityManagerSession) P() (*big.Int, error) { + return _IdentityManager.Contract.P(&_IdentityManager.CallOpts) +} + +// P is a free data retrieval call binding the contract method 0x8b8fbd92. +// +// Solidity: function P() view returns(uint256) +func (_IdentityManager *IdentityManagerCallerSession) P() (*big.Int, error) { + return _IdentityManager.Contract.P(&_IdentityManager.CallOpts) +} + +// ROOTEXPIRATIONTIME is a free data retrieval call binding the contract method 0x783cb137. +// +// Solidity: function ROOT_EXPIRATION_TIME() view returns(uint256) +func (_IdentityManager *IdentityManagerCaller) ROOTEXPIRATIONTIME(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "ROOT_EXPIRATION_TIME") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ROOTEXPIRATIONTIME is a free data retrieval call binding the contract method 0x783cb137. +// +// Solidity: function ROOT_EXPIRATION_TIME() view returns(uint256) +func (_IdentityManager *IdentityManagerSession) ROOTEXPIRATIONTIME() (*big.Int, error) { + return _IdentityManager.Contract.ROOTEXPIRATIONTIME(&_IdentityManager.CallOpts) +} + +// ROOTEXPIRATIONTIME is a free data retrieval call binding the contract method 0x783cb137. +// +// Solidity: function ROOT_EXPIRATION_TIME() view returns(uint256) +func (_IdentityManager *IdentityManagerCallerSession) ROOTEXPIRATIONTIME() (*big.Int, error) { + return _IdentityManager.Contract.ROOTEXPIRATIONTIME(&_IdentityManager.CallOpts) +} + +// ChainName is a free data retrieval call binding the contract method 0x1c93b03a. +// +// Solidity: function chainName() view returns(string) +func (_IdentityManager *IdentityManagerCaller) ChainName(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "chainName") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// ChainName is a free data retrieval call binding the contract method 0x1c93b03a. +// +// Solidity: function chainName() view returns(string) +func (_IdentityManager *IdentityManagerSession) ChainName() (string, error) { + return _IdentityManager.Contract.ChainName(&_IdentityManager.CallOpts) +} + +// ChainName is a free data retrieval call binding the contract method 0x1c93b03a. +// +// Solidity: function chainName() view returns(string) +func (_IdentityManager *IdentityManagerCallerSession) ChainName() (string, error) { + return _IdentityManager.Contract.ChainName(&_IdentityManager.CallOpts) +} + +// GetLatestRoot is a free data retrieval call binding the contract method 0x5445b007. +// +// Solidity: function getLatestRoot() view returns(uint256, uint256) +func (_IdentityManager *IdentityManagerCaller) GetLatestRoot(opts *bind.CallOpts) (*big.Int, *big.Int, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "getLatestRoot") + + if err != nil { + return *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return out0, out1, err + +} + +// GetLatestRoot is a free data retrieval call binding the contract method 0x5445b007. +// +// Solidity: function getLatestRoot() view returns(uint256, uint256) +func (_IdentityManager *IdentityManagerSession) GetLatestRoot() (*big.Int, *big.Int, error) { + return _IdentityManager.Contract.GetLatestRoot(&_IdentityManager.CallOpts) +} + +// GetLatestRoot is a free data retrieval call binding the contract method 0x5445b007. +// +// Solidity: function getLatestRoot() view returns(uint256, uint256) +func (_IdentityManager *IdentityManagerCallerSession) GetLatestRoot() (*big.Int, *big.Int, error) { + return _IdentityManager.Contract.GetLatestRoot(&_IdentityManager.CallOpts) +} + +// GetRootInfo is a free data retrieval call binding the contract method 0xa69db725. +// +// Solidity: function getRootInfo(uint256 root_) view returns((uint256,uint256,bool,bool)) +func (_IdentityManager *IdentityManagerCaller) GetRootInfo(opts *bind.CallOpts, root_ *big.Int) (IIdentityManagerRootInfo, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "getRootInfo", root_) + + if err != nil { + return *new(IIdentityManagerRootInfo), err + } + + out0 := *abi.ConvertType(out[0], new(IIdentityManagerRootInfo)).(*IIdentityManagerRootInfo) + + return out0, err + +} + +// GetRootInfo is a free data retrieval call binding the contract method 0xa69db725. +// +// Solidity: function getRootInfo(uint256 root_) view returns((uint256,uint256,bool,bool)) +func (_IdentityManager *IdentityManagerSession) GetRootInfo(root_ *big.Int) (IIdentityManagerRootInfo, error) { + return _IdentityManager.Contract.GetRootInfo(&_IdentityManager.CallOpts, root_) +} + +// GetRootInfo is a free data retrieval call binding the contract method 0xa69db725. +// +// Solidity: function getRootInfo(uint256 root_) view returns((uint256,uint256,bool,bool)) +func (_IdentityManager *IdentityManagerCallerSession) GetRootInfo(root_ *big.Int) (IIdentityManagerRootInfo, error) { + return _IdentityManager.Contract.GetRootInfo(&_IdentityManager.CallOpts, root_) +} + +// GetSigComponents is a free data retrieval call binding the contract method 0x827e099e. +// +// Solidity: function getSigComponents(uint8 methodId_, address contractAddress_) view returns(string chainName_, uint256 nonce_) +func (_IdentityManager *IdentityManagerCaller) GetSigComponents(opts *bind.CallOpts, methodId_ uint8, contractAddress_ common.Address) (struct { + ChainName string + Nonce *big.Int +}, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "getSigComponents", methodId_, contractAddress_) + + outstruct := new(struct { + ChainName string + Nonce *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.ChainName = *abi.ConvertType(out[0], new(string)).(*string) + outstruct.Nonce = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetSigComponents is a free data retrieval call binding the contract method 0x827e099e. +// +// Solidity: function getSigComponents(uint8 methodId_, address contractAddress_) view returns(string chainName_, uint256 nonce_) +func (_IdentityManager *IdentityManagerSession) GetSigComponents(methodId_ uint8, contractAddress_ common.Address) (struct { + ChainName string + Nonce *big.Int +}, error) { + return _IdentityManager.Contract.GetSigComponents(&_IdentityManager.CallOpts, methodId_, contractAddress_) +} + +// GetSigComponents is a free data retrieval call binding the contract method 0x827e099e. +// +// Solidity: function getSigComponents(uint8 methodId_, address contractAddress_) view returns(string chainName_, uint256 nonce_) +func (_IdentityManager *IdentityManagerCallerSession) GetSigComponents(methodId_ uint8, contractAddress_ common.Address) (struct { + ChainName string + Nonce *big.Int +}, error) { + return _IdentityManager.Contract.GetSigComponents(&_IdentityManager.CallOpts, methodId_, contractAddress_) +} + +// IsExpiredRoot is a free data retrieval call binding the contract method 0xc62fd5a0. +// +// Solidity: function isExpiredRoot(uint256 root_) view returns(bool) +func (_IdentityManager *IdentityManagerCaller) IsExpiredRoot(opts *bind.CallOpts, root_ *big.Int) (bool, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "isExpiredRoot", root_) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsExpiredRoot is a free data retrieval call binding the contract method 0xc62fd5a0. +// +// Solidity: function isExpiredRoot(uint256 root_) view returns(bool) +func (_IdentityManager *IdentityManagerSession) IsExpiredRoot(root_ *big.Int) (bool, error) { + return _IdentityManager.Contract.IsExpiredRoot(&_IdentityManager.CallOpts, root_) +} + +// IsExpiredRoot is a free data retrieval call binding the contract method 0xc62fd5a0. +// +// Solidity: function isExpiredRoot(uint256 root_) view returns(bool) +func (_IdentityManager *IdentityManagerCallerSession) IsExpiredRoot(root_ *big.Int) (bool, error) { + return _IdentityManager.Contract.IsExpiredRoot(&_IdentityManager.CallOpts, root_) +} + +// IsLatestRoot is a free data retrieval call binding the contract method 0x0cebec86. +// +// Solidity: function isLatestRoot(uint256 root) view returns(bool) +func (_IdentityManager *IdentityManagerCaller) IsLatestRoot(opts *bind.CallOpts, root *big.Int) (bool, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "isLatestRoot", root) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsLatestRoot is a free data retrieval call binding the contract method 0x0cebec86. +// +// Solidity: function isLatestRoot(uint256 root) view returns(bool) +func (_IdentityManager *IdentityManagerSession) IsLatestRoot(root *big.Int) (bool, error) { + return _IdentityManager.Contract.IsLatestRoot(&_IdentityManager.CallOpts, root) +} + +// IsLatestRoot is a free data retrieval call binding the contract method 0x0cebec86. +// +// Solidity: function isLatestRoot(uint256 root) view returns(bool) +func (_IdentityManager *IdentityManagerCallerSession) IsLatestRoot(root *big.Int) (bool, error) { + return _IdentityManager.Contract.IsLatestRoot(&_IdentityManager.CallOpts, root) +} + +// Nonces is a free data retrieval call binding the contract method 0xed3218a2. +// +// Solidity: function nonces(address , uint8 ) view returns(uint256) +func (_IdentityManager *IdentityManagerCaller) Nonces(opts *bind.CallOpts, arg0 common.Address, arg1 uint8) (*big.Int, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "nonces", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0xed3218a2. +// +// Solidity: function nonces(address , uint8 ) view returns(uint256) +func (_IdentityManager *IdentityManagerSession) Nonces(arg0 common.Address, arg1 uint8) (*big.Int, error) { + return _IdentityManager.Contract.Nonces(&_IdentityManager.CallOpts, arg0, arg1) +} + +// Nonces is a free data retrieval call binding the contract method 0xed3218a2. +// +// Solidity: function nonces(address , uint8 ) view returns(uint256) +func (_IdentityManager *IdentityManagerCallerSession) Nonces(arg0 common.Address, arg1 uint8) (*big.Int, error) { + return _IdentityManager.Contract.Nonces(&_IdentityManager.CallOpts, arg0, arg1) +} + +// RootExists is a free data retrieval call binding the contract method 0x76a5cef3. +// +// Solidity: function rootExists(uint256 root_) view returns(bool) +func (_IdentityManager *IdentityManagerCaller) RootExists(opts *bind.CallOpts, root_ *big.Int) (bool, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "rootExists", root_) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// RootExists is a free data retrieval call binding the contract method 0x76a5cef3. +// +// Solidity: function rootExists(uint256 root_) view returns(bool) +func (_IdentityManager *IdentityManagerSession) RootExists(root_ *big.Int) (bool, error) { + return _IdentityManager.Contract.RootExists(&_IdentityManager.CallOpts, root_) +} + +// RootExists is a free data retrieval call binding the contract method 0x76a5cef3. +// +// Solidity: function rootExists(uint256 root_) view returns(bool) +func (_IdentityManager *IdentityManagerCallerSession) RootExists(root_ *big.Int) (bool, error) { + return _IdentityManager.Contract.RootExists(&_IdentityManager.CallOpts, root_) +} + +// Signer is a free data retrieval call binding the contract method 0x238ac933. +// +// Solidity: function signer() view returns(address) +func (_IdentityManager *IdentityManagerCaller) Signer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "signer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Signer is a free data retrieval call binding the contract method 0x238ac933. +// +// Solidity: function signer() view returns(address) +func (_IdentityManager *IdentityManagerSession) Signer() (common.Address, error) { + return _IdentityManager.Contract.Signer(&_IdentityManager.CallOpts) +} + +// Signer is a free data retrieval call binding the contract method 0x238ac933. +// +// Solidity: function signer() view returns(address) +func (_IdentityManager *IdentityManagerCallerSession) Signer() (common.Address, error) { + return _IdentityManager.Contract.Signer(&_IdentityManager.CallOpts) +} + +// SourceStateContract is a free data retrieval call binding the contract method 0xfc228319. +// +// Solidity: function sourceStateContract() view returns(address) +func (_IdentityManager *IdentityManagerCaller) SourceStateContract(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IdentityManager.contract.Call(opts, &out, "sourceStateContract") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SourceStateContract is a free data retrieval call binding the contract method 0xfc228319. +// +// Solidity: function sourceStateContract() view returns(address) +func (_IdentityManager *IdentityManagerSession) SourceStateContract() (common.Address, error) { + return _IdentityManager.Contract.SourceStateContract(&_IdentityManager.CallOpts) +} + +// SourceStateContract is a free data retrieval call binding the contract method 0xfc228319. +// +// Solidity: function sourceStateContract() view returns(address) +func (_IdentityManager *IdentityManagerCallerSession) SourceStateContract() (common.Address, error) { + return _IdentityManager.Contract.SourceStateContract(&_IdentityManager.CallOpts) +} + +// IdentityManagerInit is a paid mutator transaction binding the contract method 0x56d21a54. +// +// Solidity: function __IdentityManager_init(address signer_, address sourceStateContract_, string chainName_) returns() +func (_IdentityManager *IdentityManagerTransactor) IdentityManagerInit(opts *bind.TransactOpts, signer_ common.Address, sourceStateContract_ common.Address, chainName_ string) (*types.Transaction, error) { + return _IdentityManager.contract.Transact(opts, "__IdentityManager_init", signer_, sourceStateContract_, chainName_) +} + +// IdentityManagerInit is a paid mutator transaction binding the contract method 0x56d21a54. +// +// Solidity: function __IdentityManager_init(address signer_, address sourceStateContract_, string chainName_) returns() +func (_IdentityManager *IdentityManagerSession) IdentityManagerInit(signer_ common.Address, sourceStateContract_ common.Address, chainName_ string) (*types.Transaction, error) { + return _IdentityManager.Contract.IdentityManagerInit(&_IdentityManager.TransactOpts, signer_, sourceStateContract_, chainName_) +} + +// IdentityManagerInit is a paid mutator transaction binding the contract method 0x56d21a54. +// +// Solidity: function __IdentityManager_init(address signer_, address sourceStateContract_, string chainName_) returns() +func (_IdentityManager *IdentityManagerTransactorSession) IdentityManagerInit(signer_ common.Address, sourceStateContract_ common.Address, chainName_ string) (*types.Transaction, error) { + return _IdentityManager.Contract.IdentityManagerInit(&_IdentityManager.TransactOpts, signer_, sourceStateContract_, chainName_) +} + +// SignersInit is a paid mutator transaction binding the contract method 0x509ace95. +// +// Solidity: function __Signers_init(address signer_, string chainName_) returns() +func (_IdentityManager *IdentityManagerTransactor) SignersInit(opts *bind.TransactOpts, signer_ common.Address, chainName_ string) (*types.Transaction, error) { + return _IdentityManager.contract.Transact(opts, "__Signers_init", signer_, chainName_) +} + +// SignersInit is a paid mutator transaction binding the contract method 0x509ace95. +// +// Solidity: function __Signers_init(address signer_, string chainName_) returns() +func (_IdentityManager *IdentityManagerSession) SignersInit(signer_ common.Address, chainName_ string) (*types.Transaction, error) { + return _IdentityManager.Contract.SignersInit(&_IdentityManager.TransactOpts, signer_, chainName_) +} + +// SignersInit is a paid mutator transaction binding the contract method 0x509ace95. +// +// Solidity: function __Signers_init(address signer_, string chainName_) returns() +func (_IdentityManager *IdentityManagerTransactorSession) SignersInit(signer_ common.Address, chainName_ string) (*types.Transaction, error) { + return _IdentityManager.Contract.SignersInit(&_IdentityManager.TransactOpts, signer_, chainName_) +} + +// CheckSignatureAndIncrementNonce is a paid mutator transaction binding the contract method 0xe3754f90. +// +// Solidity: function checkSignatureAndIncrementNonce(uint8 methodId_, address contractAddress_, bytes32 signHash_, bytes signature_) returns() +func (_IdentityManager *IdentityManagerTransactor) CheckSignatureAndIncrementNonce(opts *bind.TransactOpts, methodId_ uint8, contractAddress_ common.Address, signHash_ [32]byte, signature_ []byte) (*types.Transaction, error) { + return _IdentityManager.contract.Transact(opts, "checkSignatureAndIncrementNonce", methodId_, contractAddress_, signHash_, signature_) +} + +// CheckSignatureAndIncrementNonce is a paid mutator transaction binding the contract method 0xe3754f90. +// +// Solidity: function checkSignatureAndIncrementNonce(uint8 methodId_, address contractAddress_, bytes32 signHash_, bytes signature_) returns() +func (_IdentityManager *IdentityManagerSession) CheckSignatureAndIncrementNonce(methodId_ uint8, contractAddress_ common.Address, signHash_ [32]byte, signature_ []byte) (*types.Transaction, error) { + return _IdentityManager.Contract.CheckSignatureAndIncrementNonce(&_IdentityManager.TransactOpts, methodId_, contractAddress_, signHash_, signature_) +} + +// CheckSignatureAndIncrementNonce is a paid mutator transaction binding the contract method 0xe3754f90. +// +// Solidity: function checkSignatureAndIncrementNonce(uint8 methodId_, address contractAddress_, bytes32 signHash_, bytes signature_) returns() +func (_IdentityManager *IdentityManagerTransactorSession) CheckSignatureAndIncrementNonce(methodId_ uint8, contractAddress_ common.Address, signHash_ [32]byte, signature_ []byte) (*types.Transaction, error) { + return _IdentityManager.Contract.CheckSignatureAndIncrementNonce(&_IdentityManager.TransactOpts, methodId_, contractAddress_, signHash_, signature_) +} + +// SignedTransitRoot is a paid mutator transaction binding the contract method 0xd8cb4948. +// +// Solidity: function signedTransitRoot(uint256 prevRoot_, uint256 postRoot_, uint256 replacedAt_, bytes proof_) returns() +func (_IdentityManager *IdentityManagerTransactor) SignedTransitRoot(opts *bind.TransactOpts, prevRoot_ *big.Int, postRoot_ *big.Int, replacedAt_ *big.Int, proof_ []byte) (*types.Transaction, error) { + return _IdentityManager.contract.Transact(opts, "signedTransitRoot", prevRoot_, postRoot_, replacedAt_, proof_) +} + +// SignedTransitRoot is a paid mutator transaction binding the contract method 0xd8cb4948. +// +// Solidity: function signedTransitRoot(uint256 prevRoot_, uint256 postRoot_, uint256 replacedAt_, bytes proof_) returns() +func (_IdentityManager *IdentityManagerSession) SignedTransitRoot(prevRoot_ *big.Int, postRoot_ *big.Int, replacedAt_ *big.Int, proof_ []byte) (*types.Transaction, error) { + return _IdentityManager.Contract.SignedTransitRoot(&_IdentityManager.TransactOpts, prevRoot_, postRoot_, replacedAt_, proof_) +} + +// SignedTransitRoot is a paid mutator transaction binding the contract method 0xd8cb4948. +// +// Solidity: function signedTransitRoot(uint256 prevRoot_, uint256 postRoot_, uint256 replacedAt_, bytes proof_) returns() +func (_IdentityManager *IdentityManagerTransactorSession) SignedTransitRoot(prevRoot_ *big.Int, postRoot_ *big.Int, replacedAt_ *big.Int, proof_ []byte) (*types.Transaction, error) { + return _IdentityManager.Contract.SignedTransitRoot(&_IdentityManager.TransactOpts, prevRoot_, postRoot_, replacedAt_, proof_) +} + +// ValidateChangeAddressSignature is a paid mutator transaction binding the contract method 0x7d1e764b. +// +// Solidity: function validateChangeAddressSignature(uint8 methodId_, address contractAddress_, address newAddress_, bytes signature_) returns() +func (_IdentityManager *IdentityManagerTransactor) ValidateChangeAddressSignature(opts *bind.TransactOpts, methodId_ uint8, contractAddress_ common.Address, newAddress_ common.Address, signature_ []byte) (*types.Transaction, error) { + return _IdentityManager.contract.Transact(opts, "validateChangeAddressSignature", methodId_, contractAddress_, newAddress_, signature_) +} + +// ValidateChangeAddressSignature is a paid mutator transaction binding the contract method 0x7d1e764b. +// +// Solidity: function validateChangeAddressSignature(uint8 methodId_, address contractAddress_, address newAddress_, bytes signature_) returns() +func (_IdentityManager *IdentityManagerSession) ValidateChangeAddressSignature(methodId_ uint8, contractAddress_ common.Address, newAddress_ common.Address, signature_ []byte) (*types.Transaction, error) { + return _IdentityManager.Contract.ValidateChangeAddressSignature(&_IdentityManager.TransactOpts, methodId_, contractAddress_, newAddress_, signature_) +} + +// ValidateChangeAddressSignature is a paid mutator transaction binding the contract method 0x7d1e764b. +// +// Solidity: function validateChangeAddressSignature(uint8 methodId_, address contractAddress_, address newAddress_, bytes signature_) returns() +func (_IdentityManager *IdentityManagerTransactorSession) ValidateChangeAddressSignature(methodId_ uint8, contractAddress_ common.Address, newAddress_ common.Address, signature_ []byte) (*types.Transaction, error) { + return _IdentityManager.Contract.ValidateChangeAddressSignature(&_IdentityManager.TransactOpts, methodId_, contractAddress_, newAddress_, signature_) +} + +// IdentityManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the IdentityManager contract. +type IdentityManagerInitializedIterator struct { + Event *IdentityManagerInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IdentityManagerInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IdentityManagerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IdentityManagerInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IdentityManagerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IdentityManagerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IdentityManagerInitialized represents a Initialized event raised by the IdentityManager contract. +type IdentityManagerInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_IdentityManager *IdentityManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*IdentityManagerInitializedIterator, error) { + + logs, sub, err := _IdentityManager.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &IdentityManagerInitializedIterator{contract: _IdentityManager.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_IdentityManager *IdentityManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *IdentityManagerInitialized) (event.Subscription, error) { + + logs, sub, err := _IdentityManager.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IdentityManagerInitialized) + if err := _IdentityManager.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_IdentityManager *IdentityManagerFilterer) ParseInitialized(log types.Log) (*IdentityManagerInitialized, error) { + event := new(IdentityManagerInitialized) + if err := _IdentityManager.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IdentityManagerSignedRootTransitedIterator is returned from FilterSignedRootTransited and is used to iterate over the raw logs and unpacked data for SignedRootTransited events raised by the IdentityManager contract. +type IdentityManagerSignedRootTransitedIterator struct { + Event *IdentityManagerSignedRootTransited // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IdentityManagerSignedRootTransitedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IdentityManagerSignedRootTransited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IdentityManagerSignedRootTransited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IdentityManagerSignedRootTransitedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IdentityManagerSignedRootTransitedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IdentityManagerSignedRootTransited represents a SignedRootTransited event raised by the IdentityManager contract. +type IdentityManagerSignedRootTransited struct { + PrevRoot *big.Int + PostRoot *big.Int + ReplacedAt *big.Int + LatestRoot *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignedRootTransited is a free log retrieval operation binding the contract event 0xc6c41b70b30e03e3cb385fb636d8b6388dc80e73605e86eace19b9e2e867126a. +// +// Solidity: event SignedRootTransited(uint256 prevRoot, uint256 postRoot, uint256 replacedAt, uint256 latestRoot) +func (_IdentityManager *IdentityManagerFilterer) FilterSignedRootTransited(opts *bind.FilterOpts) (*IdentityManagerSignedRootTransitedIterator, error) { + + logs, sub, err := _IdentityManager.contract.FilterLogs(opts, "SignedRootTransited") + if err != nil { + return nil, err + } + return &IdentityManagerSignedRootTransitedIterator{contract: _IdentityManager.contract, event: "SignedRootTransited", logs: logs, sub: sub}, nil +} + +// WatchSignedRootTransited is a free log subscription operation binding the contract event 0xc6c41b70b30e03e3cb385fb636d8b6388dc80e73605e86eace19b9e2e867126a. +// +// Solidity: event SignedRootTransited(uint256 prevRoot, uint256 postRoot, uint256 replacedAt, uint256 latestRoot) +func (_IdentityManager *IdentityManagerFilterer) WatchSignedRootTransited(opts *bind.WatchOpts, sink chan<- *IdentityManagerSignedRootTransited) (event.Subscription, error) { + + logs, sub, err := _IdentityManager.contract.WatchLogs(opts, "SignedRootTransited") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IdentityManagerSignedRootTransited) + if err := _IdentityManager.contract.UnpackLog(event, "SignedRootTransited", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignedRootTransited is a log parse operation binding the contract event 0xc6c41b70b30e03e3cb385fb636d8b6388dc80e73605e86eace19b9e2e867126a. +// +// Solidity: event SignedRootTransited(uint256 prevRoot, uint256 postRoot, uint256 replacedAt, uint256 latestRoot) +func (_IdentityManager *IdentityManagerFilterer) ParseSignedRootTransited(log types.Log) (*IdentityManagerSignedRootTransited, error) { + event := new(IdentityManagerSignedRootTransited) + if err := _IdentityManager.contract.UnpackLog(event, "SignedRootTransited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/polygonid/contracts/LightweightStateV2.go b/pkg/polygonid/contracts/LightweightStateV2.go deleted file mode 100644 index a4ef3e9..0000000 --- a/pkg/polygonid/contracts/LightweightStateV2.go +++ /dev/null @@ -1,1757 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package contracts - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// ILightweightStateV2GistRootData is an auto generated low-level Go binding around an user-defined struct. -type ILightweightStateV2GistRootData struct { - Root *big.Int - ReplacedByRoot *big.Int - CreatedAtTimestamp *big.Int - CreatedAtBlock *big.Int -} - -// ILightweightStateV2StateData is an auto generated low-level Go binding around an user-defined struct. -type ILightweightStateV2StateData struct { - Id *big.Int - State *big.Int - ReplacedByState *big.Int - CreatedAtTimestamp *big.Int - CreatedAtBlock *big.Int -} - -// IStateGistRootInfo is an auto generated low-level Go binding around an user-defined struct. -type IStateGistRootInfo struct { - Root *big.Int - ReplacedByRoot *big.Int - CreatedAtTimestamp *big.Int - ReplacedAtTimestamp *big.Int - CreatedAtBlock *big.Int - ReplacedAtBlock *big.Int -} - -// IStateStateInfo is an auto generated low-level Go binding around an user-defined struct. -type IStateStateInfo struct { - Id *big.Int - State *big.Int - ReplacedByState *big.Int - CreatedAtTimestamp *big.Int - ReplacedAtTimestamp *big.Int - CreatedAtBlock *big.Int - ReplacedAtBlock *big.Int -} - -// LightweightStateV2MetaData contains all meta data concerning the LightweightStateV2 contract. -var LightweightStateV2MetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newGistRoot\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevGistRoot\",\"type\":\"uint256\"}],\"name\":\"SignGISTDataTransited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"identityId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIdentityState\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevIdentityState\",\"type\":\"uint256\"}],\"name\":\"SignStateDataTransited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"P\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sourceStateContract_\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"chainName_\",\"type\":\"string\"}],\"name\":\"__LightweightStateV2_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer_\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"chainName_\",\"type\":\"string\"}],\"name\":\"__Signers_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"newSignerPubKey_\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"changeSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newSourceStateContract_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"changeSourceStateContract\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"methodId_\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"contractAddress_\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"signHash_\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"checkSignatureAndIncrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentGISTRootInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedByRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIState.GistRootInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGISTRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root_\",\"type\":\"uint256\"}],\"name\":\"getGISTRootInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedByRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIState.GistRootInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"identityId_\",\"type\":\"uint256\"}],\"name\":\"getIdentityLastState\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"methodId_\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"contractAddress_\",\"type\":\"address\"}],\"name\":\"getSigComponents\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"chainName_\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"identityId_\",\"type\":\"uint256\"}],\"name\":\"getStateInfoById\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedByState\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIState.StateInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"identityId_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state_\",\"type\":\"uint256\"}],\"name\":\"getStateInfoByIdAndState\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedByState\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedAtBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIState.StateInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"identityId_\",\"type\":\"uint256\"}],\"name\":\"idExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"prevGist_\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedByRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtBlock\",\"type\":\"uint256\"}],\"internalType\":\"structILightweightStateV2.GistRootData\",\"name\":\"gistData_\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proof_\",\"type\":\"bytes\"}],\"name\":\"signedTransitGISTData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"prevState_\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"replacedByState\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"createdAtBlock\",\"type\":\"uint256\"}],\"internalType\":\"structILightweightStateV2.StateData\",\"name\":\"stateData_\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proof_\",\"type\":\"bytes\"}],\"name\":\"signedTransitStateData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"signer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceStateContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"identityId_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state_\",\"type\":\"uint256\"}],\"name\":\"stateExists\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"upgradeToWithSig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"methodId_\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"contractAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newAddress_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature_\",\"type\":\"bytes\"}],\"name\":\"validateChangeAddressSignature\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// LightweightStateV2ABI is the input ABI used to generate the binding from. -// Deprecated: Use LightweightStateV2MetaData.ABI instead. -var LightweightStateV2ABI = LightweightStateV2MetaData.ABI - -// LightweightStateV2 is an auto generated Go binding around an Ethereum contract. -type LightweightStateV2 struct { - LightweightStateV2Caller // Read-only binding to the contract - LightweightStateV2Transactor // Write-only binding to the contract - LightweightStateV2Filterer // Log filterer for contract events -} - -// LightweightStateV2Caller is an auto generated read-only Go binding around an Ethereum contract. -type LightweightStateV2Caller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LightweightStateV2Transactor is an auto generated write-only Go binding around an Ethereum contract. -type LightweightStateV2Transactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LightweightStateV2Filterer is an auto generated log filtering Go binding around an Ethereum contract events. -type LightweightStateV2Filterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LightweightStateV2Session is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type LightweightStateV2Session struct { - Contract *LightweightStateV2 // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// LightweightStateV2CallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type LightweightStateV2CallerSession struct { - Contract *LightweightStateV2Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// LightweightStateV2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type LightweightStateV2TransactorSession struct { - Contract *LightweightStateV2Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// LightweightStateV2Raw is an auto generated low-level Go binding around an Ethereum contract. -type LightweightStateV2Raw struct { - Contract *LightweightStateV2 // Generic contract binding to access the raw methods on -} - -// LightweightStateV2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type LightweightStateV2CallerRaw struct { - Contract *LightweightStateV2Caller // Generic read-only contract binding to access the raw methods on -} - -// LightweightStateV2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type LightweightStateV2TransactorRaw struct { - Contract *LightweightStateV2Transactor // Generic write-only contract binding to access the raw methods on -} - -// NewLightweightStateV2 creates a new instance of LightweightStateV2, bound to a specific deployed contract. -func NewLightweightStateV2(address common.Address, backend bind.ContractBackend) (*LightweightStateV2, error) { - contract, err := bindLightweightStateV2(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &LightweightStateV2{LightweightStateV2Caller: LightweightStateV2Caller{contract: contract}, LightweightStateV2Transactor: LightweightStateV2Transactor{contract: contract}, LightweightStateV2Filterer: LightweightStateV2Filterer{contract: contract}}, nil -} - -// NewLightweightStateV2Caller creates a new read-only instance of LightweightStateV2, bound to a specific deployed contract. -func NewLightweightStateV2Caller(address common.Address, caller bind.ContractCaller) (*LightweightStateV2Caller, error) { - contract, err := bindLightweightStateV2(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &LightweightStateV2Caller{contract: contract}, nil -} - -// NewLightweightStateV2Transactor creates a new write-only instance of LightweightStateV2, bound to a specific deployed contract. -func NewLightweightStateV2Transactor(address common.Address, transactor bind.ContractTransactor) (*LightweightStateV2Transactor, error) { - contract, err := bindLightweightStateV2(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &LightweightStateV2Transactor{contract: contract}, nil -} - -// NewLightweightStateV2Filterer creates a new log filterer instance of LightweightStateV2, bound to a specific deployed contract. -func NewLightweightStateV2Filterer(address common.Address, filterer bind.ContractFilterer) (*LightweightStateV2Filterer, error) { - contract, err := bindLightweightStateV2(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &LightweightStateV2Filterer{contract: contract}, nil -} - -// bindLightweightStateV2 binds a generic wrapper to an already deployed contract. -func bindLightweightStateV2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := LightweightStateV2MetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_LightweightStateV2 *LightweightStateV2Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _LightweightStateV2.Contract.LightweightStateV2Caller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_LightweightStateV2 *LightweightStateV2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LightweightStateV2.Contract.LightweightStateV2Transactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LightweightStateV2 *LightweightStateV2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LightweightStateV2.Contract.LightweightStateV2Transactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_LightweightStateV2 *LightweightStateV2CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _LightweightStateV2.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_LightweightStateV2 *LightweightStateV2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LightweightStateV2.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LightweightStateV2 *LightweightStateV2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LightweightStateV2.Contract.contract.Transact(opts, method, params...) -} - -// P is a free data retrieval call binding the contract method 0x8b8fbd92. -// -// Solidity: function P() view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Caller) P(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "P") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// P is a free data retrieval call binding the contract method 0x8b8fbd92. -// -// Solidity: function P() view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Session) P() (*big.Int, error) { - return _LightweightStateV2.Contract.P(&_LightweightStateV2.CallOpts) -} - -// P is a free data retrieval call binding the contract method 0x8b8fbd92. -// -// Solidity: function P() view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2CallerSession) P() (*big.Int, error) { - return _LightweightStateV2.Contract.P(&_LightweightStateV2.CallOpts) -} - -// ChainName is a free data retrieval call binding the contract method 0x1c93b03a. -// -// Solidity: function chainName() view returns(string) -func (_LightweightStateV2 *LightweightStateV2Caller) ChainName(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "chainName") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// ChainName is a free data retrieval call binding the contract method 0x1c93b03a. -// -// Solidity: function chainName() view returns(string) -func (_LightweightStateV2 *LightweightStateV2Session) ChainName() (string, error) { - return _LightweightStateV2.Contract.ChainName(&_LightweightStateV2.CallOpts) -} - -// ChainName is a free data retrieval call binding the contract method 0x1c93b03a. -// -// Solidity: function chainName() view returns(string) -func (_LightweightStateV2 *LightweightStateV2CallerSession) ChainName() (string, error) { - return _LightweightStateV2.Contract.ChainName(&_LightweightStateV2.CallOpts) -} - -// GetCurrentGISTRootInfo is a free data retrieval call binding the contract method 0xaf7a3f59. -// -// Solidity: function getCurrentGISTRootInfo() view returns((uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Caller) GetCurrentGISTRootInfo(opts *bind.CallOpts) (IStateGistRootInfo, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getCurrentGISTRootInfo") - - if err != nil { - return *new(IStateGistRootInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IStateGistRootInfo)).(*IStateGistRootInfo) - - return out0, err - -} - -// GetCurrentGISTRootInfo is a free data retrieval call binding the contract method 0xaf7a3f59. -// -// Solidity: function getCurrentGISTRootInfo() view returns((uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Session) GetCurrentGISTRootInfo() (IStateGistRootInfo, error) { - return _LightweightStateV2.Contract.GetCurrentGISTRootInfo(&_LightweightStateV2.CallOpts) -} - -// GetCurrentGISTRootInfo is a free data retrieval call binding the contract method 0xaf7a3f59. -// -// Solidity: function getCurrentGISTRootInfo() view returns((uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetCurrentGISTRootInfo() (IStateGistRootInfo, error) { - return _LightweightStateV2.Contract.GetCurrentGISTRootInfo(&_LightweightStateV2.CallOpts) -} - -// GetGISTRoot is a free data retrieval call binding the contract method 0x2439e3a6. -// -// Solidity: function getGISTRoot() view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Caller) GetGISTRoot(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getGISTRoot") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetGISTRoot is a free data retrieval call binding the contract method 0x2439e3a6. -// -// Solidity: function getGISTRoot() view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Session) GetGISTRoot() (*big.Int, error) { - return _LightweightStateV2.Contract.GetGISTRoot(&_LightweightStateV2.CallOpts) -} - -// GetGISTRoot is a free data retrieval call binding the contract method 0x2439e3a6. -// -// Solidity: function getGISTRoot() view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetGISTRoot() (*big.Int, error) { - return _LightweightStateV2.Contract.GetGISTRoot(&_LightweightStateV2.CallOpts) -} - -// GetGISTRootInfo is a free data retrieval call binding the contract method 0x7c1a66de. -// -// Solidity: function getGISTRootInfo(uint256 root_) view returns((uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Caller) GetGISTRootInfo(opts *bind.CallOpts, root_ *big.Int) (IStateGistRootInfo, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getGISTRootInfo", root_) - - if err != nil { - return *new(IStateGistRootInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IStateGistRootInfo)).(*IStateGistRootInfo) - - return out0, err - -} - -// GetGISTRootInfo is a free data retrieval call binding the contract method 0x7c1a66de. -// -// Solidity: function getGISTRootInfo(uint256 root_) view returns((uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Session) GetGISTRootInfo(root_ *big.Int) (IStateGistRootInfo, error) { - return _LightweightStateV2.Contract.GetGISTRootInfo(&_LightweightStateV2.CallOpts, root_) -} - -// GetGISTRootInfo is a free data retrieval call binding the contract method 0x7c1a66de. -// -// Solidity: function getGISTRootInfo(uint256 root_) view returns((uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetGISTRootInfo(root_ *big.Int) (IStateGistRootInfo, error) { - return _LightweightStateV2.Contract.GetGISTRootInfo(&_LightweightStateV2.CallOpts, root_) -} - -// GetIdentityLastState is a free data retrieval call binding the contract method 0xbfcf3ecf. -// -// Solidity: function getIdentityLastState(uint256 identityId_) view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Caller) GetIdentityLastState(opts *bind.CallOpts, identityId_ *big.Int) (*big.Int, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getIdentityLastState", identityId_) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetIdentityLastState is a free data retrieval call binding the contract method 0xbfcf3ecf. -// -// Solidity: function getIdentityLastState(uint256 identityId_) view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Session) GetIdentityLastState(identityId_ *big.Int) (*big.Int, error) { - return _LightweightStateV2.Contract.GetIdentityLastState(&_LightweightStateV2.CallOpts, identityId_) -} - -// GetIdentityLastState is a free data retrieval call binding the contract method 0xbfcf3ecf. -// -// Solidity: function getIdentityLastState(uint256 identityId_) view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetIdentityLastState(identityId_ *big.Int) (*big.Int, error) { - return _LightweightStateV2.Contract.GetIdentityLastState(&_LightweightStateV2.CallOpts, identityId_) -} - -// GetSigComponents is a free data retrieval call binding the contract method 0x827e099e. -// -// Solidity: function getSigComponents(uint8 methodId_, address contractAddress_) view returns(string chainName_, uint256 nonce_) -func (_LightweightStateV2 *LightweightStateV2Caller) GetSigComponents(opts *bind.CallOpts, methodId_ uint8, contractAddress_ common.Address) (struct { - ChainName string - Nonce *big.Int -}, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getSigComponents", methodId_, contractAddress_) - - outstruct := new(struct { - ChainName string - Nonce *big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.ChainName = *abi.ConvertType(out[0], new(string)).(*string) - outstruct.Nonce = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - - return *outstruct, err - -} - -// GetSigComponents is a free data retrieval call binding the contract method 0x827e099e. -// -// Solidity: function getSigComponents(uint8 methodId_, address contractAddress_) view returns(string chainName_, uint256 nonce_) -func (_LightweightStateV2 *LightweightStateV2Session) GetSigComponents(methodId_ uint8, contractAddress_ common.Address) (struct { - ChainName string - Nonce *big.Int -}, error) { - return _LightweightStateV2.Contract.GetSigComponents(&_LightweightStateV2.CallOpts, methodId_, contractAddress_) -} - -// GetSigComponents is a free data retrieval call binding the contract method 0x827e099e. -// -// Solidity: function getSigComponents(uint8 methodId_, address contractAddress_) view returns(string chainName_, uint256 nonce_) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetSigComponents(methodId_ uint8, contractAddress_ common.Address) (struct { - ChainName string - Nonce *big.Int -}, error) { - return _LightweightStateV2.Contract.GetSigComponents(&_LightweightStateV2.CallOpts, methodId_, contractAddress_) -} - -// GetStateInfoById is a free data retrieval call binding the contract method 0xb4bdea55. -// -// Solidity: function getStateInfoById(uint256 identityId_) view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Caller) GetStateInfoById(opts *bind.CallOpts, identityId_ *big.Int) (IStateStateInfo, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getStateInfoById", identityId_) - - if err != nil { - return *new(IStateStateInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IStateStateInfo)).(*IStateStateInfo) - - return out0, err - -} - -// GetStateInfoById is a free data retrieval call binding the contract method 0xb4bdea55. -// -// Solidity: function getStateInfoById(uint256 identityId_) view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Session) GetStateInfoById(identityId_ *big.Int) (IStateStateInfo, error) { - return _LightweightStateV2.Contract.GetStateInfoById(&_LightweightStateV2.CallOpts, identityId_) -} - -// GetStateInfoById is a free data retrieval call binding the contract method 0xb4bdea55. -// -// Solidity: function getStateInfoById(uint256 identityId_) view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetStateInfoById(identityId_ *big.Int) (IStateStateInfo, error) { - return _LightweightStateV2.Contract.GetStateInfoById(&_LightweightStateV2.CallOpts, identityId_) -} - -// GetStateInfoByIdAndState is a free data retrieval call binding the contract method 0x53c87312. -// -// Solidity: function getStateInfoByIdAndState(uint256 identityId_, uint256 state_) view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Caller) GetStateInfoByIdAndState(opts *bind.CallOpts, identityId_ *big.Int, state_ *big.Int) (IStateStateInfo, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "getStateInfoByIdAndState", identityId_, state_) - - if err != nil { - return *new(IStateStateInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IStateStateInfo)).(*IStateStateInfo) - - return out0, err - -} - -// GetStateInfoByIdAndState is a free data retrieval call binding the contract method 0x53c87312. -// -// Solidity: function getStateInfoByIdAndState(uint256 identityId_, uint256 state_) view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2Session) GetStateInfoByIdAndState(identityId_ *big.Int, state_ *big.Int) (IStateStateInfo, error) { - return _LightweightStateV2.Contract.GetStateInfoByIdAndState(&_LightweightStateV2.CallOpts, identityId_, state_) -} - -// GetStateInfoByIdAndState is a free data retrieval call binding the contract method 0x53c87312. -// -// Solidity: function getStateInfoByIdAndState(uint256 identityId_, uint256 state_) view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) -func (_LightweightStateV2 *LightweightStateV2CallerSession) GetStateInfoByIdAndState(identityId_ *big.Int, state_ *big.Int) (IStateStateInfo, error) { - return _LightweightStateV2.Contract.GetStateInfoByIdAndState(&_LightweightStateV2.CallOpts, identityId_, state_) -} - -// IdExists is a free data retrieval call binding the contract method 0x0b8a295a. -// -// Solidity: function idExists(uint256 identityId_) view returns(bool) -func (_LightweightStateV2 *LightweightStateV2Caller) IdExists(opts *bind.CallOpts, identityId_ *big.Int) (bool, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "idExists", identityId_) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IdExists is a free data retrieval call binding the contract method 0x0b8a295a. -// -// Solidity: function idExists(uint256 identityId_) view returns(bool) -func (_LightweightStateV2 *LightweightStateV2Session) IdExists(identityId_ *big.Int) (bool, error) { - return _LightweightStateV2.Contract.IdExists(&_LightweightStateV2.CallOpts, identityId_) -} - -// IdExists is a free data retrieval call binding the contract method 0x0b8a295a. -// -// Solidity: function idExists(uint256 identityId_) view returns(bool) -func (_LightweightStateV2 *LightweightStateV2CallerSession) IdExists(identityId_ *big.Int) (bool, error) { - return _LightweightStateV2.Contract.IdExists(&_LightweightStateV2.CallOpts, identityId_) -} - -// Nonces is a free data retrieval call binding the contract method 0xed3218a2. -// -// Solidity: function nonces(address , uint8 ) view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Caller) Nonces(opts *bind.CallOpts, arg0 common.Address, arg1 uint8) (*big.Int, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "nonces", arg0, arg1) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Nonces is a free data retrieval call binding the contract method 0xed3218a2. -// -// Solidity: function nonces(address , uint8 ) view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2Session) Nonces(arg0 common.Address, arg1 uint8) (*big.Int, error) { - return _LightweightStateV2.Contract.Nonces(&_LightweightStateV2.CallOpts, arg0, arg1) -} - -// Nonces is a free data retrieval call binding the contract method 0xed3218a2. -// -// Solidity: function nonces(address , uint8 ) view returns(uint256) -func (_LightweightStateV2 *LightweightStateV2CallerSession) Nonces(arg0 common.Address, arg1 uint8) (*big.Int, error) { - return _LightweightStateV2.Contract.Nonces(&_LightweightStateV2.CallOpts, arg0, arg1) -} - -// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. -// -// Solidity: function proxiableUUID() view returns(bytes32) -func (_LightweightStateV2 *LightweightStateV2Caller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "proxiableUUID") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. -// -// Solidity: function proxiableUUID() view returns(bytes32) -func (_LightweightStateV2 *LightweightStateV2Session) ProxiableUUID() ([32]byte, error) { - return _LightweightStateV2.Contract.ProxiableUUID(&_LightweightStateV2.CallOpts) -} - -// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. -// -// Solidity: function proxiableUUID() view returns(bytes32) -func (_LightweightStateV2 *LightweightStateV2CallerSession) ProxiableUUID() ([32]byte, error) { - return _LightweightStateV2.Contract.ProxiableUUID(&_LightweightStateV2.CallOpts) -} - -// Signer is a free data retrieval call binding the contract method 0x238ac933. -// -// Solidity: function signer() view returns(address) -func (_LightweightStateV2 *LightweightStateV2Caller) Signer(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "signer") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Signer is a free data retrieval call binding the contract method 0x238ac933. -// -// Solidity: function signer() view returns(address) -func (_LightweightStateV2 *LightweightStateV2Session) Signer() (common.Address, error) { - return _LightweightStateV2.Contract.Signer(&_LightweightStateV2.CallOpts) -} - -// Signer is a free data retrieval call binding the contract method 0x238ac933. -// -// Solidity: function signer() view returns(address) -func (_LightweightStateV2 *LightweightStateV2CallerSession) Signer() (common.Address, error) { - return _LightweightStateV2.Contract.Signer(&_LightweightStateV2.CallOpts) -} - -// SourceStateContract is a free data retrieval call binding the contract method 0xfc228319. -// -// Solidity: function sourceStateContract() view returns(address) -func (_LightweightStateV2 *LightweightStateV2Caller) SourceStateContract(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "sourceStateContract") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// SourceStateContract is a free data retrieval call binding the contract method 0xfc228319. -// -// Solidity: function sourceStateContract() view returns(address) -func (_LightweightStateV2 *LightweightStateV2Session) SourceStateContract() (common.Address, error) { - return _LightweightStateV2.Contract.SourceStateContract(&_LightweightStateV2.CallOpts) -} - -// SourceStateContract is a free data retrieval call binding the contract method 0xfc228319. -// -// Solidity: function sourceStateContract() view returns(address) -func (_LightweightStateV2 *LightweightStateV2CallerSession) SourceStateContract() (common.Address, error) { - return _LightweightStateV2.Contract.SourceStateContract(&_LightweightStateV2.CallOpts) -} - -// StateExists is a free data retrieval call binding the contract method 0x233a4d23. -// -// Solidity: function stateExists(uint256 identityId_, uint256 state_) view returns(bool) -func (_LightweightStateV2 *LightweightStateV2Caller) StateExists(opts *bind.CallOpts, identityId_ *big.Int, state_ *big.Int) (bool, error) { - var out []interface{} - err := _LightweightStateV2.contract.Call(opts, &out, "stateExists", identityId_, state_) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// StateExists is a free data retrieval call binding the contract method 0x233a4d23. -// -// Solidity: function stateExists(uint256 identityId_, uint256 state_) view returns(bool) -func (_LightweightStateV2 *LightweightStateV2Session) StateExists(identityId_ *big.Int, state_ *big.Int) (bool, error) { - return _LightweightStateV2.Contract.StateExists(&_LightweightStateV2.CallOpts, identityId_, state_) -} - -// StateExists is a free data retrieval call binding the contract method 0x233a4d23. -// -// Solidity: function stateExists(uint256 identityId_, uint256 state_) view returns(bool) -func (_LightweightStateV2 *LightweightStateV2CallerSession) StateExists(identityId_ *big.Int, state_ *big.Int) (bool, error) { - return _LightweightStateV2.Contract.StateExists(&_LightweightStateV2.CallOpts, identityId_, state_) -} - -// LightweightStateV2Init is a paid mutator transaction binding the contract method 0x6032bbe6. -// -// Solidity: function __LightweightStateV2_init(address signer_, address sourceStateContract_, string chainName_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) LightweightStateV2Init(opts *bind.TransactOpts, signer_ common.Address, sourceStateContract_ common.Address, chainName_ string) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "__LightweightStateV2_init", signer_, sourceStateContract_, chainName_) -} - -// LightweightStateV2Init is a paid mutator transaction binding the contract method 0x6032bbe6. -// -// Solidity: function __LightweightStateV2_init(address signer_, address sourceStateContract_, string chainName_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) LightweightStateV2Init(signer_ common.Address, sourceStateContract_ common.Address, chainName_ string) (*types.Transaction, error) { - return _LightweightStateV2.Contract.LightweightStateV2Init(&_LightweightStateV2.TransactOpts, signer_, sourceStateContract_, chainName_) -} - -// LightweightStateV2Init is a paid mutator transaction binding the contract method 0x6032bbe6. -// -// Solidity: function __LightweightStateV2_init(address signer_, address sourceStateContract_, string chainName_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) LightweightStateV2Init(signer_ common.Address, sourceStateContract_ common.Address, chainName_ string) (*types.Transaction, error) { - return _LightweightStateV2.Contract.LightweightStateV2Init(&_LightweightStateV2.TransactOpts, signer_, sourceStateContract_, chainName_) -} - -// SignersInit is a paid mutator transaction binding the contract method 0x509ace95. -// -// Solidity: function __Signers_init(address signer_, string chainName_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) SignersInit(opts *bind.TransactOpts, signer_ common.Address, chainName_ string) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "__Signers_init", signer_, chainName_) -} - -// SignersInit is a paid mutator transaction binding the contract method 0x509ace95. -// -// Solidity: function __Signers_init(address signer_, string chainName_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) SignersInit(signer_ common.Address, chainName_ string) (*types.Transaction, error) { - return _LightweightStateV2.Contract.SignersInit(&_LightweightStateV2.TransactOpts, signer_, chainName_) -} - -// SignersInit is a paid mutator transaction binding the contract method 0x509ace95. -// -// Solidity: function __Signers_init(address signer_, string chainName_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) SignersInit(signer_ common.Address, chainName_ string) (*types.Transaction, error) { - return _LightweightStateV2.Contract.SignersInit(&_LightweightStateV2.TransactOpts, signer_, chainName_) -} - -// ChangeSigner is a paid mutator transaction binding the contract method 0x497f6959. -// -// Solidity: function changeSigner(bytes newSignerPubKey_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) ChangeSigner(opts *bind.TransactOpts, newSignerPubKey_ []byte, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "changeSigner", newSignerPubKey_, signature_) -} - -// ChangeSigner is a paid mutator transaction binding the contract method 0x497f6959. -// -// Solidity: function changeSigner(bytes newSignerPubKey_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) ChangeSigner(newSignerPubKey_ []byte, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.ChangeSigner(&_LightweightStateV2.TransactOpts, newSignerPubKey_, signature_) -} - -// ChangeSigner is a paid mutator transaction binding the contract method 0x497f6959. -// -// Solidity: function changeSigner(bytes newSignerPubKey_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) ChangeSigner(newSignerPubKey_ []byte, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.ChangeSigner(&_LightweightStateV2.TransactOpts, newSignerPubKey_, signature_) -} - -// ChangeSourceStateContract is a paid mutator transaction binding the contract method 0x89aeb0f5. -// -// Solidity: function changeSourceStateContract(address newSourceStateContract_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) ChangeSourceStateContract(opts *bind.TransactOpts, newSourceStateContract_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "changeSourceStateContract", newSourceStateContract_, signature_) -} - -// ChangeSourceStateContract is a paid mutator transaction binding the contract method 0x89aeb0f5. -// -// Solidity: function changeSourceStateContract(address newSourceStateContract_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) ChangeSourceStateContract(newSourceStateContract_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.ChangeSourceStateContract(&_LightweightStateV2.TransactOpts, newSourceStateContract_, signature_) -} - -// ChangeSourceStateContract is a paid mutator transaction binding the contract method 0x89aeb0f5. -// -// Solidity: function changeSourceStateContract(address newSourceStateContract_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) ChangeSourceStateContract(newSourceStateContract_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.ChangeSourceStateContract(&_LightweightStateV2.TransactOpts, newSourceStateContract_, signature_) -} - -// CheckSignatureAndIncrementNonce is a paid mutator transaction binding the contract method 0xe3754f90. -// -// Solidity: function checkSignatureAndIncrementNonce(uint8 methodId_, address contractAddress_, bytes32 signHash_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) CheckSignatureAndIncrementNonce(opts *bind.TransactOpts, methodId_ uint8, contractAddress_ common.Address, signHash_ [32]byte, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "checkSignatureAndIncrementNonce", methodId_, contractAddress_, signHash_, signature_) -} - -// CheckSignatureAndIncrementNonce is a paid mutator transaction binding the contract method 0xe3754f90. -// -// Solidity: function checkSignatureAndIncrementNonce(uint8 methodId_, address contractAddress_, bytes32 signHash_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) CheckSignatureAndIncrementNonce(methodId_ uint8, contractAddress_ common.Address, signHash_ [32]byte, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.CheckSignatureAndIncrementNonce(&_LightweightStateV2.TransactOpts, methodId_, contractAddress_, signHash_, signature_) -} - -// CheckSignatureAndIncrementNonce is a paid mutator transaction binding the contract method 0xe3754f90. -// -// Solidity: function checkSignatureAndIncrementNonce(uint8 methodId_, address contractAddress_, bytes32 signHash_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) CheckSignatureAndIncrementNonce(methodId_ uint8, contractAddress_ common.Address, signHash_ [32]byte, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.CheckSignatureAndIncrementNonce(&_LightweightStateV2.TransactOpts, methodId_, contractAddress_, signHash_, signature_) -} - -// SignedTransitGISTData is a paid mutator transaction binding the contract method 0xaaf654c3. -// -// Solidity: function signedTransitGISTData(uint256 prevGist_, (uint256,uint256,uint256,uint256) gistData_, bytes proof_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) SignedTransitGISTData(opts *bind.TransactOpts, prevGist_ *big.Int, gistData_ ILightweightStateV2GistRootData, proof_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "signedTransitGISTData", prevGist_, gistData_, proof_) -} - -// SignedTransitGISTData is a paid mutator transaction binding the contract method 0xaaf654c3. -// -// Solidity: function signedTransitGISTData(uint256 prevGist_, (uint256,uint256,uint256,uint256) gistData_, bytes proof_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) SignedTransitGISTData(prevGist_ *big.Int, gistData_ ILightweightStateV2GistRootData, proof_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.SignedTransitGISTData(&_LightweightStateV2.TransactOpts, prevGist_, gistData_, proof_) -} - -// SignedTransitGISTData is a paid mutator transaction binding the contract method 0xaaf654c3. -// -// Solidity: function signedTransitGISTData(uint256 prevGist_, (uint256,uint256,uint256,uint256) gistData_, bytes proof_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) SignedTransitGISTData(prevGist_ *big.Int, gistData_ ILightweightStateV2GistRootData, proof_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.SignedTransitGISTData(&_LightweightStateV2.TransactOpts, prevGist_, gistData_, proof_) -} - -// SignedTransitStateData is a paid mutator transaction binding the contract method 0x076599d5. -// -// Solidity: function signedTransitStateData(uint256 prevState_, (uint256,uint256,uint256,uint256,uint256) stateData_, bytes proof_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) SignedTransitStateData(opts *bind.TransactOpts, prevState_ *big.Int, stateData_ ILightweightStateV2StateData, proof_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "signedTransitStateData", prevState_, stateData_, proof_) -} - -// SignedTransitStateData is a paid mutator transaction binding the contract method 0x076599d5. -// -// Solidity: function signedTransitStateData(uint256 prevState_, (uint256,uint256,uint256,uint256,uint256) stateData_, bytes proof_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) SignedTransitStateData(prevState_ *big.Int, stateData_ ILightweightStateV2StateData, proof_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.SignedTransitStateData(&_LightweightStateV2.TransactOpts, prevState_, stateData_, proof_) -} - -// SignedTransitStateData is a paid mutator transaction binding the contract method 0x076599d5. -// -// Solidity: function signedTransitStateData(uint256 prevState_, (uint256,uint256,uint256,uint256,uint256) stateData_, bytes proof_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) SignedTransitStateData(prevState_ *big.Int, stateData_ ILightweightStateV2StateData, proof_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.SignedTransitStateData(&_LightweightStateV2.TransactOpts, prevState_, stateData_, proof_) -} - -// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. -// -// Solidity: function upgradeTo(address newImplementation) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "upgradeTo", newImplementation) -} - -// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. -// -// Solidity: function upgradeTo(address newImplementation) returns() -func (_LightweightStateV2 *LightweightStateV2Session) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { - return _LightweightStateV2.Contract.UpgradeTo(&_LightweightStateV2.TransactOpts, newImplementation) -} - -// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. -// -// Solidity: function upgradeTo(address newImplementation) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { - return _LightweightStateV2.Contract.UpgradeTo(&_LightweightStateV2.TransactOpts, newImplementation) -} - -// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. -// -// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) -} - -// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. -// -// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() -func (_LightweightStateV2 *LightweightStateV2Session) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.UpgradeToAndCall(&_LightweightStateV2.TransactOpts, newImplementation, data) -} - -// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. -// -// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.UpgradeToAndCall(&_LightweightStateV2.TransactOpts, newImplementation, data) -} - -// UpgradeToWithSig is a paid mutator transaction binding the contract method 0x52d04661. -// -// Solidity: function upgradeToWithSig(address newImplementation_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) UpgradeToWithSig(opts *bind.TransactOpts, newImplementation_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "upgradeToWithSig", newImplementation_, signature_) -} - -// UpgradeToWithSig is a paid mutator transaction binding the contract method 0x52d04661. -// -// Solidity: function upgradeToWithSig(address newImplementation_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) UpgradeToWithSig(newImplementation_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.UpgradeToWithSig(&_LightweightStateV2.TransactOpts, newImplementation_, signature_) -} - -// UpgradeToWithSig is a paid mutator transaction binding the contract method 0x52d04661. -// -// Solidity: function upgradeToWithSig(address newImplementation_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) UpgradeToWithSig(newImplementation_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.UpgradeToWithSig(&_LightweightStateV2.TransactOpts, newImplementation_, signature_) -} - -// ValidateChangeAddressSignature is a paid mutator transaction binding the contract method 0x7d1e764b. -// -// Solidity: function validateChangeAddressSignature(uint8 methodId_, address contractAddress_, address newAddress_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Transactor) ValidateChangeAddressSignature(opts *bind.TransactOpts, methodId_ uint8, contractAddress_ common.Address, newAddress_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.contract.Transact(opts, "validateChangeAddressSignature", methodId_, contractAddress_, newAddress_, signature_) -} - -// ValidateChangeAddressSignature is a paid mutator transaction binding the contract method 0x7d1e764b. -// -// Solidity: function validateChangeAddressSignature(uint8 methodId_, address contractAddress_, address newAddress_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2Session) ValidateChangeAddressSignature(methodId_ uint8, contractAddress_ common.Address, newAddress_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.ValidateChangeAddressSignature(&_LightweightStateV2.TransactOpts, methodId_, contractAddress_, newAddress_, signature_) -} - -// ValidateChangeAddressSignature is a paid mutator transaction binding the contract method 0x7d1e764b. -// -// Solidity: function validateChangeAddressSignature(uint8 methodId_, address contractAddress_, address newAddress_, bytes signature_) returns() -func (_LightweightStateV2 *LightweightStateV2TransactorSession) ValidateChangeAddressSignature(methodId_ uint8, contractAddress_ common.Address, newAddress_ common.Address, signature_ []byte) (*types.Transaction, error) { - return _LightweightStateV2.Contract.ValidateChangeAddressSignature(&_LightweightStateV2.TransactOpts, methodId_, contractAddress_, newAddress_, signature_) -} - -// LightweightStateV2AdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the LightweightStateV2 contract. -type LightweightStateV2AdminChangedIterator struct { - Event *LightweightStateV2AdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *LightweightStateV2AdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2AdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2AdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *LightweightStateV2AdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LightweightStateV2AdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LightweightStateV2AdminChanged represents a AdminChanged event raised by the LightweightStateV2 contract. -type LightweightStateV2AdminChanged struct { - PreviousAdmin common.Address - NewAdmin common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. -// -// Solidity: event AdminChanged(address previousAdmin, address newAdmin) -func (_LightweightStateV2 *LightweightStateV2Filterer) FilterAdminChanged(opts *bind.FilterOpts) (*LightweightStateV2AdminChangedIterator, error) { - - logs, sub, err := _LightweightStateV2.contract.FilterLogs(opts, "AdminChanged") - if err != nil { - return nil, err - } - return &LightweightStateV2AdminChangedIterator{contract: _LightweightStateV2.contract, event: "AdminChanged", logs: logs, sub: sub}, nil -} - -// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. -// -// Solidity: event AdminChanged(address previousAdmin, address newAdmin) -func (_LightweightStateV2 *LightweightStateV2Filterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *LightweightStateV2AdminChanged) (event.Subscription, error) { - - logs, sub, err := _LightweightStateV2.contract.WatchLogs(opts, "AdminChanged") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(LightweightStateV2AdminChanged) - if err := _LightweightStateV2.contract.UnpackLog(event, "AdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. -// -// Solidity: event AdminChanged(address previousAdmin, address newAdmin) -func (_LightweightStateV2 *LightweightStateV2Filterer) ParseAdminChanged(log types.Log) (*LightweightStateV2AdminChanged, error) { - event := new(LightweightStateV2AdminChanged) - if err := _LightweightStateV2.contract.UnpackLog(event, "AdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LightweightStateV2BeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the LightweightStateV2 contract. -type LightweightStateV2BeaconUpgradedIterator struct { - Event *LightweightStateV2BeaconUpgraded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *LightweightStateV2BeaconUpgradedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2BeaconUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2BeaconUpgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *LightweightStateV2BeaconUpgradedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LightweightStateV2BeaconUpgradedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LightweightStateV2BeaconUpgraded represents a BeaconUpgraded event raised by the LightweightStateV2 contract. -type LightweightStateV2BeaconUpgraded struct { - Beacon common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. -// -// Solidity: event BeaconUpgraded(address indexed beacon) -func (_LightweightStateV2 *LightweightStateV2Filterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*LightweightStateV2BeaconUpgradedIterator, error) { - - var beaconRule []interface{} - for _, beaconItem := range beacon { - beaconRule = append(beaconRule, beaconItem) - } - - logs, sub, err := _LightweightStateV2.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) - if err != nil { - return nil, err - } - return &LightweightStateV2BeaconUpgradedIterator{contract: _LightweightStateV2.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil -} - -// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. -// -// Solidity: event BeaconUpgraded(address indexed beacon) -func (_LightweightStateV2 *LightweightStateV2Filterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *LightweightStateV2BeaconUpgraded, beacon []common.Address) (event.Subscription, error) { - - var beaconRule []interface{} - for _, beaconItem := range beacon { - beaconRule = append(beaconRule, beaconItem) - } - - logs, sub, err := _LightweightStateV2.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(LightweightStateV2BeaconUpgraded) - if err := _LightweightStateV2.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. -// -// Solidity: event BeaconUpgraded(address indexed beacon) -func (_LightweightStateV2 *LightweightStateV2Filterer) ParseBeaconUpgraded(log types.Log) (*LightweightStateV2BeaconUpgraded, error) { - event := new(LightweightStateV2BeaconUpgraded) - if err := _LightweightStateV2.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LightweightStateV2InitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the LightweightStateV2 contract. -type LightweightStateV2InitializedIterator struct { - Event *LightweightStateV2Initialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *LightweightStateV2InitializedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2Initialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2Initialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *LightweightStateV2InitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LightweightStateV2InitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LightweightStateV2Initialized represents a Initialized event raised by the LightweightStateV2 contract. -type LightweightStateV2Initialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_LightweightStateV2 *LightweightStateV2Filterer) FilterInitialized(opts *bind.FilterOpts) (*LightweightStateV2InitializedIterator, error) { - - logs, sub, err := _LightweightStateV2.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &LightweightStateV2InitializedIterator{contract: _LightweightStateV2.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_LightweightStateV2 *LightweightStateV2Filterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *LightweightStateV2Initialized) (event.Subscription, error) { - - logs, sub, err := _LightweightStateV2.contract.WatchLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(LightweightStateV2Initialized) - if err := _LightweightStateV2.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_LightweightStateV2 *LightweightStateV2Filterer) ParseInitialized(log types.Log) (*LightweightStateV2Initialized, error) { - event := new(LightweightStateV2Initialized) - if err := _LightweightStateV2.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LightweightStateV2SignGISTDataTransitedIterator is returned from FilterSignGISTDataTransited and is used to iterate over the raw logs and unpacked data for SignGISTDataTransited events raised by the LightweightStateV2 contract. -type LightweightStateV2SignGISTDataTransitedIterator struct { - Event *LightweightStateV2SignGISTDataTransited // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *LightweightStateV2SignGISTDataTransitedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2SignGISTDataTransited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2SignGISTDataTransited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *LightweightStateV2SignGISTDataTransitedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LightweightStateV2SignGISTDataTransitedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LightweightStateV2SignGISTDataTransited represents a SignGISTDataTransited event raised by the LightweightStateV2 contract. -type LightweightStateV2SignGISTDataTransited struct { - NewGistRoot *big.Int - PrevGistRoot *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSignGISTDataTransited is a free log retrieval operation binding the contract event 0x574c96c9afe8b5549451641801bd35b6e08dcebcb22fa1d3a6f48219bce103a9. -// -// Solidity: event SignGISTDataTransited(uint256 newGistRoot, uint256 prevGistRoot) -func (_LightweightStateV2 *LightweightStateV2Filterer) FilterSignGISTDataTransited(opts *bind.FilterOpts) (*LightweightStateV2SignGISTDataTransitedIterator, error) { - - logs, sub, err := _LightweightStateV2.contract.FilterLogs(opts, "SignGISTDataTransited") - if err != nil { - return nil, err - } - return &LightweightStateV2SignGISTDataTransitedIterator{contract: _LightweightStateV2.contract, event: "SignGISTDataTransited", logs: logs, sub: sub}, nil -} - -// WatchSignGISTDataTransited is a free log subscription operation binding the contract event 0x574c96c9afe8b5549451641801bd35b6e08dcebcb22fa1d3a6f48219bce103a9. -// -// Solidity: event SignGISTDataTransited(uint256 newGistRoot, uint256 prevGistRoot) -func (_LightweightStateV2 *LightweightStateV2Filterer) WatchSignGISTDataTransited(opts *bind.WatchOpts, sink chan<- *LightweightStateV2SignGISTDataTransited) (event.Subscription, error) { - - logs, sub, err := _LightweightStateV2.contract.WatchLogs(opts, "SignGISTDataTransited") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(LightweightStateV2SignGISTDataTransited) - if err := _LightweightStateV2.contract.UnpackLog(event, "SignGISTDataTransited", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseSignGISTDataTransited is a log parse operation binding the contract event 0x574c96c9afe8b5549451641801bd35b6e08dcebcb22fa1d3a6f48219bce103a9. -// -// Solidity: event SignGISTDataTransited(uint256 newGistRoot, uint256 prevGistRoot) -func (_LightweightStateV2 *LightweightStateV2Filterer) ParseSignGISTDataTransited(log types.Log) (*LightweightStateV2SignGISTDataTransited, error) { - event := new(LightweightStateV2SignGISTDataTransited) - if err := _LightweightStateV2.contract.UnpackLog(event, "SignGISTDataTransited", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LightweightStateV2SignStateDataTransitedIterator is returned from FilterSignStateDataTransited and is used to iterate over the raw logs and unpacked data for SignStateDataTransited events raised by the LightweightStateV2 contract. -type LightweightStateV2SignStateDataTransitedIterator struct { - Event *LightweightStateV2SignStateDataTransited // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *LightweightStateV2SignStateDataTransitedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2SignStateDataTransited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2SignStateDataTransited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *LightweightStateV2SignStateDataTransitedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LightweightStateV2SignStateDataTransitedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LightweightStateV2SignStateDataTransited represents a SignStateDataTransited event raised by the LightweightStateV2 contract. -type LightweightStateV2SignStateDataTransited struct { - IdentityId *big.Int - NewIdentityState *big.Int - PrevIdentityState *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSignStateDataTransited is a free log retrieval operation binding the contract event 0x54615679a8c54f75531a431a2882c4ff0b716f9f92f486212b2784deec37f2f3. -// -// Solidity: event SignStateDataTransited(uint256 identityId, uint256 newIdentityState, uint256 prevIdentityState) -func (_LightweightStateV2 *LightweightStateV2Filterer) FilterSignStateDataTransited(opts *bind.FilterOpts) (*LightweightStateV2SignStateDataTransitedIterator, error) { - - logs, sub, err := _LightweightStateV2.contract.FilterLogs(opts, "SignStateDataTransited") - if err != nil { - return nil, err - } - return &LightweightStateV2SignStateDataTransitedIterator{contract: _LightweightStateV2.contract, event: "SignStateDataTransited", logs: logs, sub: sub}, nil -} - -// WatchSignStateDataTransited is a free log subscription operation binding the contract event 0x54615679a8c54f75531a431a2882c4ff0b716f9f92f486212b2784deec37f2f3. -// -// Solidity: event SignStateDataTransited(uint256 identityId, uint256 newIdentityState, uint256 prevIdentityState) -func (_LightweightStateV2 *LightweightStateV2Filterer) WatchSignStateDataTransited(opts *bind.WatchOpts, sink chan<- *LightweightStateV2SignStateDataTransited) (event.Subscription, error) { - - logs, sub, err := _LightweightStateV2.contract.WatchLogs(opts, "SignStateDataTransited") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(LightweightStateV2SignStateDataTransited) - if err := _LightweightStateV2.contract.UnpackLog(event, "SignStateDataTransited", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseSignStateDataTransited is a log parse operation binding the contract event 0x54615679a8c54f75531a431a2882c4ff0b716f9f92f486212b2784deec37f2f3. -// -// Solidity: event SignStateDataTransited(uint256 identityId, uint256 newIdentityState, uint256 prevIdentityState) -func (_LightweightStateV2 *LightweightStateV2Filterer) ParseSignStateDataTransited(log types.Log) (*LightweightStateV2SignStateDataTransited, error) { - event := new(LightweightStateV2SignStateDataTransited) - if err := _LightweightStateV2.contract.UnpackLog(event, "SignStateDataTransited", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LightweightStateV2UpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the LightweightStateV2 contract. -type LightweightStateV2UpgradedIterator struct { - Event *LightweightStateV2Upgraded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *LightweightStateV2UpgradedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2Upgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(LightweightStateV2Upgraded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *LightweightStateV2UpgradedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LightweightStateV2UpgradedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LightweightStateV2Upgraded represents a Upgraded event raised by the LightweightStateV2 contract. -type LightweightStateV2Upgraded struct { - Implementation common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_LightweightStateV2 *LightweightStateV2Filterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*LightweightStateV2UpgradedIterator, error) { - - var implementationRule []interface{} - for _, implementationItem := range implementation { - implementationRule = append(implementationRule, implementationItem) - } - - logs, sub, err := _LightweightStateV2.contract.FilterLogs(opts, "Upgraded", implementationRule) - if err != nil { - return nil, err - } - return &LightweightStateV2UpgradedIterator{contract: _LightweightStateV2.contract, event: "Upgraded", logs: logs, sub: sub}, nil -} - -// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_LightweightStateV2 *LightweightStateV2Filterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *LightweightStateV2Upgraded, implementation []common.Address) (event.Subscription, error) { - - var implementationRule []interface{} - for _, implementationItem := range implementation { - implementationRule = append(implementationRule, implementationItem) - } - - logs, sub, err := _LightweightStateV2.contract.WatchLogs(opts, "Upgraded", implementationRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(LightweightStateV2Upgraded) - if err := _LightweightStateV2.contract.UnpackLog(event, "Upgraded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. -// -// Solidity: event Upgraded(address indexed implementation) -func (_LightweightStateV2 *LightweightStateV2Filterer) ParseUpgraded(log types.Log) (*LightweightStateV2Upgraded, error) { - event := new(LightweightStateV2Upgraded) - if err := _LightweightStateV2.contract.UnpackLog(event, "Upgraded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/werf.yaml b/werf.yaml index a1d336a..5a5f335 100644 --- a/werf.yaml +++ b/werf.yaml @@ -4,10 +4,10 @@ project: "backend" image: builder from: golang:1.19-alpine docker: - WORKDIR: /go/src/github.com/rarimo/identity-relayer-svc + WORKDIR: /go/src/github.com/rarimo/worldcoin-relayer-svc git: - add: / - to: /go/src/github.com/rarimo/identity-relayer-svc + to: /go/src/github.com/rarimo/worldcoin-relayer-svc stageDependencies: install: - go.mod @@ -17,15 +17,15 @@ git: shell: install: - apk add git build-base - - cd /go/src/github.com/rarimo/identity-relayer-svc + - cd /go/src/github.com/rarimo/worldcoin-relayer-svc - go mod tidy - go mod vendor setup: - export CGO_ENABLED=1 - export GO111MODULE=off - export GOOS=linux - - cd /go/src/github.com/rarimo/identity-relayer-svc - - go build -o /usr/local/bin/relayer-svc /go/src/github.com/rarimo/identity-relayer-svc + - cd /go/src/github.com/rarimo/worldcoin-relayer-svc + - go build -o /usr/local/bin/relayer-svc /go/src/github.com/rarimo/worldcoin-relayer-svc --- image: service