Skip to content

Commit

Permalink
Clean up TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgswords committed Jan 31, 2025
1 parent d4e3b06 commit 9730949
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ impl VMTestAdapter<InMemoryStorage> for InMemoryTestAdapter {
package: SerializedPackage,
) -> VMResult<(verif_ast::Package, MoveVM<'extensions>)> {
let Some(storage_id) = package.linkage_table.get(&runtime_id).cloned() else {
// TODO: VM error instead?
// NB: This is a panic because it means something went really wrong -- we should always
// panic if we expect a package to exist and it is not there.
panic!("Did not find runtime ID {runtime_id} in linkage context.");
};
assert_eq!(storage_id, package.storage_id);
Expand All @@ -140,7 +141,8 @@ impl VMTestAdapter<InMemoryStorage> for InMemoryTestAdapter {
package: verif_ast::Package,
) -> VMResult<()> {
let Some(storage_id) = package.linkage_table.get(&runtime_id).cloned() else {
// TODO: VM error instead?
// NB: This is a panic because it means something went really wrong -- we should always
// panic if we expect a package to exist and it is not there.
panic!("Did not find runtime ID {runtime_id} in linkage context.");
};
assert!(storage_id == package.storage_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use crate::shared::types::{PackageStorageId, RuntimePackageId};
pub struct LinkageContext {
// Linkage Table. This is a table indicating, for a given Address, how it should be linked.
// This is purely for versioning. Assume some Package P is published at V1 and V2 as:
// P V1 -> 0xCAFE
// P V2 -> 0xDEAD
// P V1 -> 0xCAFE
// P V2 -> 0xDEAD
// All calls to P in the root package will call 0xCAFE as the Runtime ID, but during loading
// and JIT compilation we need to rewrite these. The linkage table here will redirect 0xCAFE to
// 0xDEAD for this purpose.
Expand Down Expand Up @@ -88,7 +88,6 @@ impl LinkageContext {

/// Translate the runtime fully-qualified struct name to the on-chain `ModuleId` that originally
/// defined that type.
/// TODO: FIX THIS WHEN THE TYPE ORIGIN TABLE EXISTS
pub fn defining_module(
&self,
module_id: &ModuleId,
Expand Down

0 comments on commit 9730949

Please sign in to comment.