Skip to content

Commit

Permalink
Clean up TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgswords committed Feb 1, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9c1da9b commit 87b80cc
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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);
@@ -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);
Original file line number Diff line number Diff line change
@@ -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.
@@ -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,

0 comments on commit 87b80cc

Please sign in to comment.