Skip to content

Commit 87d8060

Browse files
committed
skip printing the import name for MidenAbiImport component import
1 parent f29b611 commit 87d8060

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hir/src/component/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ impl formatter::PrettyPrint for ComponentImport {
8383
ComponentImport::MidenAbiImport(import) => import.function_ty.to_string(),
8484
};
8585
let name = match self {
86-
ComponentImport::CanonAbiImport(import) => import.interface_function.to_string(),
87-
ComponentImport::MidenAbiImport(_import) => "()".to_string(),
86+
ComponentImport::CanonAbiImport(import) => {
87+
format!(" {} ", import.interface_function)
88+
}
89+
ComponentImport::MidenAbiImport(_import) => "".to_string(),
8890
};
8991
let import = match self {
9092
ComponentImport::CanonAbiImport(_) => const_text("import (abi canon)"),
9193
ComponentImport::MidenAbiImport(_) => const_text("import (abi miden)"),
9294
};
9395
const_text("(")
9496
+ import
95-
+ const_text(" ")
9697
+ text(name)
97-
+ const_text(" ")
9898
+ const_text("(")
9999
+ const_text("digest")
100100
+ const_text(" ")

tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(component
22
;; Component Imports
3-
(lower (import (abi miden) () (digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (param i32) (param i32) (param i32) (param i32) (result i32 i32 i32 i32)))) (#miden:tx_kernel/account #add_asset)
4-
(lower (import (abi miden) () (digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (result i32)))) (#miden:tx_kernel/account #get_id)
5-
(lower (import (abi miden) () (digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (param i32) (result i32 i32)))) (#miden:tx_kernel/note #get_inputs)
3+
(lower (import (abi miden)(digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (param i32) (param i32) (param i32) (param i32) (result i32 i32 i32 i32)))) (#miden:tx_kernel/account #add_asset)
4+
(lower (import (abi miden)(digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (result i32)))) (#miden:tx_kernel/account #get_id)
5+
(lower (import (abi miden)(digest 0x0000000000000000000000000000000000000000000000000000000000000000) (type (func (param i32) (result i32 i32)))) (#miden:tx_kernel/note #get_inputs)
66

77
;; Modules
88
(module #miden_sdk_account_test.wasm

0 commit comments

Comments
 (0)