Skip to content

Commit 8430b5f

Browse files
authored
[cleanup] Remove ModuleAccess and views (#17141)
## Description - Removed `ModuleAccess` and `views`. Without scripts, they are largely useless ## Test plan - CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
1 parent 627a72a commit 8430b5f

File tree

125 files changed

+471
-1360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+471
-1360
lines changed

crates/bytecode-verifier-tests/src/unit_tests/control_flow_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use crate::support::dummy_procedure_module;
66
use move_binary_format::{
7-
access::ModuleAccess,
87
errors::PartialVMResult,
98
file_format::{Bytecode, CompiledModule, FunctionDefinitionIndex, TableIndex},
109
};

crates/invalid-mutations/src/bounds.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use move_binary_format::{
99
ModuleHandleIndex, SignatureIndex, StructDefinitionIndex, StructHandleIndex, TableIndex,
1010
},
1111
internals::ModuleIndex,
12-
views::{ModuleView, SignatureTokenView},
1312
IndexKind,
1413
};
1514
use move_core_types::vm_status::StatusCode;
@@ -324,19 +323,19 @@ impl ApplyOutOfBoundsContext {
324323

325324
/// Returns the indexes of locals signatures that contain struct handles inside them.
326325
fn sig_structs(module: &CompiledModule) -> impl Iterator<Item = (SignatureIndex, usize)> + '_ {
327-
let module_view = ModuleView::new(module);
328-
module_view
326+
module
329327
.signatures()
328+
.iter()
330329
.enumerate()
331330
.flat_map(|(idx, signature)| {
332331
let idx = SignatureIndex(idx as u16);
333-
Self::find_struct_tokens(signature.tokens(), move |arg_idx| (idx, arg_idx))
332+
Self::find_struct_tokens(&signature.0, move |arg_idx| (idx, arg_idx))
334333
})
335334
}
336335

337336
#[inline]
338337
fn find_struct_tokens<'b, F, T>(
339-
tokens: impl IntoIterator<Item = SignatureTokenView<'b, CompiledModule>> + 'b,
338+
tokens: impl IntoIterator<Item = &'b SignatureToken> + 'b,
340339
map_fn: F,
341340
) -> impl Iterator<Item = T> + 'b
342341
where
@@ -345,9 +344,7 @@ impl ApplyOutOfBoundsContext {
345344
tokens
346345
.into_iter()
347346
.enumerate()
348-
.filter_map(move |(arg_idx, token)| {
349-
struct_handle(token.signature_token()).map(|_| map_fn(arg_idx))
350-
})
347+
.filter_map(move |(arg_idx, token)| struct_handle(token).map(|_| map_fn(arg_idx)))
351348
}
352349
}
353350

crates/move-binary-format/src/access.rs

Lines changed: 0 additions & 259 deletions
This file was deleted.

crates/move-binary-format/src/binary_views.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
use crate::{
6-
access::ModuleAccess,
76
control_flow_graph::VMControlFlowGraph,
87
file_format::{AbilitySet, CodeUnit, FunctionDefinitionIndex, FunctionHandle, Signature},
98
CompiledModule,

crates/move-binary-format/src/check_bounds.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
use crate::{
6-
access::ModuleAccess,
76
errors::{
87
bounds_error, offset_out_of_bounds as offset_out_of_bounds_error, verification_error,
98
PartialVMError, PartialVMResult,

0 commit comments

Comments
 (0)