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

fix: nft transfer packet spec #339

Merged
merged 4 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 8 additions & 3 deletions app/ante/sigverify/sigverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/initia-labs/initia/crypto/ethsecp256k1"

forwardingtypes "github.com/noble-assets/forwarding/v2/types"
)

var (
Expand Down Expand Up @@ -169,19 +171,22 @@ func DefaultSigVerificationGasConsumer(
if !ok {
return fmt.Errorf("expected %T, got, %T", &signing.MultiSignatureData{}, sig.Data)
}
err := consumeMultisignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence)
err := consumeMultiSignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence)
if err != nil {
return err
}
return nil

case *forwardingtypes.ForwardingPubKey:
return nil

default:
return errorsmod.Wrapf(sdkerrors.ErrInvalidPubKey, "unrecognized public key type: %T", pubkey)
}
}

// consumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature
func consumeMultisignatureVerificationGas(
// consumeMultiSignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature
func consumeMultiSignatureVerificationGas(
meter storetypes.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey,
params types.Params, accSeq uint64,
) error {
Expand Down
8 changes: 4 additions & 4 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ import (
ophosttypeshook "github.com/initia-labs/OPinit/x/ophost/types/hook"

// noble forwarding keeper
"github.com/noble-assets/forwarding/v2/x/forwarding"
forwardingkeeper "github.com/noble-assets/forwarding/v2/x/forwarding/keeper"
forwardingtypes "github.com/noble-assets/forwarding/v2/x/forwarding/types"
forwarding "github.com/noble-assets/forwarding/v2"
forwardingkeeper "github.com/noble-assets/forwarding/v2/keeper"
forwardingtypes "github.com/noble-assets/forwarding/v2/types"
)

type AppKeepers struct {
Expand Down Expand Up @@ -641,7 +641,7 @@ func NewAppKeeper(
Response: &stakingtypes.QueryRedelegationsResponse{},
}
queryWhitelist.Stargate["/connect.oracle.v2.Query/GetAllCurrencyPairs"] = movetypes.ProtoSet{
Request: &oracletypes.GetAllCurrencyPairsResponse{},
Request: &oracletypes.GetAllCurrencyPairsRequest{},
Response: &oracletypes.GetAllCurrencyPairsResponse{},
}
queryWhitelist.Stargate["/connect.oracle.v2.Query/GetPrice"] = movetypes.ProtoSet{
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
oracletypes "github.com/skip-mev/connect/v2/x/oracle/types"

// noble forwarding keeper
forwardingtypes "github.com/noble-assets/forwarding/v2/x/forwarding/types"
forwardingtypes "github.com/noble-assets/forwarding/v2/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down
4 changes: 2 additions & 2 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ import (
ophosttypes "github.com/initia-labs/OPinit/x/ophost/types"

// noble forwarding keeper
"github.com/noble-assets/forwarding/v2/x/forwarding"
forwardingtypes "github.com/noble-assets/forwarding/v2/x/forwarding/types"
forwarding "github.com/noble-assets/forwarding/v2"
forwardingtypes "github.com/noble-assets/forwarding/v2/types"
)

var maccPerms = map[string][]string{
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12102,7 +12102,7 @@ paths:
vetoed. Default value: 1/3.
params:
description: |-
params defines all the parameters of x/gov module.
params defines all the paramaters of x/gov module.

Since: cosmos-sdk 0.47
type: object
Expand Down Expand Up @@ -20343,7 +20343,7 @@ paths:
- Query
/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}:
get:
summary: Allowance returns granted allowance to the grantee by the granter.
summary: Allowance returns granted allwance to the grantee by the granter.
operationId: Allowance
responses:
'200':
Expand Down Expand Up @@ -34969,7 +34969,7 @@ paths:
format: uint64
- name: latest_height
description: >-
latest_height overrides the height field and queries the latest
latest_height overrrides the height field and queries the latest
stored

ConsensusState.
Expand Down Expand Up @@ -36564,7 +36564,7 @@ paths:
identifier
description: >-
Version defines the versioning scheme used to
negotiate the IBC version in
negotiate the IBC verison in

the connection handshake.
title: >-
Expand Down Expand Up @@ -36973,7 +36973,7 @@ paths:
identifier
description: >-
Version defines the versioning scheme used to negotiate
the IBC version in
the IBC verison in

the connection handshake.
description: >-
Expand Down Expand Up @@ -39009,7 +39009,7 @@ paths:
type: string
tags:
- Query
/ibc/apps/nft_transfer/v1/class_hashs/{trace}:
/ibc/apps/nft_transfer/v1/class_hashes/{trace}:
get:
summary: ClassHash queries a class id hash information.
operationId: ClassHash
Expand Down Expand Up @@ -52928,10 +52928,10 @@ paths:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
submission_interval:
type: string
description: >-
Expand Down Expand Up @@ -53100,10 +53100,10 @@ paths:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
submission_interval:
type: string
description: >-
Expand Down Expand Up @@ -53186,10 +53186,10 @@ paths:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
description: BatchInfo defines the set of batch information.
output:
type: object
Expand Down Expand Up @@ -65859,7 +65859,7 @@ definitions:
vetoed. Default value: 1/3.
params:
description: |-
params defines all the parameters of x/gov module.
params defines all the paramaters of x/gov module.

Since: cosmos-sdk 0.47
type: object
Expand Down Expand Up @@ -68743,7 +68743,7 @@ definitions:
gas to be used by the transaction. The ratio yields an effective
"gasprice",

which must be above some minimum to be accepted into the mempool.
which must be above some miminum to be accepted into the mempool.
cosmos.tx.v1beta1.GetBlockWithTxsResponse:
type: object
properties:
Expand Down Expand Up @@ -79635,7 +79635,7 @@ definitions:
title: list of features compatible with the specified identifier
description: >-
Version defines the versioning scheme used to negotiate the IBC
version in
verison in

the connection handshake.
description: >-
Expand Down Expand Up @@ -79757,7 +79757,7 @@ definitions:
title: list of features compatible with the specified identifier
description: >-
Version defines the versioning scheme used to negotiate the IBC
version in
verison in

the connection handshake.
title: >-
Expand Down Expand Up @@ -80342,7 +80342,7 @@ definitions:
title: list of features compatible with the specified identifier
description: >-
Version defines the versioning scheme used to negotiate the IBC
version in
verison in

the connection handshake.
description: >-
Expand Down Expand Up @@ -80479,7 +80479,7 @@ definitions:
title: list of features compatible with the specified identifier
description: >-
Version defines the versioning scheme used to negotiate the
IBC version in
IBC verison in

the connection handshake.
title: >-
Expand Down Expand Up @@ -80625,7 +80625,7 @@ definitions:
type: string
title: list of features compatible with the specified identifier
description: |-
Version defines the versioning scheme used to negotiate the IBC version in
Version defines the versioning scheme used to negotiate the IBC verison in
the connection handshake.
ibc.applications.transfer.v1.DenomTrace:
type: object
Expand Down Expand Up @@ -81747,7 +81747,7 @@ definitions:
format: uint64
title: packet sequence
title: |-
PacketId is an identifier for a unique Packet
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
ibc.applications.perm.v1.ChannelState:
Expand Down Expand Up @@ -88350,24 +88350,24 @@ definitions:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
description: BatchInfo defines the set of batch information.
opinit.ophost.v1.BatchInfo.ChainType:
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
description: |-
ChainType defines the type of chain.

- CHAIN_TYPE_UNSPECIFIED: Unspecified chain type.
- CHAIN_TYPE_INITIA: The chain type of the initia chain.
- CHAIN_TYPE_CELESTIA: The chain type of the celestia chain.
- UNSPECIFIED: Unspecified chain type.
- INITIA: The chain type of the initia chain.
- CELESTIA: The chain type of the celestia chain.
opinit.ophost.v1.BatchInfoWithOutput:
type: object
properties:
Expand All @@ -88381,10 +88381,10 @@ definitions:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
description: BatchInfo defines the set of batch information.
output:
type: object
Expand Down Expand Up @@ -88427,10 +88427,10 @@ definitions:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
submission_interval:
type: string
description: >-
Expand Down Expand Up @@ -88512,10 +88512,10 @@ definitions:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
description: BatchInfo defines the set of batch information.
output:
type: object
Expand Down Expand Up @@ -88588,10 +88588,10 @@ definitions:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
submission_interval:
type: string
description: >-
Expand Down Expand Up @@ -88650,10 +88650,10 @@ definitions:
description: The target chain type.
type: string
enum:
- CHAIN_TYPE_UNSPECIFIED
- CHAIN_TYPE_INITIA
- CHAIN_TYPE_CELESTIA
default: CHAIN_TYPE_UNSPECIFIED
- UNSPECIFIED
- INITIA
- CELESTIA
default: UNSPECIFIED
submission_interval:
type: string
description: >-
Expand Down
1 change: 1 addition & 0 deletions cmd/initiad/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func initAppConfig() (string, interface{}) {
srvCfg.MinGasPrices = fmt.Sprintf("0%s", initiaapp.BondDenom)
srvCfg.Mempool.MaxTxs = 2000
srvCfg.QueryGasLimit = 3000000
srvCfg.InterBlockCache = false

appConfig := initiaappConfig{
Config: *srvCfg,
Expand Down
Loading
Loading