fix: cargo and forge fmt
This commit is contained in:
@@ -387,9 +387,10 @@ contract BebopExecutor is IExecutor, IExecutorErrors, RestrictTransferFrom {
|
||||
|
||||
// Copy sigLength bytes from src to dst
|
||||
let end := add(dst, sigLength)
|
||||
for { } lt(dst, end) { dst := add(dst, 0x20) src := add(src, 0x20) } {
|
||||
mstore(dst, mload(src))
|
||||
}
|
||||
for {} lt(dst, end) {
|
||||
dst := add(dst, 0x20)
|
||||
src := add(src, 0x20)
|
||||
} { mstore(dst, mload(src)) }
|
||||
}
|
||||
|
||||
signatures[i] = IBebopSettlement.MakerSignature({
|
||||
|
||||
@@ -640,7 +640,6 @@ impl SwapEncoder for BebopSwapEncoder {
|
||||
approval_needed = true;
|
||||
}
|
||||
|
||||
|
||||
// Validate component ID
|
||||
Self::validate_component_id(&swap.component.id)?;
|
||||
|
||||
@@ -660,7 +659,8 @@ impl SwapEncoder for BebopSwapEncoder {
|
||||
|
||||
// Encode packed data for the executor
|
||||
// Format: token_in | token_out | transfer_type | order_type |
|
||||
// quote_data_length | quote_data | signature_type | signature_length | signature | approval_needed
|
||||
// quote_data_length | quote_data | signature_type | signature_length | signature |
|
||||
// approval_needed
|
||||
let args = (
|
||||
token_in,
|
||||
token_out,
|
||||
@@ -1674,7 +1674,8 @@ mod tests {
|
||||
let mut static_attributes: HashMap<String, Bytes> = HashMap::new();
|
||||
static_attributes
|
||||
.insert("quote_data".into(), Bytes::from(hex::decode("1234567890abcdef").unwrap()));
|
||||
static_attributes.insert("signature".into(), Bytes::from(hex::decode("aabbccdd").unwrap()));
|
||||
static_attributes
|
||||
.insert("signature".into(), Bytes::from(hex::decode("aabbccdd").unwrap()));
|
||||
|
||||
let bebop_component = ProtocolComponent {
|
||||
id: String::from("bebop"),
|
||||
@@ -1753,7 +1754,8 @@ mod tests {
|
||||
let mut static_attributes: HashMap<String, Bytes> = HashMap::new();
|
||||
static_attributes
|
||||
.insert("quote_data".into(), Bytes::from(hex::decode("abcdef1234567890").unwrap()));
|
||||
static_attributes.insert("signature".into(), Bytes::from(hex::decode("11223344").unwrap()));
|
||||
static_attributes
|
||||
.insert("signature".into(), Bytes::from(hex::decode("11223344").unwrap()));
|
||||
static_attributes.insert("order_type".into(), Bytes::from(vec![1u8])); // Multi order
|
||||
|
||||
let bebop_component = ProtocolComponent {
|
||||
@@ -1834,7 +1836,10 @@ mod tests {
|
||||
static_attributes
|
||||
.insert("quote_data".into(), Bytes::from(hex::decode("deadbeef").unwrap()));
|
||||
// For aggregate, signature contains multiple signatures encoded
|
||||
static_attributes.insert("signature".into(), Bytes::from(hex::decode("0000000200000004aabbccdd00000004eeff0011").unwrap()));
|
||||
static_attributes.insert(
|
||||
"signature".into(),
|
||||
Bytes::from(hex::decode("0000000200000004aabbccdd00000004eeff0011").unwrap()),
|
||||
);
|
||||
static_attributes.insert("order_type".into(), Bytes::from(vec![2u8])); // Aggregate order
|
||||
|
||||
let bebop_component = ProtocolComponent {
|
||||
|
||||
Reference in New Issue
Block a user