Skip to content

Commit

Permalink
Emit top down event (#285)
Browse files Browse the repository at this point in the history
* emit top down event

* format

* commit rust binding

* commit ABI artifacts

* fix tests

* fix CI

* commit rust binding

* commit ABI artifacts

* export lib gateway to bindings

* commit rust binding

* update binding

* update storage

* Update test/SubnetIDHelper.t.sol

Co-authored-by: Akosh Farkash <aakoshh@gmail.com>

* commit rust binding

* commit ABI artifacts

* update

* commit rust binding

* commit ABI artifacts

* remove nonce

* commit rust binding

* commit ABI artifacts

* Update src/lib/LibGateway.sol

Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>

* Update src/lib/SubnetIDHelper.sol

Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>

* Update src/lib/SubnetIDHelper.sol

Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>

* commit rust binding

* commit ABI artifacts

* index by address

* update binding and artifacts

* add tests

* update binding

* commit rust binding

* commit ABI artifacts

---------

Co-authored-by: auto-commit <auto-commit@users.noreply.github.com>
Co-authored-by: Akosh Farkash <aakoshh@gmail.com>
Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 21, 2023
1 parent ff1545a commit 2745777
Show file tree
Hide file tree
Showing 93 changed files with 90,381 additions and 1,704,184 deletions.
378 changes: 178 additions & 200 deletions .storage-layouts/GatewayActorModifiers.json

Large diffs are not rendered by default.

376 changes: 177 additions & 199 deletions .storage-layouts/GatewayDiamond.json

Large diffs are not rendered by default.

210 changes: 105 additions & 105 deletions .storage-layouts/SubnetActorDiamond.json

Large diffs are not rendered by default.

212 changes: 106 additions & 106 deletions .storage-layouts/SubnetActorModifiers.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions binding/build.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions binding/src/gateway_diamond.rs

Large diffs are not rendered by default.

159 changes: 0 additions & 159 deletions binding/src/gateway_getter_facet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,109 +867,6 @@ pub mod gateway_getter_facet {
},
],
),
(
::std::borrow::ToOwned::to_owned("getTopDownMsgs"),
::std::vec![
::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("getTopDownMsgs"),
inputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("subnetId"),
kind: ::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(64usize),
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Address,
),
),
],
),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("struct SubnetID"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("blockNumber"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(
256usize,
),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
],
outputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("msgs"),
kind: ::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(64usize),
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Address,
),
),
],
),
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(8usize),
::ethers::core::abi::ethabi::ParamType::Bytes,
],
),
],
),
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(64usize),
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Address,
),
),
],
),
::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(8usize),
::ethers::core::abi::ethabi::ParamType::Bytes,
],
),
],
),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(64usize),
::ethers::core::abi::ethabi::ParamType::FixedBytes(4usize),
::ethers::core::abi::ethabi::ParamType::Bytes,
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
],
),
::ethers::core::abi::ethabi::ParamType::Bool,
],
),
),
),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("struct CrossMsg[]"),
),
},
],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},
],
),
(
::std::borrow::ToOwned::to_owned("listSubnets"),
::std::vec![
Expand Down Expand Up @@ -1454,16 +1351,6 @@ pub mod gateway_getter_facet {
.method_hash([157, 48, 112, 181], (subnet_id,))
.expect("method not found (this should never happen)")
}
///Calls the contract's `getTopDownMsgs` (0xa823cb23) function
pub fn get_top_down_msgs(
&self,
subnet_id: SubnetID,
block_number: ::ethers::core::types::U256,
) -> ::ethers::contract::builders::ContractCall<M, ::std::vec::Vec<CrossMsg>> {
self.0
.method_hash([168, 35, 203, 35], (subnet_id, block_number))
.expect("method not found (this should never happen)")
}
///Calls the contract's `listSubnets` (0x5d029685) function
pub fn list_subnets(
&self,
Expand Down Expand Up @@ -1858,25 +1745,6 @@ pub mod gateway_getter_facet {
pub struct GetSubnetTopDownMsgsLengthCall {
pub subnet_id: SubnetID,
}
///Container type for all input parameters for the `getTopDownMsgs` function with signature `getTopDownMsgs((uint64,address[]),uint256)` and selector `0xa823cb23`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(
name = "getTopDownMsgs",
abi = "getTopDownMsgs((uint64,address[]),uint256)"
)]
pub struct GetTopDownMsgsCall {
pub subnet_id: SubnetID,
pub block_number: ::ethers::core::types::U256,
}
///Container type for all input parameters for the `listSubnets` function with signature `listSubnets()` and selector `0x5d029685`
#[derive(
Clone,
Expand Down Expand Up @@ -1985,7 +1853,6 @@ pub mod gateway_getter_facet {
GetSignatureBundle(GetSignatureBundleCall),
GetSubnet(GetSubnetCall),
GetSubnetTopDownMsgsLength(GetSubnetTopDownMsgsLengthCall),
GetTopDownMsgs(GetTopDownMsgsCall),
ListSubnets(ListSubnetsCall),
MajorityPercentage(MajorityPercentageCall),
MinStake(MinStakeCall),
Expand Down Expand Up @@ -2108,11 +1975,6 @@ pub mod gateway_getter_facet {
{
return Ok(Self::GetSubnetTopDownMsgsLength(decoded));
}
if let Ok(decoded) =
<GetTopDownMsgsCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::GetTopDownMsgs(decoded));
}
if let Ok(decoded) = <ListSubnetsCall as ::ethers::core::abi::AbiDecode>::decode(data) {
return Ok(Self::ListSubnets(decoded));
}
Expand Down Expand Up @@ -2193,7 +2055,6 @@ pub mod gateway_getter_facet {
Self::GetSubnetTopDownMsgsLength(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::GetTopDownMsgs(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::ListSubnets(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::MajorityPercentage(element) => {
::ethers::core::abi::AbiEncode::encode(element)
Expand Down Expand Up @@ -2235,7 +2096,6 @@ pub mod gateway_getter_facet {
Self::GetSignatureBundle(element) => ::core::fmt::Display::fmt(element, f),
Self::GetSubnet(element) => ::core::fmt::Display::fmt(element, f),
Self::GetSubnetTopDownMsgsLength(element) => ::core::fmt::Display::fmt(element, f),
Self::GetTopDownMsgs(element) => ::core::fmt::Display::fmt(element, f),
Self::ListSubnets(element) => ::core::fmt::Display::fmt(element, f),
Self::MajorityPercentage(element) => ::core::fmt::Display::fmt(element, f),
Self::MinStake(element) => ::core::fmt::Display::fmt(element, f),
Expand Down Expand Up @@ -2360,11 +2220,6 @@ pub mod gateway_getter_facet {
Self::GetSubnetTopDownMsgsLength(value)
}
}
impl ::core::convert::From<GetTopDownMsgsCall> for GatewayGetterFacetCalls {
fn from(value: GetTopDownMsgsCall) -> Self {
Self::GetTopDownMsgs(value)
}
}
impl ::core::convert::From<ListSubnetsCall> for GatewayGetterFacetCalls {
fn from(value: ListSubnetsCall) -> Self {
Self::ListSubnets(value)
Expand Down Expand Up @@ -2678,20 +2533,6 @@ pub mod gateway_getter_facet {
Hash,
)]
pub struct GetSubnetTopDownMsgsLengthReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `getTopDownMsgs` function with signature `getTopDownMsgs((uint64,address[]),uint256)` and selector `0xa823cb23`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct GetTopDownMsgsReturn {
pub msgs: ::std::vec::Vec<CrossMsg>,
}
///Container type for all return fields from the `listSubnets` function with signature `listSubnets()` and selector `0x5d029685`
#[derive(
Clone,
Expand Down
3 changes: 3 additions & 0 deletions binding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub mod gateway_router_facet;
#[allow(clippy::all)]
pub mod i_diamond;
#[allow(clippy::all)]
pub mod lib_gateway;
#[allow(clippy::all)]
pub mod lib_staking;
#[allow(clippy::all)]
pub mod lib_staking_change_log;
Expand All @@ -32,6 +34,7 @@ fvm_address_conversion!(gateway_getter_facet);
fvm_address_conversion!(gateway_router_facet);
fvm_address_conversion!(gateway_messenger_facet);
fvm_address_conversion!(subnet_actor_manager_facet);
fvm_address_conversion!(lib_gateway);

// The list of contracts that need to convert common types between each other
common_type_conversion!(gateway_getter_facet, subnet_actor_manager_facet);
Expand Down
Loading

0 comments on commit 2745777

Please sign in to comment.