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

Method into_settle_call

crates/simulator/src/encoding.rs:77–111  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

75
76impl EncodedSettlement {
77 pub fn into_settle_call(&self) -> Bytes {
78 GPv2Settlement::GPv2Settlement::settleCall {
79 tokens: self.tokens.clone(),
80 clearingPrices: self.clearing_prices.clone(),
81 interactions: self.interactions.clone().into_array().map(|interactions| {
82 interactions
83 .into_iter()
84 .map(|i| GPv2Settlement::GPv2Interaction::Data {
85 target: i.0,
86 value: i.1,
87 callData: i.2.0.into(),
88 })
89 .collect()
90 }),
91 trades: self
92 .trades
93 .iter()
94 .map(|t| GPv2Settlement::GPv2Trade::Data {
95 sellTokenIndex: t.0,
96 buyTokenIndex: t.1,
97 receiver: t.2,
98 sellAmount: t.3,
99 buyAmount: t.4,
100 validTo: t.5,
101 appData: t.6,
102 feeAmount: t.7,
103 flags: t.8,
104 executedAmount: t.9,
105 signature: t.10.clone(),
106 })
107 .collect(),
108 }
109 .abi_encode()
110 .into()
111 }
112}
113
114pub type EncodedInteraction = (

Callers 1

Calls 7

into_arrayMethod · 0.80
collectMethod · 0.80
intoMethod · 0.45
abi_encodeMethod · 0.45
cloneMethod · 0.45
into_iterMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected