cartesi_rollups_contracts/
error_raiser.rs1#[allow(
29 non_camel_case_types,
30 non_snake_case,
31 clippy::pub_underscore_fields,
32 clippy::style,
33 clippy::empty_structs_with_brackets
34)]
35pub mod ErrorRaiser {
36 use super::*;
37 use alloy::sol_types as alloy_sol_types;
38 #[rustfmt::skip]
44 #[allow(clippy::all)]
45 pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
46 b"`\x80\x80`@R4`\x15Wa\x01\x0B\x90\x81a\0\x1A\x829\xF3[_\x80\xFD\xFE`\x80`@R`\x046\x10\x15`\x10W_\x80\xFD[_5`\xE0\x1Cc\xAC`>0\x14`\"W_\x80\xFD[4`\xBDW` 6`\x03\x19\x01\x12`\xBDW`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11`\xBDW6`#\x82\x01\x12\x15`\xBDW\x80`\x04\x015\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11`\xBDW6`$\x83\x83\x01\x01\x11`\xBDW`@Q\x91`\x1F\x81\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x84\x83\x10\x17`\xB9W\x80`$_\x94` \x94`@R\x82\x87R\x01\x83\x86\x017\x83\x01\x01R\x80Q\x90\x81`\xB4W_\x80\xFD[` \x01\xFD[`\xC1V[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 \xEAy+\xDD\xEC\xE7s\xA9J`5\x80v.\xD0\xF3\xB1?\xBA3y\x0F<\x82o\x1C<O\xB1C\x96\xC1dsolcC\0\x08\x1E\x003",
47 );
48 #[rustfmt::skip]
54 #[allow(clippy::all)]
55 pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
56 b"`\x80`@R`\x046\x10\x15`\x10W_\x80\xFD[_5`\xE0\x1Cc\xAC`>0\x14`\"W_\x80\xFD[4`\xBDW` 6`\x03\x19\x01\x12`\xBDW`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11`\xBDW6`#\x82\x01\x12\x15`\xBDW\x80`\x04\x015\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11`\xBDW6`$\x83\x83\x01\x01\x11`\xBDW`@Q\x91`\x1F\x81\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x84\x83\x10\x17`\xB9W\x80`$_\x94` \x94`@R\x82\x87R\x01\x83\x86\x017\x83\x01\x01R\x80Q\x90\x81`\xB4W_\x80\xFD[` \x01\xFD[`\xC1V[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 \xEAy+\xDD\xEC\xE7s\xA9J`5\x80v.\xD0\xF3\xB1?\xBA3y\x0F<\x82o\x1C<O\xB1C\x96\xC1dsolcC\0\x08\x1E\x003",
57 );
58 #[derive(serde::Serialize, serde::Deserialize)]
59 #[derive(Default, Debug, PartialEq, Eq, Hash)]
60 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
65 #[derive(Clone)]
66 pub struct raiseCall {
67 #[allow(missing_docs)]
68 pub error: alloy::sol_types::private::Bytes,
69 }
70 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
72 #[derive(Clone)]
73 pub struct raiseReturn {}
74 #[allow(
75 non_camel_case_types,
76 non_snake_case,
77 clippy::pub_underscore_fields,
78 clippy::style
79 )]
80 const _: () = {
81 use alloy::sol_types as alloy_sol_types;
82 {
83 #[doc(hidden)]
84 #[allow(dead_code)]
85 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bytes,);
86 #[doc(hidden)]
87 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Bytes,);
88 #[cfg(test)]
89 #[allow(dead_code, unreachable_patterns)]
90 fn _type_assertion(
91 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
92 ) {
93 match _t {
94 alloy_sol_types::private::AssertTypeEq::<
95 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
96 >(_) => {}
97 }
98 }
99 #[automatically_derived]
100 #[doc(hidden)]
101 impl ::core::convert::From<raiseCall> for UnderlyingRustTuple<'_> {
102 fn from(value: raiseCall) -> Self {
103 (value.error,)
104 }
105 }
106 #[automatically_derived]
107 #[doc(hidden)]
108 impl ::core::convert::From<UnderlyingRustTuple<'_>> for raiseCall {
109 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
110 Self { error: tuple.0 }
111 }
112 }
113 }
114 {
115 #[doc(hidden)]
116 #[allow(dead_code)]
117 type UnderlyingSolTuple<'a> = ();
118 #[doc(hidden)]
119 type UnderlyingRustTuple<'a> = ();
120 #[cfg(test)]
121 #[allow(dead_code, unreachable_patterns)]
122 fn _type_assertion(
123 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
124 ) {
125 match _t {
126 alloy_sol_types::private::AssertTypeEq::<
127 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
128 >(_) => {}
129 }
130 }
131 #[automatically_derived]
132 #[doc(hidden)]
133 impl ::core::convert::From<raiseReturn> for UnderlyingRustTuple<'_> {
134 fn from(value: raiseReturn) -> Self {
135 ()
136 }
137 }
138 #[automatically_derived]
139 #[doc(hidden)]
140 impl ::core::convert::From<UnderlyingRustTuple<'_>> for raiseReturn {
141 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
142 Self {}
143 }
144 }
145 }
146 impl raiseReturn {
147 fn _tokenize(
148 &self,
149 ) -> <raiseCall as alloy_sol_types::SolCall>::ReturnToken<'_> {
150 ()
151 }
152 }
153 #[automatically_derived]
154 impl alloy_sol_types::SolCall for raiseCall {
155 type Parameters<'a> = (alloy::sol_types::sol_data::Bytes,);
156 type Token<'a> = <Self::Parameters<
157 'a,
158 > as alloy_sol_types::SolType>::Token<'a>;
159 type Return = raiseReturn;
160 type ReturnTuple<'a> = ();
161 type ReturnToken<'a> = <Self::ReturnTuple<
162 'a,
163 > as alloy_sol_types::SolType>::Token<'a>;
164 const SIGNATURE: &'static str = "raise(bytes)";
165 const SELECTOR: [u8; 4] = [172u8, 96u8, 62u8, 48u8];
166 #[inline]
167 fn new<'a>(
168 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
169 ) -> Self {
170 tuple.into()
171 }
172 #[inline]
173 fn tokenize(&self) -> Self::Token<'_> {
174 (
175 <alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
176 &self.error,
177 ),
178 )
179 }
180 #[inline]
181 fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
182 raiseReturn::_tokenize(ret)
183 }
184 #[inline]
185 fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
186 <Self::ReturnTuple<
187 '_,
188 > as alloy_sol_types::SolType>::abi_decode_sequence(data)
189 .map(Into::into)
190 }
191 #[inline]
192 fn abi_decode_returns_validate(
193 data: &[u8],
194 ) -> alloy_sol_types::Result<Self::Return> {
195 <Self::ReturnTuple<
196 '_,
197 > as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
198 .map(Into::into)
199 }
200 }
201 };
202 #[derive(Clone)]
204 #[derive(serde::Serialize, serde::Deserialize)]
205 #[derive()]
206 pub enum ErrorRaiserCalls {
207 #[allow(missing_docs)]
208 raise(raiseCall),
209 }
210 impl ErrorRaiserCalls {
211 pub const SELECTORS: &'static [[u8; 4usize]] = &[[172u8, 96u8, 62u8, 48u8]];
218 pub const VARIANT_NAMES: &'static [&'static str] = &[::core::stringify!(raise)];
220 pub const SIGNATURES: &'static [&'static str] = &[
222 <raiseCall as alloy_sol_types::SolCall>::SIGNATURE,
223 ];
224 #[inline]
226 pub fn signature_by_selector(
227 selector: [u8; 4usize],
228 ) -> ::core::option::Option<&'static str> {
229 match Self::SELECTORS.binary_search(&selector) {
230 ::core::result::Result::Ok(idx) => {
231 ::core::option::Option::Some(Self::SIGNATURES[idx])
232 }
233 ::core::result::Result::Err(_) => ::core::option::Option::None,
234 }
235 }
236 #[inline]
238 pub fn name_by_selector(
239 selector: [u8; 4usize],
240 ) -> ::core::option::Option<&'static str> {
241 let sig = Self::signature_by_selector(selector)?;
242 sig.split_once('(').map(|(name, _)| name)
243 }
244 }
245 #[automatically_derived]
246 impl alloy_sol_types::SolInterface for ErrorRaiserCalls {
247 const NAME: &'static str = "ErrorRaiserCalls";
248 const MIN_DATA_LENGTH: usize = 64usize;
249 const COUNT: usize = 1usize;
250 #[inline]
251 fn selector(&self) -> [u8; 4] {
252 match self {
253 Self::raise(_) => <raiseCall as alloy_sol_types::SolCall>::SELECTOR,
254 }
255 }
256 #[inline]
257 fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
258 Self::SELECTORS.get(i).copied()
259 }
260 #[inline]
261 fn valid_selector(selector: [u8; 4]) -> bool {
262 Self::SELECTORS.binary_search(&selector).is_ok()
263 }
264 #[inline]
265 #[allow(non_snake_case)]
266 fn abi_decode_raw(
267 selector: [u8; 4],
268 data: &[u8],
269 ) -> alloy_sol_types::Result<Self> {
270 static DECODE_SHIMS: &[fn(
271 &[u8],
272 ) -> alloy_sol_types::Result<ErrorRaiserCalls>] = &[
273 {
274 fn raise(data: &[u8]) -> alloy_sol_types::Result<ErrorRaiserCalls> {
275 <raiseCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
276 .map(ErrorRaiserCalls::raise)
277 }
278 raise
279 },
280 ];
281 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
282 return Err(
283 alloy_sol_types::Error::unknown_selector(
284 <Self as alloy_sol_types::SolInterface>::NAME,
285 selector,
286 ),
287 );
288 };
289 DECODE_SHIMS[idx](data)
290 }
291 #[inline]
292 #[allow(non_snake_case)]
293 fn abi_decode_raw_validate(
294 selector: [u8; 4],
295 data: &[u8],
296 ) -> alloy_sol_types::Result<Self> {
297 static DECODE_VALIDATE_SHIMS: &[fn(
298 &[u8],
299 ) -> alloy_sol_types::Result<ErrorRaiserCalls>] = &[
300 {
301 fn raise(data: &[u8]) -> alloy_sol_types::Result<ErrorRaiserCalls> {
302 <raiseCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
303 data,
304 )
305 .map(ErrorRaiserCalls::raise)
306 }
307 raise
308 },
309 ];
310 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
311 return Err(
312 alloy_sol_types::Error::unknown_selector(
313 <Self as alloy_sol_types::SolInterface>::NAME,
314 selector,
315 ),
316 );
317 };
318 DECODE_VALIDATE_SHIMS[idx](data)
319 }
320 #[inline]
321 fn abi_encoded_size(&self) -> usize {
322 match self {
323 Self::raise(inner) => {
324 <raiseCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
325 }
326 }
327 }
328 #[inline]
329 fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
330 match self {
331 Self::raise(inner) => {
332 <raiseCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
333 }
334 }
335 }
336 }
337 use alloy::contract as alloy_contract;
338 #[inline]
342 pub const fn new<
343 P: alloy_contract::private::Provider<N>,
344 N: alloy_contract::private::Network,
345 >(
346 address: alloy_sol_types::private::Address,
347 __provider: P,
348 ) -> ErrorRaiserInstance<P, N> {
349 ErrorRaiserInstance::<P, N>::new(address, __provider)
350 }
351 #[inline]
357 pub fn deploy<
358 P: alloy_contract::private::Provider<N>,
359 N: alloy_contract::private::Network,
360 >(
361 __provider: P,
362 ) -> impl ::core::future::Future<
363 Output = alloy_contract::Result<ErrorRaiserInstance<P, N>>,
364 > {
365 ErrorRaiserInstance::<P, N>::deploy(__provider)
366 }
367 #[inline]
373 pub fn deploy_builder<
374 P: alloy_contract::private::Provider<N>,
375 N: alloy_contract::private::Network,
376 >(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
377 ErrorRaiserInstance::<P, N>::deploy_builder(__provider)
378 }
379 #[derive(Clone)]
391 pub struct ErrorRaiserInstance<P, N = alloy_contract::private::Ethereum> {
392 address: alloy_sol_types::private::Address,
393 provider: P,
394 _network: ::core::marker::PhantomData<N>,
395 }
396 #[automatically_derived]
397 impl<P, N> ::core::fmt::Debug for ErrorRaiserInstance<P, N> {
398 #[inline]
399 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
400 f.debug_tuple("ErrorRaiserInstance").field(&self.address).finish()
401 }
402 }
403 impl<
405 P: alloy_contract::private::Provider<N>,
406 N: alloy_contract::private::Network,
407 > ErrorRaiserInstance<P, N> {
408 #[inline]
412 pub const fn new(
413 address: alloy_sol_types::private::Address,
414 __provider: P,
415 ) -> Self {
416 Self {
417 address,
418 provider: __provider,
419 _network: ::core::marker::PhantomData,
420 }
421 }
422 #[inline]
428 pub async fn deploy(
429 __provider: P,
430 ) -> alloy_contract::Result<ErrorRaiserInstance<P, N>> {
431 let call_builder = Self::deploy_builder(__provider);
432 let contract_address = call_builder.deploy().await?;
433 Ok(Self::new(contract_address, call_builder.provider))
434 }
435 #[inline]
441 pub fn deploy_builder(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
442 alloy_contract::RawCallBuilder::new_raw_deploy(
443 __provider,
444 ::core::clone::Clone::clone(&BYTECODE),
445 )
446 }
447 #[inline]
449 pub const fn address(&self) -> &alloy_sol_types::private::Address {
450 &self.address
451 }
452 #[inline]
454 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
455 self.address = address;
456 }
457 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
459 self.set_address(address);
460 self
461 }
462 #[inline]
464 pub const fn provider(&self) -> &P {
465 &self.provider
466 }
467 }
468 impl<P: ::core::clone::Clone, N> ErrorRaiserInstance<&P, N> {
469 #[inline]
471 pub fn with_cloned_provider(self) -> ErrorRaiserInstance<P, N> {
472 ErrorRaiserInstance {
473 address: self.address,
474 provider: ::core::clone::Clone::clone(&self.provider),
475 _network: ::core::marker::PhantomData,
476 }
477 }
478 }
479 impl<
481 P: alloy_contract::private::Provider<N>,
482 N: alloy_contract::private::Network,
483 > ErrorRaiserInstance<P, N> {
484 pub fn call_builder<C: alloy_sol_types::SolCall>(
489 &self,
490 call: &C,
491 ) -> alloy_contract::SolCallBuilder<&P, C, N> {
492 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
493 }
494 pub fn raise(
496 &self,
497 error: alloy::sol_types::private::Bytes,
498 ) -> alloy_contract::SolCallBuilder<&P, raiseCall, N> {
499 self.call_builder(&raiseCall { error })
500 }
501 }
502 impl<
504 P: alloy_contract::private::Provider<N>,
505 N: alloy_contract::private::Network,
506 > ErrorRaiserInstance<P, N> {
507 pub fn event_filter<E: alloy_sol_types::SolEvent>(
512 &self,
513 ) -> alloy_contract::Event<&P, E, N> {
514 alloy_contract::Event::new_sol(&self.provider, &self.address)
515 }
516 }
517}