Skip to content

Commit 8d12645

Browse files
committed
Rename ibcv2 to ibc2
1 parent 036107b commit 8d12645

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
- run:
172172
name: "contracts/ibc2: integration-test"
173173
working_directory: ~/project/contracts/ibc2
174-
command: cargo wasm --locked
174+
command: cargo wasm --locked && cargo integration-test --locked
175175
- run:
176176
name: "contracts/queue: integration-test"
177177
working_directory: ~/project/contracts/queue

packages/vm/src/cache.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ use crate::instance::{Instance, InstanceOptions};
1919
use crate::modules::{CachedModule, FileSystemCache, InMemoryCache, PinnedMemoryCache};
2020
use crate::parsed_wasm::ParsedWasm;
2121
use crate::size::Size;
22-
use crate::static_analysis::{
23-
Entrypoint, ExportInfo, REQUIRED_IBC_EXPORTS, REQUIRED_IBC_V2_EXPORT,
24-
};
22+
use crate::static_analysis::{Entrypoint, ExportInfo, REQUIRED_IBC2_EXPORT, REQUIRED_IBC_EXPORTS};
2523
use crate::wasm_backend::{compile, make_compiling_engine};
2624

2725
const STATE_DIR: &str = "state";
@@ -102,9 +100,9 @@ pub struct AnalysisReport {
102100
/// `true` if and only if all [`REQUIRED_IBC_EXPORTS`] exist as exported functions.
103101
/// This does not guarantee they are functional or even have the correct signatures.
104102
pub has_ibc_entry_points: bool,
105-
/// `true` if and only if all [`REQUIRED_IBC_V2_EXPORT`] exist as exported functions.
103+
/// `true` if and only if all [`REQUIRED_IBC2_EXPORT`] exist as exported functions.
106104
/// This does not guarantee they are functional or even have the correct signatures.
107-
pub has_ibc_v2_entry_points: bool,
105+
pub has_ibc2_entry_points: bool,
108106
/// A set of all entrypoints that are exported by the contract.
109107
pub entrypoints: BTreeSet<Entrypoint>,
110108
/// The set of capabilities the contract requires.
@@ -342,7 +340,7 @@ where
342340
has_ibc_entry_points: REQUIRED_IBC_EXPORTS
343341
.iter()
344342
.all(|required| exports.contains(required.as_ref())),
345-
has_ibc_v2_entry_points: exports.contains(REQUIRED_IBC_V2_EXPORT.as_ref()),
343+
has_ibc2_entry_points: exports.contains(REQUIRED_IBC2_EXPORT.as_ref()),
346344
entrypoints,
347345
required_capabilities: required_capabilities_from_module(&module)
348346
.into_iter()
@@ -630,7 +628,7 @@ mod tests {
630628

631629
static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm");
632630
static IBC_CONTRACT: &[u8] = include_bytes!("../testdata/ibc_reflect.wasm");
633-
static IBC_V2_CONTRACT: &[u8] = include_bytes!("../testdata/ibcv2.wasm");
631+
static IBC2_CONTRACT: &[u8] = include_bytes!("../testdata/ibc2.wasm");
634632
static EMPTY_CONTRACT: &[u8] = include_bytes!("../testdata/empty.wasm");
635633
// Invalid because it doesn't contain required memory and exports
636634
static INVALID_CONTRACT_WAT: &str = r#"(module
@@ -665,9 +663,9 @@ mod tests {
665663
}
666664
}
667665

668-
fn make_ibc_v2_testing_options() -> CacheOptions {
666+
fn make_ibc2_testing_options() -> CacheOptions {
669667
let mut capabilities = default_capabilities();
670-
capabilities.insert("ibcv2".into());
668+
capabilities.insert("ibc2".into());
671669
CacheOptions {
672670
base_dir: TempDir::new().unwrap().into_path(),
673671
available_capabilities: capabilities,
@@ -1462,7 +1460,7 @@ mod tests {
14621460
report1,
14631461
AnalysisReport {
14641462
has_ibc_entry_points: false,
1465-
has_ibc_v2_entry_points: false,
1463+
has_ibc2_entry_points: false,
14661464
entrypoints: BTreeSet::from([
14671465
E::Instantiate,
14681466
E::Migrate,
@@ -1484,7 +1482,7 @@ mod tests {
14841482
report2,
14851483
AnalysisReport {
14861484
has_ibc_entry_points: true,
1487-
has_ibc_v2_entry_points: false,
1485+
has_ibc2_entry_points: false,
14881486
entrypoints: ibc_contract_entrypoints,
14891487
required_capabilities: BTreeSet::from_iter([
14901488
"iterator".to_string(),
@@ -1500,7 +1498,7 @@ mod tests {
15001498
report3,
15011499
AnalysisReport {
15021500
has_ibc_entry_points: false,
1503-
has_ibc_v2_entry_points: false,
1501+
has_ibc2_entry_points: false,
15041502
entrypoints: BTreeSet::new(),
15051503
required_capabilities: BTreeSet::from(["iterator".to_string()]),
15061504
contract_migrate_version: None,
@@ -1520,28 +1518,28 @@ mod tests {
15201518
report4,
15211519
AnalysisReport {
15221520
has_ibc_entry_points: false,
1523-
has_ibc_v2_entry_points: false,
1521+
has_ibc2_entry_points: false,
15241522
entrypoints: BTreeSet::new(),
15251523
required_capabilities: BTreeSet::from(["iterator".to_string()]),
15261524
contract_migrate_version: Some(21),
15271525
}
15281526
);
15291527

15301528
let cache: Cache<MockApi, MockStorage, MockQuerier> =
1531-
unsafe { Cache::new(make_ibc_v2_testing_options()).unwrap() };
1532-
let checksum5 = cache.store_code(IBC_V2_CONTRACT, true, true).unwrap();
1529+
unsafe { Cache::new(make_ibc2_testing_options()).unwrap() };
1530+
let checksum5 = cache.store_code(IBC2_CONTRACT, true, true).unwrap();
15331531
let report5 = cache.analyze(&checksum5).unwrap();
1534-
let mut ibc_v2_contract_entrypoints = BTreeSet::from([E::Instantiate, E::Query]);
1535-
ibc_v2_contract_entrypoints.extend([REQUIRED_IBC_V2_EXPORT]);
1532+
let mut ibc2_contract_entrypoints = BTreeSet::from([E::Instantiate, E::Query]);
1533+
ibc2_contract_entrypoints.extend([REQUIRED_IBC2_EXPORT]);
15361534
assert_eq!(
15371535
report5,
15381536
AnalysisReport {
15391537
has_ibc_entry_points: false,
1540-
has_ibc_v2_entry_points: true,
1541-
entrypoints: ibc_v2_contract_entrypoints,
1538+
has_ibc2_entry_points: true,
1539+
entrypoints: ibc2_contract_entrypoints,
15421540
required_capabilities: BTreeSet::from_iter([
15431541
"iterator".to_string(),
1544-
"ibcv2".to_string()
1542+
"ibc2".to_string()
15451543
]),
15461544
contract_migrate_version: None,
15471545
}

packages/vm/src/static_analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub const REQUIRED_IBC_EXPORTS: &[Entrypoint] = &[
5858
Entrypoint::IbcPacketTimeout,
5959
];
6060

61-
pub const REQUIRED_IBC_V2_EXPORT: &Entrypoint = &Entrypoint::IBCv2PacketReceive;
61+
pub const REQUIRED_IBC2_EXPORT: &Entrypoint = &Entrypoint::Ibc2PacketReceive;
6262

6363
/// A trait that allows accessing shared functionality of `parity_wasm::elements::Module`
6464
/// and `wasmer::Module` in a shared fashion.

packages/vm/testdata/ibcv2.wasm

-183 KB
Binary file not shown.

0 commit comments

Comments
 (0)