(&self, buf: &mut impl BufMut)
| 190 | } |
| 191 | let bytes: [u8; 8] = request.param.as_slice().try_into()?; |
| 192 | let param = ProtocolParam::AllowedTimestampFuture(u64::from_le_bytes(bytes)); |
| 193 | param.validate().map_err(|e| anyhow!("{e}"))?; |
| 194 | Ok(param) |
| 195 | } |
| 196 | 0x04 => { |
| 197 | if request.param.len() != 20 { |
| 198 | return Err(anyhow!( |
| 199 | "Failed to parse treasury address protocol param, invalid length {}", |
| 200 | request.param.len() |
| 201 | )); |
| 202 | } |
| 203 | let bytes: [u8; 20] = request.param.as_slice().try_into()?; |
| 204 | Ok(ProtocolParam::TreasuryAddress(Address::from(bytes))) |
| 205 | } |
| 206 | 0x05 => { |
| 207 | if request.param.len() != 8 { |
| 208 | return Err(anyhow!( |
| 209 | "Failed to parse max deposits per epoch protocol param, invalid length {}", |
| 210 | request.param.len() |
| 211 | )); |
| 212 | } |
| 213 | let bytes: [u8; 8] = request.param.as_slice().try_into()?; |
| 214 | let param = ProtocolParam::MaxDepositsPerEpoch(u64::from_le_bytes(bytes)); |
| 215 | param.validate().map_err(|e| anyhow!("{e}"))?; |
| 216 | Ok(param) |
| 217 | } |
| 218 | 0x06 => { |
| 219 | if request.param.len() != 8 { |
| 220 | return Err(anyhow!( |
| 221 | "Failed to parse max withdrawals per epoch protocol param, invalid length {}", |
| 222 | request.param.len() |
| 223 | )); |
| 224 | } |
| 225 | let bytes: [u8; 8] = request.param.as_slice().try_into()?; |
| 226 | let param = ProtocolParam::MaxWithdrawalsPerEpoch(u64::from_le_bytes(bytes)); |
| 227 | param.validate().map_err(|e| anyhow!("{e}"))?; |
| 228 | Ok(param) |
| 229 | } |
| 230 | 0x07 => { |
no outgoing calls