feat(interface-types) The “helper adapter” has been removed.

This commit is contained in:
Ivan Enderlin
2020-02-24 15:49:03 +01:00
parent 09e57b7156
commit 1f2a5640a6
5 changed files with 1 additions and 94 deletions

View File

@ -124,7 +124,6 @@ where
match self {
AdapterKind::Import => 0x00_u8.to_bytes(writer),
AdapterKind::Export => 0x01_u8.to_bytes(writer),
AdapterKind::HelperFunction => 0x02_u8.to_bytes(writer),
}
}
}
@ -214,19 +213,6 @@ where
output_types.to_bytes(writer)?;
instructions.to_bytes(writer)?;
}
Adapter::HelperFunction {
name,
input_types,
output_types,
instructions,
} => {
AdapterKind::HelperFunction.to_bytes(writer)?;
name.to_bytes(writer)?;
input_types.to_bytes(writer)?;
output_types.to_bytes(writer)?;
instructions.to_bytes(writer)?;
}
}
Ok(())
@ -468,7 +454,6 @@ mod tests {
fn test_adapter_kind() {
assert_to_bytes!(AdapterKind::Import, &[0x00]);
assert_to_bytes!(AdapterKind::Export, &[0x01]);
assert_to_bytes!(AdapterKind::HelperFunction, &[0x02]);
}
#[test]
@ -590,30 +575,6 @@ mod tests {
);
}
#[test]
fn test_adapter_helper_function() {
assert_to_bytes!(
Adapter::HelperFunction {
name: "a",
input_types: vec![InterfaceType::I32, InterfaceType::I64],
output_types: vec![InterfaceType::I32],
instructions: vec![Instruction::ArgumentGet { index: 1 }],
},
&[
0x02, // AdapterKind::HelperFunction
0x01, // string of length 1
0x61, // "a"
0x02, // list of 2 items
0x0c, // I32
0x0d, // I64
0x01, // list of 1 items
0x0c, // I32
0x01, // list of 1 item
0x00, 0x01, // ArgumentGet { index: 1 }
]
);
}
#[test]
fn test_forward() {
assert_to_bytes!(