MCPcopy Create free account
hub / github.com/cowprotocol/services / encode

Method encode

crates/solver/src/liquidity/zeroex.rs:199–213  ·  view source on GitHub ↗
(
        &self,
        execution: LimitOrderExecution,
        encoder: &mut SettlementEncoder,
    )

Source from the content-addressed store, hash-verified

197 }
198
199 fn encode(
200 &self,
201 execution: LimitOrderExecution,
202 encoder: &mut SettlementEncoder,
203 ) -> Result<()> {
204 let Ok(execution_filled) = u128::try_from(execution.filled) else {
205 anyhow::bail!("0x only supports executed amounts of size u128");
206 };
207 encoder.append_to_execution_plan(Arc::new(ZeroExInteraction {
208 taker_token_fill_amount: execution_filled,
209 order: self.order_record.order().clone(),
210 zeroex: self.zeroex.clone(),
211 }));
212 Ok(())
213 }
214}
215
216#[cfg(test)]

Callers 1

interaction_encodingFunction · 0.45

Calls 4

newFunction · 0.50
cloneMethod · 0.45
orderMethod · 0.45

Tested by

no test coverage detected