Skip to content

Commit 7d971ce

Browse files
committed
fix: correct element indices and update wrapper version prefix
Update the indices for specific OutputNullGetBytes elements to ensure proper alignment. Adjust the script to remove unnecessary sed command for renaming prefixes in Rust files and simplify it by focusing on updating the version prefix in the header file.
1 parent f891116 commit 7d971ce

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/jet/init/elements.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4815,9 +4815,9 @@ impl Jet for Elements {
48154815
Elements::OutputNullGetBytes1 => (462387, 19),
48164816
Elements::OutputNullGetBytes2 => (462388, 19),
48174817
Elements::OutputNullGetBytes4 => (462389, 19),
4818-
Elements::OutputNullGetBytes16 => (462390, 19),
4819-
Elements::OutputNullGetBytes32 => (462391, 19),
4820-
Elements::OutputNullGetBytes64 => (462392, 19),
4818+
Elements::OutputNullGetBytes16 => (462391, 19),
4819+
Elements::OutputNullGetBytes32 => (462392, 19),
4820+
Elements::OutputNullGetBytes64 => (462393, 19),
48214821
};
48224822

48234823
w.write_bits_be(n, len)
@@ -7457,16 +7457,16 @@ impl Jet for Elements {
74577457
1 => {Elements::OutputNullGetBytes4}
74587458
},
74597459
1 => {
7460-
0 => {Elements::OutputNullGetBytes16},
7461-
1 => {Elements::OutputNullGetBytes32}
7460+
0 => {},
7461+
1 => {Elements::OutputNullGetBytes16}
74627462
}
74637463
}
74647464
},
74657465
1 => {
74667466
0 => {
74677467
0 => {
7468-
0 => {Elements::OutputNullGetBytes64},
7469-
1 => {}
7468+
0 => {Elements::OutputNullGetBytes32},
7469+
1 => {Elements::OutputNullGetBytes64}
74707470
},
74717471
1 => {}
74727472
},

update_jets.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ mv "${C_DIR}/jets_ffi.rs" "./simplicity-sys/src/c_jets/jets_ffi.rs"
3737
mv "${C_DIR}/jets_wrapper.rs" "./simplicity-sys/src/c_jets/jets_wrapper.rs"
3838
mv "${C_DIR}/jets_wrapper.c" "./simplicity-sys/depend/jets_wrapper.c"
3939

40-
# Tweak the c_ prefixes in the wrappers
41-
sed -i -r "s/\"c_/\"rustsimplicity_${SIMPLICITY_ALLOC_VERSION_CODE}_c_/" \
42-
"./simplicity-sys/src/c_jets/jets_ffi.rs"
40+
# Update version prefix in wrapper.h if the version changed
4341
sed -i -r "s/ rustsimplicity_[0-9]+_[0-9]+_/ rustsimplicity_${SIMPLICITY_ALLOC_VERSION_CODE}_/" \
4442
"./simplicity-sys/depend/wrapper.h"
4543

0 commit comments

Comments
 (0)