Skip to content

Commit abb7f0e

Browse files
authored
Merge pull request #2209 from CosmWasm/co/reflect-2-2
Enable `cosmwasm_2_2` for `ibc-reflect`
2 parents 6f700b0 + 9731358 commit abb7f0e

File tree

5 files changed

+396
-8
lines changed

5 files changed

+396
-8
lines changed

.circleci/config.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,8 @@ jobs:
579579
- restore_cache:
580580
keys:
581581
- cargocache-v2-contract_crypto_verify-rust:1.74-{{ checksum "Cargo.lock" }}
582-
# TODO: Enable this once 2.1 has been released to crates.io
583582
- check_contract:
584583
min_version: "2.1"
585-
skip_cosmwasm_check: true
586584
- save_cache:
587585
paths:
588586
- /usr/local/cargo/registry
@@ -665,10 +663,8 @@ jobs:
665663
- restore_cache:
666664
keys:
667665
- cargocache-v2-contract_ibc_callbacks-rust:1.74-{{ checksum "Cargo.lock" }}
668-
# TODO: Enable this once 2.1 has been released to crates.io
669666
- check_contract:
670667
min_version: "2.1"
671-
skip_cosmwasm_check: true
672668
- save_cache:
673669
paths:
674670
- /usr/local/cargo/registry
@@ -695,9 +691,9 @@ jobs:
695691
- restore_cache:
696692
keys:
697693
- cargocache-v2-contract_ibc_reflect-rust:1.74-{{ checksum "Cargo.lock" }}
698-
# TODO: Enable this once 2.1 has been released to crates.io
694+
# TODO: enable again once 2.2 is released
699695
- check_contract:
700-
min_version: "2.1"
696+
min_version: "2.2"
701697
skip_cosmwasm_check: true
702698
- save_cache:
703699
paths:
@@ -809,8 +805,10 @@ jobs:
809805
- restore_cache:
810806
keys:
811807
- cargocache-v2-contract_reflect-rust:1.74-{{ checksum "Cargo.lock" }}
808+
# TODO: enable again once 2.2 is released
812809
- check_contract:
813-
min_version: "2.0"
810+
min_version: "2.2"
811+
skip_cosmwasm_check: true
814812
- save_cache:
815813
paths:
816814
- /usr/local/cargo/registry

contracts/reflect/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cranelift = ["cosmwasm-vm/cranelift"]
3131

3232
[dependencies]
3333
cosmwasm-schema = { path = "../../packages/schema" }
34-
cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "staking", "stargate", "cosmwasm_2_0"] }
34+
cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "staking", "stargate", "cosmwasm_2_2"] }
3535
schemars = "0.8.12"
3636
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
3737
thiserror = "1.0.26"

contracts/reflect/schema/raw/execute.json

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,47 @@
476476
}
477477
]
478478
},
479+
"IbcAcknowledgement": {
480+
"type": "object",
481+
"required": [
482+
"data"
483+
],
484+
"properties": {
485+
"data": {
486+
"$ref": "#/definitions/Binary"
487+
}
488+
},
489+
"additionalProperties": false
490+
},
491+
"IbcFee": {
492+
"type": "object",
493+
"required": [
494+
"ack_fee",
495+
"receive_fee",
496+
"timeout_fee"
497+
],
498+
"properties": {
499+
"ack_fee": {
500+
"type": "array",
501+
"items": {
502+
"$ref": "#/definitions/Coin"
503+
}
504+
},
505+
"receive_fee": {
506+
"type": "array",
507+
"items": {
508+
"$ref": "#/definitions/Coin"
509+
}
510+
},
511+
"timeout_fee": {
512+
"type": "array",
513+
"items": {
514+
"$ref": "#/definitions/Coin"
515+
}
516+
}
517+
},
518+
"additionalProperties": false
519+
},
479520
"IbcMsg": {
480521
"description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)",
481522
"oneOf": [
@@ -567,6 +608,45 @@
567608
},
568609
"additionalProperties": false
569610
},
611+
{
612+
"description": "Acknowledges a packet that this contract received over IBC. This allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call.",
613+
"type": "object",
614+
"required": [
615+
"write_acknowledgement"
616+
],
617+
"properties": {
618+
"write_acknowledgement": {
619+
"type": "object",
620+
"required": [
621+
"ack",
622+
"channel_id",
623+
"packet_sequence"
624+
],
625+
"properties": {
626+
"ack": {
627+
"description": "The acknowledgement to send back",
628+
"allOf": [
629+
{
630+
"$ref": "#/definitions/IbcAcknowledgement"
631+
}
632+
]
633+
},
634+
"channel_id": {
635+
"description": "Existing channel where the packet was received",
636+
"type": "string"
637+
},
638+
"packet_sequence": {
639+
"description": "Sequence number of the packet that was received",
640+
"type": "integer",
641+
"format": "uint64",
642+
"minimum": 0.0
643+
}
644+
},
645+
"additionalProperties": false
646+
}
647+
},
648+
"additionalProperties": false
649+
},
570650
{
571651
"description": "This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port",
572652
"type": "object",
@@ -588,6 +668,93 @@
588668
}
589669
},
590670
"additionalProperties": false
671+
},
672+
{
673+
"description": "Incentivizes the next IBC packet sent after this message with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled.\n\n# Example\n\nMost commonly, you will attach this message to a response right before sending a packet using [`IbcMsg::SendPacket`] or [`IbcMsg::Transfer`].\n\n```rust # use cosmwasm_std::{IbcMsg, IbcEndpoint, IbcFee, IbcTimeout, Coin, coins, CosmosMsg, Response, Timestamp};\n\nlet incentivize = IbcMsg::PayPacketFee { port_id: \"transfer\".to_string(), channel_id: \"source-channel\".to_string(), fee: IbcFee { receive_fee: coins(100, \"token\"), ack_fee: coins(201, \"token\"), timeout_fee: coins(200, \"token\"), }, relayers: vec![], }; let transfer = IbcMsg::Transfer { channel_id: \"source-channel\".to_string(), to_address: \"receiver\".to_string(), amount: Coin::new(100u32, \"token\"), timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(0)), memo: None, };\n\n# #[cfg(feature = \"stargate\")] let _: Response = Response::new() .add_message(CosmosMsg::Ibc(incentivize)) .add_message(CosmosMsg::Ibc(transfer)); ```",
674+
"type": "object",
675+
"required": [
676+
"pay_packet_fee"
677+
],
678+
"properties": {
679+
"pay_packet_fee": {
680+
"type": "object",
681+
"required": [
682+
"channel_id",
683+
"fee",
684+
"port_id",
685+
"relayers"
686+
],
687+
"properties": {
688+
"channel_id": {
689+
"description": "The channel id on the chain where the packet is sent from (this chain).",
690+
"type": "string"
691+
},
692+
"fee": {
693+
"$ref": "#/definitions/IbcFee"
694+
},
695+
"port_id": {
696+
"description": "The port id on the chain where the packet is sent from (this chain).",
697+
"type": "string"
698+
},
699+
"relayers": {
700+
"description": "Allowlist of relayer addresses that can receive the fee. An empty list means that any relayer can receive the fee.\n\nThis is currently not implemented and *must* be empty.",
701+
"type": "array",
702+
"items": {
703+
"type": "string"
704+
}
705+
}
706+
},
707+
"additionalProperties": false
708+
}
709+
},
710+
"additionalProperties": false
711+
},
712+
{
713+
"description": "Incentivizes the existing IBC packet with the given port, channel and sequence with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled. They are added to the existing fees on the packet.",
714+
"type": "object",
715+
"required": [
716+
"pay_packet_fee_async"
717+
],
718+
"properties": {
719+
"pay_packet_fee_async": {
720+
"type": "object",
721+
"required": [
722+
"channel_id",
723+
"fee",
724+
"port_id",
725+
"relayers",
726+
"sequence"
727+
],
728+
"properties": {
729+
"channel_id": {
730+
"description": "The channel id on the chain where the packet is sent from (this chain).",
731+
"type": "string"
732+
},
733+
"fee": {
734+
"$ref": "#/definitions/IbcFee"
735+
},
736+
"port_id": {
737+
"description": "The port id on the chain where the packet is sent from (this chain).",
738+
"type": "string"
739+
},
740+
"relayers": {
741+
"description": "Allowlist of relayer addresses that can receive the fee. An empty list means that any relayer can receive the fee.\n\nThis is currently not implemented and *must* be empty.",
742+
"type": "array",
743+
"items": {
744+
"type": "string"
745+
}
746+
},
747+
"sequence": {
748+
"description": "The sequence number of the packet that should be incentivized.",
749+
"type": "integer",
750+
"format": "uint64",
751+
"minimum": 0.0
752+
}
753+
},
754+
"additionalProperties": false
755+
}
756+
},
757+
"additionalProperties": false
591758
}
592759
]
593760
},

contracts/reflect/schema/raw/query.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,34 @@
422422
}
423423
},
424424
"additionalProperties": false
425+
},
426+
{
427+
"description": "Queries whether the given channel supports IBC fees. If port_id is omitted, it will default to the contract's own channel. (To save a PortId{} call)\n\nReturns a `FeeEnabledChannelResponse`.",
428+
"type": "object",
429+
"required": [
430+
"fee_enabled_channel"
431+
],
432+
"properties": {
433+
"fee_enabled_channel": {
434+
"type": "object",
435+
"required": [
436+
"channel_id"
437+
],
438+
"properties": {
439+
"channel_id": {
440+
"type": "string"
441+
},
442+
"port_id": {
443+
"type": [
444+
"string",
445+
"null"
446+
]
447+
}
448+
},
449+
"additionalProperties": false
450+
}
451+
},
452+
"additionalProperties": false
425453
}
426454
]
427455
},

0 commit comments

Comments
 (0)