Skip to content

Commit

Permalink
Merge pull request #28 from rarimo/feature/pr-fixes-listener
Browse files Browse the repository at this point in the history
register a new codec
  • Loading branch information
olegfomenko authored Aug 29, 2024
2 parents 979e1c7 + 55c86a0 commit aff7e97
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 173 deletions.
176 changes: 88 additions & 88 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54947,6 +54947,56 @@ paths:
type: string
tags:
- Query
/rarimo/rarimo-core/rootupdater/params:
get:
summary: Parameters queries the parameters of the module.
operationId: RarimoRarimocoreRootupdaterParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
properties:
contract_address:
type: string
root:
type: string
last_signed_root:
type: string
last_signed_root_index:
type: string
event_name:
type: string
root_timestamp:
type: string
format: int64
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
tags:
- Query
/rarimo/rarimo-core/tokenmanager/collection:
get:
operationId: RarimoRarimocoreTokenmanagerCollectionAll
Expand Down Expand Up @@ -60051,56 +60101,6 @@ paths:
format: uint64
tags:
- Query
/rarimo/rarimo-core/rootupdater/params:
get:
summary: Parameters queries the parameters of the module.
operationId: RarimoRootupdaterParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
properties:
contract_address:
type: string
root:
type: string
last_signed_root:
type: string
last_signed_root_index:
type: string
event_name:
type: string
root_timestamp:
type: integer
format: int64
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
tags:
- Query
definitions:
cosmos.auth.v1beta1.AddressBytesToStringResponse:
type: object
Expand Down Expand Up @@ -92156,6 +92156,44 @@ definitions:
type: string
validator:
type: string
rarimo.rarimocore.rootupdater.Params:
type: object
properties:
contract_address:
type: string
root:
type: string
last_signed_root:
type: string
last_signed_root_index:
type: string
event_name:
type: string
root_timestamp:
type: string
format: int64
description: Params defines the parameters for the module.
rarimo.rarimocore.rootupdater.QueryParamsResponse:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
properties:
contract_address:
type: string
root:
type: string
last_signed_root:
type: string
last_signed_root_index:
type: string
event_name:
type: string
root_timestamp:
type: string
format: int64
description: QueryParamsResponse is response type for the Query/Params RPC method.
rarimo.rarimocore.tokenmanager.Collection:
type: object
properties:
Expand Down Expand Up @@ -93970,41 +94008,3 @@ definitions:
format: uint64
denom:
type: string
rarimo.rootupdater.Params:
type: object
properties:
contract_address:
type: string
root:
type: string
last_signed_root:
type: string
last_signed_root_index:
type: string
event_name:
type: string
root_timestamp:
type: integer
format: int64
description: Params defines the parameters for the module.
rarimo.rootupdater.QueryParamsResponse:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
properties:
contract_address:
type: string
root:
type: string
last_signed_root:
type: string
last_signed_root_index:
type: string
event_name:
type: string
root_timestamp:
type: integer
format: int64
description: QueryParamsResponse is response type for the Query/Params RPC method.
1 change: 1 addition & 0 deletions proto/rarimocore/op_passport_root_update.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ message PassportRootUpdate {
string root = 1;
string contract_address = 2;
int64 timestamp = 3;
uint64 block_height = 4;
}


2 changes: 1 addition & 1 deletion proto/rootupdater/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package rarimo.rootupdater;
package rarimo.rarimocore.rootupdater;

import "gogoproto/gogo.proto";
import "rootupdater/params.proto";
Expand Down
3 changes: 2 additions & 1 deletion proto/rootupdater/params.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package rarimo.rootupdater;
package rarimo.rarimocore.rootupdater;

import "gogoproto/gogo.proto";

Expand All @@ -13,4 +13,5 @@ message Params {
string last_signed_root_index = 4;
string event_name = 5;
int64 root_timestamp = 6;
uint64 block_height = 7;
}
2 changes: 1 addition & 1 deletion proto/rootupdater/query.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package rarimo.rootupdater;
package rarimo.rarimocore.rootupdater;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
Expand Down
2 changes: 1 addition & 1 deletion proto/rootupdater/tx.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package rarimo.rootupdater;
package rarimo.rarimocore.rootupdater;

option go_package = "github.com/rarimo/rarimo-core/x/rootupdater/types";

Expand Down
7 changes: 7 additions & 0 deletions x/rarimocore/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&DropPartiesProposal{}, "rarimocore/DropPartiesProposal", nil)
cdc.RegisterConcrete(&ArbitrarySigningProposal{}, "rarimocore/ArbitrarySigningProposal", nil)
cdc.RegisterConcrete(&Arbitrary{}, "rarimocore/Arbitrary", nil)
cdc.RegisterConcrete(&PassportRootUpdate{}, "rarimocore/PassportRootUpdate", nil)
// this line is used by starport scaffolding # 2
}

Expand Down Expand Up @@ -151,6 +152,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
(*proto.Message)(nil),
&Arbitrary{},
)

registry.RegisterInterface(
"rarimo.rarimocore.rarimocore.PassportRootUpdate",
(*proto.Message)(nil),
&PassportRootUpdate{},
)
// this line is used by starport scaffolding # 3

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
Expand Down
67 changes: 52 additions & 15 deletions x/rarimocore/types/op_passport_root_update.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions x/rootupdater/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (k Keeper) EndBlocker(ctx sdk.Context) {
ContractAddress: params.ContractAddress,
Root: params.Root,
Timestamp: params.RootTimestamp,
BlockHeight: params.BlockHeight,
})

if err != nil {
Expand Down
1 change: 1 addition & 0 deletions x/rootupdater/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (k Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *eth

params.Root = hexutil.Encode(eventBody.Root[:])
params.RootTimestamp = ctx.BlockTime().Unix()
params.BlockHeight = log.BlockNumber

k.Logger(ctx).Info(fmt.Sprintf("Received PostTxProcessing event in %s module: %v", types.ModuleName, eventBody))
k.SetParams(ctx, params)
Expand Down
Loading

0 comments on commit aff7e97

Please sign in to comment.