Skip to content

Commit

Permalink
Merge pull request #2 from rarimo/feature/wordlcoin-identity-transfers
Browse files Browse the repository at this point in the history
Feature: WorldCoin identity transfer
  • Loading branch information
olegfomenko authored Dec 26, 2023
2 parents 3903223 + 9f4a9d3 commit 377383a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/cosmos/cosmos-sdk v0.46.12
github.com/ethereum/go-ethereum v1.10.26
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1
github.com/hashicorp/vault/api v1.8.2
github.com/ignite/cli v0.26.1
github.com/prometheus/client_golang v1.14.0
github.com/rarimo/go-merkle v0.0.0-20231004122345-36fa49031c66
github.com/rarimo/rarimo-core v1.0.7-0.20231123231906-566dc0033e75
github.com/rarimo/rarimo-core v1.0.7-0.20231208125434-eaf4ddf6c070
github.com/rubenv/sql-migrate v1.2.0
github.com/tendermint/tendermint v0.34.28
gitlab.com/distributed_lab/figure v2.1.0+incompatible
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
Expand Down Expand Up @@ -1277,8 +1277,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/rarimo/tss-lib/v2 v2.0.1 h1:q2ar8txLLal41lXy7Xv8AXVQ7TWeXX0fzWfbUIF81qU=
github.com/rarimo/tss-lib/v2 v2.0.1/go.mod h1:s4LRfEqj89DhfNb+oraW0dURt5LtOHWXb9Gtkghn0L8=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
Expand Down
1 change: 1 addition & 0 deletions internal/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func Run(args []string) bool {
go pool.NewIdentityGISTTransferOperationSubscriber(ctx.Pool(), ctx.Tendermint(), ctx.Log()).Run()
go pool.NewIdentityStateTransferOperationSubscriber(ctx.Pool(), ctx.Tendermint(), ctx.Log()).Run()
go pool.NewIdentityAggregatedTransferOperationSubscriber(ctx.Pool(), ctx.Tendermint(), ctx.Log()).Run()
go pool.NewWorldCoinIdentityTransferOperationSubscriber(ctx.Pool(), ctx.Tendermint(), ctx.Log()).Run()
go pool.NewOperationCatchupper(ctx.Pool(), ctx.Client(), ctx.Log()).Run()

manager := core.NewSessionManager()
Expand Down
1 change: 1 addition & 0 deletions internal/pool/catchupper.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var acceptableOperationTypes = map[rarimo.OpType]struct{}{
rarimo.OpType_CONTRACT_UPGRADE: {},
rarimo.OpType_IDENTITY_DEFAULT_TRANSFER: {},
rarimo.OpType_IDENTITY_AGGREGATED_TRANSFER: {},
rarimo.OpType_WORLDCOIN_IDENTITY_TRANSFER: {},
}

// OperationCatchupper catches up old unsigned operations from core.
Expand Down
11 changes: 11 additions & 0 deletions internal/pool/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
OpQueryIdentityDefaultTransfer = "tm.event='Tx' AND operation_approved.operation_type='IDENTITY_DEFAULT_TRANSFER'"
OpQueryIdentityGISTTransfer = "tm.event='Tx' AND operation_approved.operation_type='IDENTITY_GIST_TRANSFER'"
OpQueryIdentityStateTransfer = "tm.event='Tx' AND operation_approved.operation_type='IDENTITY_STATE_TRANSFER'"
OpQueryWorldCoinIdentityTransfer = "tm.event='Tx' AND operation_approved.operation_type='WORLDCOIN_IDENTITY_TRANSFER'"
OpQueryIdentityAggregatedTransfer = "tm.event='NewBlock' AND operation_approved.operation_type='IDENTITY_AGGREGATED_TRANSFER'"
OpPoolSize = 1000
)
Expand All @@ -29,6 +30,16 @@ type OperationSubscriber struct {
log *logan.Entry
}

// NewWorldCoinIdentityTransferOperationSubscriber creates the subscriber instance for listening new wordlcoin identity transfer operations
func NewWorldCoinIdentityTransferOperationSubscriber(pool *Pool, tendermint *http.HTTP, log *logan.Entry) *OperationSubscriber {
return &OperationSubscriber{
pool: pool,
log: log,
client: tendermint,
query: OpQueryWorldCoinIdentityTransfer,
}
}

// NewIdentityAggregatedTransferOperationSubscriber creates the subscriber instance for listening new identity aggregated transfer operations
func NewIdentityAggregatedTransferOperationSubscriber(pool *Pool, tendermint *http.HTTP, log *logan.Entry) *OperationSubscriber {
return &OperationSubscriber{
Expand Down

0 comments on commit 377383a

Please sign in to comment.