(&self)
| 75 | |
| 76 | impl 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 | |
| 114 | pub type EncodedInteraction = ( |
no test coverage detected