Skip to content

Commit 2148aea

Browse files
authored
Merge pull request #193 from wasmx/deployer-memory
Simplify create_memory_deployer
2 parents 28eb46f + 442bb2a commit 2148aea

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

libchisel/src/deployer.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,14 @@ fn create_memory_deployer(payload: &[u8]) -> Module {
155155
// Add default memory section
156156
.memory()
157157
.with_min(memory_initial)
158+
.with_data(0, payload.to_vec())
158159
.build()
159160
// Export memory
160161
.export()
161162
.field("memory")
162163
.internal()
163164
.memory(0)
164165
.build()
165-
// Add data section with payload
166-
.data()
167-
.offset(parity_wasm::elements::Instruction::I32Const(0))
168-
.value(payload.to_vec())
169-
.build()
170166
.build()
171167
}
172168

0 commit comments

Comments
 (0)