Skip to content

Commit 4b5c926

Browse files
author
Ritik
authored
Merge branch 'master' into docs/add-state-clear-intrinsic
2 parents f68ab8e + f635cc2 commit 4b5c926

File tree

63 files changed

+1262
-862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1262
-862
lines changed

Cargo.lock

Lines changed: 1 addition & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ mark-flaky-tests = "1.0"
180180
mdbook = { version = "0.4", default-features = false }
181181
minifier = "0.3"
182182
normalize-path = "0.2"
183-
notify = "6.1"
184-
notify-debouncer-mini = "0.4"
185183
num-bigint = { version = "0.4", features = ["serde"] }
186184
num-traits = "0.2"
187185
object = "0.36"

forc-plugins/forc-client/tests/deploy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ async fn test_simple_deploy() {
377377
node.kill().unwrap();
378378
let expected = vec![DeployedPackage::Contract(DeployedContract {
379379
id: ContractId::from_str(
380-
"57a5ac7d952df0dd7e72812509fd373260bee5dac54cca48c4d0b2841e9bcee3",
380+
"7338571226a3a07d411acc73bf31821d7315365e3e04e309f5055f0b567431fb",
381381
)
382382
.unwrap(),
383383
proxy: None,
@@ -421,7 +421,7 @@ async fn test_deploy_submit_only() {
421421
node.kill().unwrap();
422422
let expected = vec![DeployedPackage::Contract(DeployedContract {
423423
id: ContractId::from_str(
424-
"57a5ac7d952df0dd7e72812509fd373260bee5dac54cca48c4d0b2841e9bcee3",
424+
"7338571226a3a07d411acc73bf31821d7315365e3e04e309f5055f0b567431fb",
425425
)
426426
.unwrap(),
427427
proxy: None,
@@ -468,12 +468,12 @@ async fn test_deploy_fresh_proxy() {
468468
node.kill().unwrap();
469469
let impl_contract = DeployedPackage::Contract(DeployedContract {
470470
id: ContractId::from_str(
471-
"57a5ac7d952df0dd7e72812509fd373260bee5dac54cca48c4d0b2841e9bcee3",
471+
"7338571226a3a07d411acc73bf31821d7315365e3e04e309f5055f0b567431fb",
472472
)
473473
.unwrap(),
474474
proxy: Some(
475475
ContractId::from_str(
476-
"b8588024c0581f715d79c4f5ebd0b9e07f4ed0028f4da4fcf245ec09e1400982",
476+
"2d4f046d31ee52218c189d0c4f30ac74490ab73b0747b4b95908b1ca7f7f7976",
477477
)
478478
.unwrap(),
479479
),

forc-plugins/forc-debug/tests/server_integration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ fn test_sourcemap_build() {
315315
// Verify essential source locations are mapped correctly
316316
let key_locations = [
317317
// Main function and its contents
318-
(3, 4, "main function parameters"), // Should have 4 instructions
318+
(3, 2, "main function parameters"), // Should have 2 instructions
319319
(4, 2, "addition operation"), // Should have 2 instructions (add operation)
320320
// Helper function and its contents
321-
(11, 4, "helper function parameters"), // Should have 4 instructions
321+
(11, 2, "helper function parameters"), // Should have 2 instructions
322322
(12, 2, "helper addition operation"), // Should have 2 instructions
323323
// Test functions (identical patterns)
324324
(21, 1, "test_1 first line"), // Each test line should have

forc/tests/cli_integration.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ fn test_forc_test_raw_logs() -> Result<(), rexpect::error::Error> {
4949
// Assert that the output is correct
5050
process.exp_string(" test test_log_4")?;
5151
process.exp_string("Raw logs:")?;
52-
process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12384,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
52+
process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12300,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
5353
process.exp_string(" test test_log_2")?;
5454
process.exp_string("Raw logs:")?;
55-
process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12384,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
55+
process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12300,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
5656

5757
process.process.exit()?;
5858
Ok(())
@@ -74,11 +74,11 @@ fn test_forc_test_both_logs() -> Result<(), rexpect::error::Error> {
7474
process.exp_string(" test test_log_4")?;
7575
process.exp_string("Decoded log value: 4, log rb: 1515152261580153489")?;
7676
process.exp_string("Raw logs:")?;
77-
process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12384,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
77+
process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12300,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
7878
process.exp_string(" test test_log_2")?;
7979
process.exp_string("Decoded log value: 2, log rb: 1515152261580153489")?;
8080
process.exp_string("Raw logs:")?;
81-
process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12384,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
81+
process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12300,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?;
8282
process.process.exit()?;
8383
Ok(())
8484
}

sway-core/src/asm_generation/finalized_asm.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::{
44
ProgramABI, ProgramKind,
55
};
66
use crate::asm_generation::fuel::data_section::{Datum, Entry, EntryName};
7-
use crate::asm_lang::allocated_ops::{AllocatedOp, AllocatedOpcode, FuelAsmData};
7+
use crate::asm_lang::allocated_ops::{AllocatedInstruction, AllocatedOp, FuelAsmData};
88
use crate::decl_engine::DeclRefFunction;
99
use crate::source_map::SourceMap;
1010
use crate::BuildConfig;
@@ -122,22 +122,22 @@ fn to_bytecode_mut(
122122
) -> CompiledBytecode {
123123
fn op_size_in_bytes(data_section: &DataSection, item: &AllocatedOp) -> u64 {
124124
match &item.opcode {
125-
AllocatedOpcode::LoadDataId(_reg, data_label)
125+
AllocatedInstruction::LoadDataId(_reg, data_label)
126126
if !data_section
127127
.has_copy_type(data_label)
128128
.expect("data label references non existent data -- internal error") =>
129129
{
130130
8
131131
}
132-
AllocatedOpcode::AddrDataId(_, id)
132+
AllocatedInstruction::AddrDataId(_, id)
133133
if data_section.data_id_to_offset(id) > usize::from(Imm12::MAX.to_u16()) =>
134134
{
135135
8
136136
}
137-
AllocatedOpcode::ConfigurablesOffsetPlaceholder => 8,
138-
AllocatedOpcode::DataSectionOffsetPlaceholder => 8,
139-
AllocatedOpcode::BLOB(count) => count.value() as u64 * 4,
140-
AllocatedOpcode::CFEI(i) | AllocatedOpcode::CFSI(i) if i.value() == 0 => 0,
137+
AllocatedInstruction::ConfigurablesOffsetPlaceholder => 8,
138+
AllocatedInstruction::DataSectionOffsetPlaceholder => 8,
139+
AllocatedInstruction::BLOB(count) => count.value() as u64 * 4,
140+
AllocatedInstruction::CFEI(i) | AllocatedInstruction::CFSI(i) if i.value() == 0 => 0,
141141
_ => 4,
142142
}
143143
}
@@ -156,7 +156,7 @@ fn to_bytecode_mut(
156156
ops_padded.reserve(ops.len() + 1);
157157
ops_padded.extend(ops.iter().cloned());
158158
ops_padded.push(AllocatedOp {
159-
opcode: AllocatedOpcode::NOOP,
159+
opcode: AllocatedInstruction::NOOP,
160160
comment: "word-alignment of data section".into(),
161161
owning_span: None,
162162
});
@@ -167,7 +167,7 @@ fn to_bytecode_mut(
167167
let mut offset_from_instr_start = 0;
168168
for op in ops.iter() {
169169
match &op.opcode {
170-
AllocatedOpcode::LoadDataId(_reg, data_label)
170+
AllocatedInstruction::LoadDataId(_reg, data_label)
171171
if !data_section
172172
.has_copy_type(data_label)
173173
.expect("data label references non existent data -- internal error") =>

0 commit comments

Comments
 (0)