@@ -19,9 +19,7 @@ use crate::instance::{Instance, InstanceOptions};
19
19
use crate :: modules:: { CachedModule , FileSystemCache , InMemoryCache , PinnedMemoryCache } ;
20
20
use crate :: parsed_wasm:: ParsedWasm ;
21
21
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 } ;
25
23
use crate :: wasm_backend:: { compile, make_compiling_engine} ;
26
24
27
25
const STATE_DIR : & str = "state" ;
@@ -102,9 +100,9 @@ pub struct AnalysisReport {
102
100
/// `true` if and only if all [`REQUIRED_IBC_EXPORTS`] exist as exported functions.
103
101
/// This does not guarantee they are functional or even have the correct signatures.
104
102
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.
106
104
/// 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 ,
108
106
/// A set of all entrypoints that are exported by the contract.
109
107
pub entrypoints : BTreeSet < Entrypoint > ,
110
108
/// The set of capabilities the contract requires.
@@ -342,7 +340,7 @@ where
342
340
has_ibc_entry_points : REQUIRED_IBC_EXPORTS
343
341
. iter ( )
344
342
. 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 ( ) ) ,
346
344
entrypoints,
347
345
required_capabilities : required_capabilities_from_module ( & module)
348
346
. into_iter ( )
@@ -630,7 +628,7 @@ mod tests {
630
628
631
629
static CONTRACT : & [ u8 ] = include_bytes ! ( "../testdata/hackatom.wasm" ) ;
632
630
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" ) ;
634
632
static EMPTY_CONTRACT : & [ u8 ] = include_bytes ! ( "../testdata/empty.wasm" ) ;
635
633
// Invalid because it doesn't contain required memory and exports
636
634
static INVALID_CONTRACT_WAT : & str = r#"(module
@@ -665,9 +663,9 @@ mod tests {
665
663
}
666
664
}
667
665
668
- fn make_ibc_v2_testing_options ( ) -> CacheOptions {
666
+ fn make_ibc2_testing_options ( ) -> CacheOptions {
669
667
let mut capabilities = default_capabilities ( ) ;
670
- capabilities. insert ( "ibcv2 " . into ( ) ) ;
668
+ capabilities. insert ( "ibc2 " . into ( ) ) ;
671
669
CacheOptions {
672
670
base_dir : TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
673
671
available_capabilities : capabilities,
@@ -1462,7 +1460,7 @@ mod tests {
1462
1460
report1,
1463
1461
AnalysisReport {
1464
1462
has_ibc_entry_points: false ,
1465
- has_ibc_v2_entry_points : false ,
1463
+ has_ibc2_entry_points : false ,
1466
1464
entrypoints: BTreeSet :: from( [
1467
1465
E :: Instantiate ,
1468
1466
E :: Migrate ,
@@ -1484,7 +1482,7 @@ mod tests {
1484
1482
report2,
1485
1483
AnalysisReport {
1486
1484
has_ibc_entry_points: true ,
1487
- has_ibc_v2_entry_points : false ,
1485
+ has_ibc2_entry_points : false ,
1488
1486
entrypoints: ibc_contract_entrypoints,
1489
1487
required_capabilities: BTreeSet :: from_iter( [
1490
1488
"iterator" . to_string( ) ,
@@ -1500,7 +1498,7 @@ mod tests {
1500
1498
report3,
1501
1499
AnalysisReport {
1502
1500
has_ibc_entry_points: false ,
1503
- has_ibc_v2_entry_points : false ,
1501
+ has_ibc2_entry_points : false ,
1504
1502
entrypoints: BTreeSet :: new( ) ,
1505
1503
required_capabilities: BTreeSet :: from( [ "iterator" . to_string( ) ] ) ,
1506
1504
contract_migrate_version: None ,
@@ -1520,28 +1518,28 @@ mod tests {
1520
1518
report4,
1521
1519
AnalysisReport {
1522
1520
has_ibc_entry_points: false ,
1523
- has_ibc_v2_entry_points : false ,
1521
+ has_ibc2_entry_points : false ,
1524
1522
entrypoints: BTreeSet :: new( ) ,
1525
1523
required_capabilities: BTreeSet :: from( [ "iterator" . to_string( ) ] ) ,
1526
1524
contract_migrate_version: Some ( 21 ) ,
1527
1525
}
1528
1526
) ;
1529
1527
1530
1528
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 ( ) ;
1533
1531
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 ] ) ;
1536
1534
assert_eq ! (
1537
1535
report5,
1538
1536
AnalysisReport {
1539
1537
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 ,
1542
1540
required_capabilities: BTreeSet :: from_iter( [
1543
1541
"iterator" . to_string( ) ,
1544
- "ibcv2 " . to_string( )
1542
+ "ibc2 " . to_string( )
1545
1543
] ) ,
1546
1544
contract_migrate_version: None ,
1547
1545
}
0 commit comments