mirror of
https://github.com/fluencelabs/interface-types
synced 2025-07-23 18:21:59 +00:00
feat(interface-types) Implement the string.size
instruction.
This commit is contained in:
@@ -299,6 +299,8 @@ where
|
||||
0x23_u8.to_bytes(writer)?;
|
||||
(*allocator_index as u64).to_bytes(writer)?;
|
||||
}
|
||||
|
||||
Instruction::StringSize => 0x24_u8.to_bytes(writer)?,
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -577,9 +579,10 @@ mod tests {
|
||||
Instruction::I64FromU64,
|
||||
Instruction::StringLiftMemory,
|
||||
Instruction::StringLowerMemory { allocator_index: 1 },
|
||||
Instruction::StringSize,
|
||||
],
|
||||
&[
|
||||
0x24, // list of 36 items
|
||||
0x25, // list of 37 items
|
||||
0x00, 0x01, // ArgumentGet { index: 1 }
|
||||
0x01, 0x01, // CallCore { function_index: 1 }
|
||||
0x02, // S8FromI32
|
||||
@@ -616,6 +619,7 @@ mod tests {
|
||||
0x21, // I64FromU64
|
||||
0x22, // StringLiftMemory
|
||||
0x23, 0x01, // StringLowerMemory { allocator_index: 1 }
|
||||
0x24, // StringSize
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user