Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement statedb #52

Merged
merged 9 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/ibc-hooks/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ func _createTestInput(
for _, v := range keys {
ms.MountStoreWithDB(v, storetypes.StoreTypeIAVL, db)
}
tkeys := storetypes.NewTransientStoreKeys(
evmtypes.TStoreKey,
)
for _, v := range tkeys {
ms.MountStoreWithDB(v, storetypes.StoreTypeTransient, db)
}
memKeys := storetypes.NewMemoryStoreKeys()
for _, v := range memKeys {
ms.MountStoreWithDB(v, storetypes.StoreTypeMemory, db)
Expand Down Expand Up @@ -301,6 +307,7 @@ func _createTestInput(
ac,
appCodec,
runtime.NewKVStoreService(keys[evmtypes.StoreKey]),
runtime.NewTransientStoreService(tkeys[evmtypes.TStoreKey]),
accountKeeper,
bankKeeper,
communityPoolKeeper,
Expand Down
1 change: 1 addition & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ func NewAppKeeper(
ac,
appCodec,
runtime.NewKVStoreService(appKeepers.keys[evmtypes.StoreKey]),
runtime.NewTransientStoreService(appKeepers.tkeys[evmtypes.TStoreKey]),
accountKeeper,
bankKeeper,
communityPoolKeeper,
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
)

// Define transient store keys
appKeepers.tkeys = storetypes.NewTransientStoreKeys(forwardingtypes.TransientStoreKey)
appKeepers.tkeys = storetypes.NewTransientStoreKeys(evmtypes.TStoreKey, forwardingtypes.TransientStoreKey)

// MemKeys are for information that is stored only in RAM.
appKeepers.memKeys = storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down
8 changes: 8 additions & 0 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@
}
}
},
{
"url": "./tmp-swagger-gen/initia/ibchooks/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IBCHooksParams"
}
}
},
{
"url": "./tmp-swagger-gen/opinit/opchild/v1/query.swagger.json",
"operationIds": {
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

301 changes: 301 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37001,6 +37001,228 @@ paths:
format: uint64
tags:
- Query
/initia/ibchooks/v1/acls:
get:
summary: ACLs gets ACL entries.
operationId: ACLs
responses:
'200':
description: A successful response.
schema:
type: object
properties:
acls:
type: array
items:
type: object
properties:
address:
type: string
allowed:
type: boolean
description: ACL defines the ACL entry of an address.
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
title: |-
QueryACLsResponse is the response type for the
Query/ACLAddrs RPC method
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.

It is less efficient than using key. Only one of offset or key
should

be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.

If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include

a count of the total number of items available for pagination in
UIs.

count_total is only respected when offset is used. It is ignored
when key

is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.


Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
tags:
- Query
/initia/ibchooks/v1/acls/{address}:
get:
summary: ACL gets ACL entry of an address.
operationId: ACL
responses:
'200':
description: A successful response.
schema:
type: object
properties:
acl:
type: object
properties:
address:
type: string
allowed:
type: boolean
description: ACL defines the ACL entry of an address.
title: |-
QueryACLResponse is the response type for the Query/ACL RPC
method
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: address
description: >-
Address is a contract address (wasm, evm) or a contract deployer
address (move).
in: path
required: true
type: string
tags:
- Query
/initia/ibchooks/v1/params:
get:
summary: Params queries all parameters.
operationId: IBCHooksParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params defines the parameters of the module.
type: object
properties:
default_allowed:
type: boolean
description: |-
if the ACL of a address is not set,
then we use this value to decide the ACL.
description: >-
QueryParamsResponse is the response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
tags:
- Query
/opinit/opchild/v1/base_denom/{denom}:
get:
operationId: BaseDenom
Expand Down Expand Up @@ -67017,6 +67239,85 @@ definitions:
PacketId is an identifer for a unique Packet
Source chains refer to packets by source port/channel
Destination chains refer to packets by destination port/channel
initia.ibchooks.v1.ACL:
type: object
properties:
address:
type: string
allowed:
type: boolean
description: ACL defines the ACL entry of an address.
initia.ibchooks.v1.Params:
type: object
properties:
default_allowed:
type: boolean
description: |-
if the ACL of a address is not set,
then we use this value to decide the ACL.
description: Params defines the set of hook parameters.
initia.ibchooks.v1.QueryACLResponse:
type: object
properties:
acl:
type: object
properties:
address:
type: string
allowed:
type: boolean
description: ACL defines the ACL entry of an address.
title: |-
QueryACLResponse is the response type for the Query/ACL RPC
method
initia.ibchooks.v1.QueryACLsResponse:
type: object
properties:
acls:
type: array
items:
type: object
properties:
address:
type: string
allowed:
type: boolean
description: ACL defines the ACL entry of an address.
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
title: |-
QueryACLsResponse is the response type for the
Query/ACLAddrs RPC method
initia.ibchooks.v1.QueryParamsResponse:
type: object
properties:
params:
description: params defines the parameters of the module.
type: object
properties:
default_allowed:
type: boolean
description: |-
if the ACL of a address is not set,
then we use this value to decide the ACL.
description: QueryParamsResponse is the response type for the Query/Params RPC method.
cosmos.base.v1beta1.DecCoin:
type: object
properties:
Expand Down
7 changes: 7 additions & 0 deletions cmd/minitiad/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/initia-labs/OPinit/contrib/launchtools/steps"
"github.com/initia-labs/initia/app/params"
minitiaapp "github.com/initia-labs/minievm/app"
"github.com/initia-labs/minievm/types"
)

// DefaultLaunchStepFactories is a list of default launch step factories.
Expand Down Expand Up @@ -50,6 +51,12 @@ func LaunchCommand(ac *appCreator, enc params.EncodingConfig, mbm module.BasicMa
return launchtools.LaunchCmd(
ac,
func(denom string) map[string]json.RawMessage {
// default denom in OPinit is "umin"
if denom == "umin" {
// convert to "GAS"
denom = types.BaseDenom
}

return minitiaapp.NewDefaultGenesisState(enc.Codec, mbm, denom)
},
DefaultLaunchStepFactories,
Expand Down
Loading
Loading