Skip to content

Commit

Permalink
contract-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneh1999 committed Dec 22, 2024
1 parent a4b9916 commit 9c97b7e
Show file tree
Hide file tree
Showing 6 changed files with 563 additions and 393 deletions.
2 changes: 1 addition & 1 deletion contract-bindings/artifacts/LightClientMock_bytecode.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contract-bindings/artifacts/LightClient_bytecode.json

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions contract-bindings/src/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ pub mod light_client {
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("currentBlockNumber"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("currentBlockNumber"),
inputs: ::std::vec![],
outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("disablePermissionedProverMode"),
::std::vec![::ethers::core::abi::ethabi::Function {
Expand Down Expand Up @@ -959,6 +975,14 @@ pub mod light_client {
.method_hash([173, 60, 177, 204], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `currentBlockNumber` (0x378ec23b) function
pub fn current_block_number(
&self,
) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
self.0
.method_hash([55, 142, 194, 59], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `disablePermissionedProverMode` (0x69cc6a04) function
pub fn disable_permissioned_prover_mode(
&self,
Expand Down Expand Up @@ -2214,6 +2238,21 @@ pub mod light_client {
abi = "UPGRADE_INTERFACE_VERSION()"
)]
pub struct UpgradeInterfaceVersionCall;
///Container type for all input parameters for the `currentBlockNumber` function with signature `currentBlockNumber()` and selector `0x378ec23b`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
serde::Serialize,
serde::Deserialize,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "currentBlockNumber", abi = "currentBlockNumber()")]
pub struct CurrentBlockNumberCall;
///Container type for all input parameters for the `disablePermissionedProverMode` function with signature `disablePermissionedProverMode()` and selector `0x69cc6a04`
#[derive(
Clone,
Expand Down Expand Up @@ -2589,6 +2628,7 @@ pub mod light_client {
#[derive(Clone, ::ethers::contract::EthAbiType, serde::Serialize, serde::Deserialize)]
pub enum LightClientCalls {
UpgradeInterfaceVersion(UpgradeInterfaceVersionCall),
CurrentBlockNumber(CurrentBlockNumberCall),
DisablePermissionedProverMode(DisablePermissionedProverModeCall),
FinalizedState(FinalizedStateCall),
GenesisStakeTableState(GenesisStakeTableStateCall),
Expand Down Expand Up @@ -2622,6 +2662,11 @@ pub mod light_client {
{
return Ok(Self::UpgradeInterfaceVersion(decoded));
}
if let Ok(decoded) =
<CurrentBlockNumberCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::CurrentBlockNumber(decoded));
}
if let Ok(decoded) =
<DisablePermissionedProverModeCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
Expand Down Expand Up @@ -2733,6 +2778,9 @@ pub mod light_client {
Self::UpgradeInterfaceVersion(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::CurrentBlockNumber(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::DisablePermissionedProverMode(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Expand Down Expand Up @@ -2786,6 +2834,7 @@ pub mod light_client {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::UpgradeInterfaceVersion(element) => ::core::fmt::Display::fmt(element, f),
Self::CurrentBlockNumber(element) => ::core::fmt::Display::fmt(element, f),
Self::DisablePermissionedProverMode(element) => {
::core::fmt::Display::fmt(element, f)
}
Expand Down Expand Up @@ -2820,6 +2869,11 @@ pub mod light_client {
Self::UpgradeInterfaceVersion(value)
}
}
impl ::core::convert::From<CurrentBlockNumberCall> for LightClientCalls {
fn from(value: CurrentBlockNumberCall) -> Self {
Self::CurrentBlockNumber(value)
}
}
impl ::core::convert::From<DisablePermissionedProverModeCall> for LightClientCalls {
fn from(value: DisablePermissionedProverModeCall) -> Self {
Self::DisablePermissionedProverMode(value)
Expand Down Expand Up @@ -2944,6 +2998,20 @@ pub mod light_client {
Hash,
)]
pub struct UpgradeInterfaceVersionReturn(pub ::std::string::String);
///Container type for all return fields from the `currentBlockNumber` function with signature `currentBlockNumber()` and selector `0x378ec23b`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
serde::Serialize,
serde::Deserialize,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct CurrentBlockNumberReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `finalizedState` function with signature `finalizedState()` and selector `0x9fdb54a7`
#[derive(
Clone,
Expand Down
68 changes: 68 additions & 0 deletions contract-bindings/src/light_client_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ pub mod light_client_mock {
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("currentBlockNumber"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("currentBlockNumber"),
inputs: ::std::vec![],
outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("disablePermissionedProverMode"),
::std::vec![::ethers::core::abi::ethabi::Function {
Expand Down Expand Up @@ -1065,6 +1081,14 @@ pub mod light_client_mock {
.method_hash([173, 60, 177, 204], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `currentBlockNumber` (0x378ec23b) function
pub fn current_block_number(
&self,
) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
self.0
.method_hash([55, 142, 194, 59], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `disablePermissionedProverMode` (0x69cc6a04) function
pub fn disable_permissioned_prover_mode(
&self,
Expand Down Expand Up @@ -2357,6 +2381,21 @@ pub mod light_client_mock {
abi = "UPGRADE_INTERFACE_VERSION()"
)]
pub struct UpgradeInterfaceVersionCall;
///Container type for all input parameters for the `currentBlockNumber` function with signature `currentBlockNumber()` and selector `0x378ec23b`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
serde::Serialize,
serde::Deserialize,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "currentBlockNumber", abi = "currentBlockNumber()")]
pub struct CurrentBlockNumberCall;
///Container type for all input parameters for the `disablePermissionedProverMode` function with signature `disablePermissionedProverMode()` and selector `0x69cc6a04`
#[derive(
Clone,
Expand Down Expand Up @@ -2804,6 +2843,7 @@ pub mod light_client_mock {
#[derive(Clone, ::ethers::contract::EthAbiType, serde::Serialize, serde::Deserialize)]
pub enum LightClientMockCalls {
UpgradeInterfaceVersion(UpgradeInterfaceVersionCall),
CurrentBlockNumber(CurrentBlockNumberCall),
DisablePermissionedProverMode(DisablePermissionedProverModeCall),
FinalizedState(FinalizedStateCall),
GenesisStakeTableState(GenesisStakeTableStateCall),
Expand Down Expand Up @@ -2841,6 +2881,11 @@ pub mod light_client_mock {
{
return Ok(Self::UpgradeInterfaceVersion(decoded));
}
if let Ok(decoded) =
<CurrentBlockNumberCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::CurrentBlockNumber(decoded));
}
if let Ok(decoded) =
<DisablePermissionedProverModeCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
Expand Down Expand Up @@ -2971,6 +3016,9 @@ pub mod light_client_mock {
Self::UpgradeInterfaceVersion(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::CurrentBlockNumber(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::DisablePermissionedProverMode(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Expand Down Expand Up @@ -3030,6 +3078,7 @@ pub mod light_client_mock {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::UpgradeInterfaceVersion(element) => ::core::fmt::Display::fmt(element, f),
Self::CurrentBlockNumber(element) => ::core::fmt::Display::fmt(element, f),
Self::DisablePermissionedProverMode(element) => {
::core::fmt::Display::fmt(element, f)
}
Expand Down Expand Up @@ -3068,6 +3117,11 @@ pub mod light_client_mock {
Self::UpgradeInterfaceVersion(value)
}
}
impl ::core::convert::From<CurrentBlockNumberCall> for LightClientMockCalls {
fn from(value: CurrentBlockNumberCall) -> Self {
Self::CurrentBlockNumber(value)
}
}
impl ::core::convert::From<DisablePermissionedProverModeCall> for LightClientMockCalls {
fn from(value: DisablePermissionedProverModeCall) -> Self {
Self::DisablePermissionedProverMode(value)
Expand Down Expand Up @@ -3212,6 +3266,20 @@ pub mod light_client_mock {
Hash,
)]
pub struct UpgradeInterfaceVersionReturn(pub ::std::string::String);
///Container type for all return fields from the `currentBlockNumber` function with signature `currentBlockNumber()` and selector `0x378ec23b`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
serde::Serialize,
serde::Deserialize,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct CurrentBlockNumberReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `finalizedState` function with signature `finalizedState()` and selector `0x9fdb54a7`
#[derive(
Clone,
Expand Down
Loading

0 comments on commit 9c97b7e

Please sign in to comment.