Skip to content

Commit

Permalink
Unit tests - Part 1 (#259)
Browse files Browse the repository at this point in the history
* add Subnet Actor tests
  • Loading branch information
dnkolegov authored Oct 26, 2023
1 parent e4ec004 commit 6194844
Show file tree
Hide file tree
Showing 17 changed files with 1,067 additions and 116 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "lib/murky"]
path = lib/murky
url = https://github.com/dmfxyz/murky
[submodule "lib/elliptic-curve-solidity"]
path = lib/elliptic-curve-solidity
url = https://github.com/witnet/elliptic-curve-solidity
4 changes: 2 additions & 2 deletions binding/src/gateway_diamond.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions binding/src/lib_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ pub mod lib_staking {
pub static LIBSTAKING_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`\x80\x80`@R4a\0\x1CWa\x029\x90\x81a\0\"\x8290\x81`=\x01R\xF3[`\0\x80\xFD\xFE`\x80`@\x81\x81R`\x04\x90\x816\x10\x15a\0\x16W`\0\x80\xFD[`\0\x92\x835`\xE0\x1C\x90\x81c!\xEE\xF6\x06\x14a\x01\xEDWPc\x82\x98^\x0B\x14a\0:W`\0\x80\xFD[0\x7F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x14a\x01\xE9W` 6`\x03\x19\x01\x12a\x01\xE9W\x815`\x01`\x01`\xA0\x1B\x03\x80\x82\x16\x90\x81\x83\x03a\x01\xE5W`\x01`\x01`\xA0\x1B\x03\x83\x16`\0\x90\x81R`\x19` R`@\x90 T\x92\x83\x15a\x01\xD5W`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R`\x19` R`@\x90 \x86\x90U`\x06T\x86\x91\x16\x80;\x15a\x01\xD1W\x81\x90`$\x86Q\x80\x94\x81\x93clq*\xB9`\xE1\x1B\x83R\x88\x8B\x84\x01RZ\xF1\x80\x15a\x01\xC7Wa\x01\x99W[P\x81G\x10a\x01\x83W\x84\x80\x80\x93\x81\x93Z\xF1=\x15a\x01~Wg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF=\x81\x81\x11a\x01kW\x83Q\x91`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90\x81\x11\x83\x82\x10\x17a\x01VW\x84R\x81R\x84` =\x92\x01>[\x15a\x01IW\x82\x80\xF3[Qc\n\x12\xF5!`\xE1\x1B\x81R\xFD[`A\x86cNH{q`\xE0\x1B`\0RR`$`\0\xFD[cNH{q`\xE0\x1B\x86R`A\x85R`$\x86\xFD[a\x01@V[\x82Qc\xCDx`Y`\xE0\x1B\x81R0\x81\x86\x01R`$\x90\xFD[g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x96\x92\x96\x11a\x01\xB4W\x83R\x938a\0\xEFV[cNH{q`\xE0\x1B\x82R`A\x85R`$\x82\xFD[\x84Q=\x88\x82>=\x90\xFD[P\x80\xFD[\x84Qcg0\x0F\x91`\xE1\x1B\x81R\x86\x90\xFD[\x85\x80\xFD[\x82\x80\xFD[\x84\x90\x81`\x03\x196\x01\x12a\x01\xD1W\x80`\x01` \x92R\xF3\xFE\xA2dipfsX\"\x12 \xAF\xA4G\xC9\xC0\xD4\x12\xB1\xE7\xFF\"\xDB_\xF2d\xE0\xD3U\xB4\x9F\x06\xB7\xC3\xE4\xD5\x9CO\xE6\xCC\xDB\xF0\x97dsolcC\0\x08\x13\x003";
const __BYTECODE: &[u8] = b"`\x80\x80`@R4a\0\x1CWa\x029\x90\x81a\0\"\x8290\x81`=\x01R\xF3[`\0\x80\xFD\xFE`\x80`@\x81\x81R`\x04\x90\x816\x10\x15a\0\x16W`\0\x80\xFD[`\0\x92\x835`\xE0\x1C\x90\x81c!\xEE\xF6\x06\x14a\x01\xEDWPc\x82\x98^\x0B\x14a\0:W`\0\x80\xFD[0\x7F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x14a\x01\xE9W` 6`\x03\x19\x01\x12a\x01\xE9W\x815`\x01`\x01`\xA0\x1B\x03\x80\x82\x16\x90\x81\x83\x03a\x01\xE5W`\x01`\x01`\xA0\x1B\x03\x83\x16`\0\x90\x81R`\x19` R`@\x90 T\x92\x83\x15a\x01\xD5W`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R`\x19` R`@\x90 \x86\x90U`\x06T\x86\x91\x16\x80;\x15a\x01\xD1W\x81\x90`$\x86Q\x80\x94\x81\x93clq*\xB9`\xE1\x1B\x83R\x88\x8B\x84\x01RZ\xF1\x80\x15a\x01\xC7Wa\x01\x99W[P\x81G\x10a\x01\x83W\x84\x80\x80\x93\x81\x93Z\xF1=\x15a\x01~Wg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF=\x81\x81\x11a\x01kW\x83Q\x91`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90\x81\x11\x83\x82\x10\x17a\x01VW\x84R\x81R\x84` =\x92\x01>[\x15a\x01IW\x82\x80\xF3[Qc\n\x12\xF5!`\xE1\x1B\x81R\xFD[`A\x86cNH{q`\xE0\x1B`\0RR`$`\0\xFD[cNH{q`\xE0\x1B\x86R`A\x85R`$\x86\xFD[a\x01@V[\x82Qc\xCDx`Y`\xE0\x1B\x81R0\x81\x86\x01R`$\x90\xFD[g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x96\x92\x96\x11a\x01\xB4W\x83R\x938a\0\xEFV[cNH{q`\xE0\x1B\x82R`A\x85R`$\x82\xFD[\x84Q=\x88\x82>=\x90\xFD[P\x80\xFD[\x84Qcg0\x0F\x91`\xE1\x1B\x81R\x86\x90\xFD[\x85\x80\xFD[\x82\x80\xFD[\x84\x90\x81`\x03\x196\x01\x12a\x01\xD1W\x80`\x01` \x92R\xF3\xFE\xA2dipfsX\"\x12 {\xE5\x17\x8E\r\x84\xAB\xF0tt\xDCR\0*m\xC58\x1D\x96\xE7Bi+]\x80\x16\xF0\xE1\x83\xECN4dsolcC\0\x08\x13\x003";
/// The bytecode of the contract.
pub static LIBSTAKING_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@\x81\x81R`\x04\x90\x816\x10\x15a\0\x16W`\0\x80\xFD[`\0\x92\x835`\xE0\x1C\x90\x81c!\xEE\xF6\x06\x14a\x01\xEDWPc\x82\x98^\x0B\x14a\0:W`\0\x80\xFD[0\x7F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x14a\x01\xE9W` 6`\x03\x19\x01\x12a\x01\xE9W\x815`\x01`\x01`\xA0\x1B\x03\x80\x82\x16\x90\x81\x83\x03a\x01\xE5W`\x01`\x01`\xA0\x1B\x03\x83\x16`\0\x90\x81R`\x19` R`@\x90 T\x92\x83\x15a\x01\xD5W`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R`\x19` R`@\x90 \x86\x90U`\x06T\x86\x91\x16\x80;\x15a\x01\xD1W\x81\x90`$\x86Q\x80\x94\x81\x93clq*\xB9`\xE1\x1B\x83R\x88\x8B\x84\x01RZ\xF1\x80\x15a\x01\xC7Wa\x01\x99W[P\x81G\x10a\x01\x83W\x84\x80\x80\x93\x81\x93Z\xF1=\x15a\x01~Wg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF=\x81\x81\x11a\x01kW\x83Q\x91`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90\x81\x11\x83\x82\x10\x17a\x01VW\x84R\x81R\x84` =\x92\x01>[\x15a\x01IW\x82\x80\xF3[Qc\n\x12\xF5!`\xE1\x1B\x81R\xFD[`A\x86cNH{q`\xE0\x1B`\0RR`$`\0\xFD[cNH{q`\xE0\x1B\x86R`A\x85R`$\x86\xFD[a\x01@V[\x82Qc\xCDx`Y`\xE0\x1B\x81R0\x81\x86\x01R`$\x90\xFD[g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x96\x92\x96\x11a\x01\xB4W\x83R\x938a\0\xEFV[cNH{q`\xE0\x1B\x82R`A\x85R`$\x82\xFD[\x84Q=\x88\x82>=\x90\xFD[P\x80\xFD[\x84Qcg0\x0F\x91`\xE1\x1B\x81R\x86\x90\xFD[\x85\x80\xFD[\x82\x80\xFD[\x84\x90\x81`\x03\x196\x01\x12a\x01\xD1W\x80`\x01` \x92R\xF3\xFE\xA2dipfsX\"\x12 \xAF\xA4G\xC9\xC0\xD4\x12\xB1\xE7\xFF\"\xDB_\xF2d\xE0\xD3U\xB4\x9F\x06\xB7\xC3\xE4\xD5\x9CO\xE6\xCC\xDB\xF0\x97dsolcC\0\x08\x13\x003";
const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@\x81\x81R`\x04\x90\x816\x10\x15a\0\x16W`\0\x80\xFD[`\0\x92\x835`\xE0\x1C\x90\x81c!\xEE\xF6\x06\x14a\x01\xEDWPc\x82\x98^\x0B\x14a\0:W`\0\x80\xFD[0\x7F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x14a\x01\xE9W` 6`\x03\x19\x01\x12a\x01\xE9W\x815`\x01`\x01`\xA0\x1B\x03\x80\x82\x16\x90\x81\x83\x03a\x01\xE5W`\x01`\x01`\xA0\x1B\x03\x83\x16`\0\x90\x81R`\x19` R`@\x90 T\x92\x83\x15a\x01\xD5W`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R`\x19` R`@\x90 \x86\x90U`\x06T\x86\x91\x16\x80;\x15a\x01\xD1W\x81\x90`$\x86Q\x80\x94\x81\x93clq*\xB9`\xE1\x1B\x83R\x88\x8B\x84\x01RZ\xF1\x80\x15a\x01\xC7Wa\x01\x99W[P\x81G\x10a\x01\x83W\x84\x80\x80\x93\x81\x93Z\xF1=\x15a\x01~Wg\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF=\x81\x81\x11a\x01kW\x83Q\x91`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90\x81\x11\x83\x82\x10\x17a\x01VW\x84R\x81R\x84` =\x92\x01>[\x15a\x01IW\x82\x80\xF3[Qc\n\x12\xF5!`\xE1\x1B\x81R\xFD[`A\x86cNH{q`\xE0\x1B`\0RR`$`\0\xFD[cNH{q`\xE0\x1B\x86R`A\x85R`$\x86\xFD[a\x01@V[\x82Qc\xCDx`Y`\xE0\x1B\x81R0\x81\x86\x01R`$\x90\xFD[g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x96\x92\x96\x11a\x01\xB4W\x83R\x938a\0\xEFV[cNH{q`\xE0\x1B\x82R`A\x85R`$\x82\xFD[\x84Q=\x88\x82>=\x90\xFD[P\x80\xFD[\x84Qcg0\x0F\x91`\xE1\x1B\x81R\x86\x90\xFD[\x85\x80\xFD[\x82\x80\xFD[\x84\x90\x81`\x03\x196\x01\x12a\x01\xD1W\x80`\x01` \x92R\xF3\xFE\xA2dipfsX\"\x12 {\xE5\x17\x8E\r\x84\xAB\xF0tt\xDCR\0*m\xC58\x1D\x96\xE7Bi+]\x80\x16\xF0\xE1\x83\xECN4dsolcC\0\x08\x13\x003";
/// The deployed bytecode of the contract.
pub static LIBSTAKING_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
Expand Down
4 changes: 2 additions & 2 deletions binding/src/lib_staking_change_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ pub mod lib_staking_change_log {
pub static LIBSTAKINGCHANGELOG_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`\x80\x80`@R4`\x17W`:\x90\x81`\x1D\x8290\x81PP\xF3[`\0\x80\xFD\xFE`\0\x80\xFD\xFE\xA2dipfsX\"\x12 P\x1F\xD0\xE7\x0Cr\xD0\xAB\xD3\xFA\xFC\x161\x18\xDB\xD7ZX\x15\xEA\xFE\x9F\x0Fx\xE2\x82\xDF\xB8pe\x0B\xE1dsolcC\0\x08\x13\x003";
const __BYTECODE: &[u8] = b"`\x80\x80`@R4`\x17W`:\x90\x81`\x1D\x8290\x81PP\xF3[`\0\x80\xFD\xFE`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xCF\xD9|i\xE4*\xE1k\xC0\x7F\x88\xCC7+\xAE\xF2\xB2\x7F|\xE4\xDC\xA2\x1A\x9C\xE2\xFE\xB1;w\xD4\xAC\x7FdsolcC\0\x08\x13\x003";
/// The bytecode of the contract.
pub static LIBSTAKINGCHANGELOG_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"`\0\x80\xFD\xFE\xA2dipfsX\"\x12 P\x1F\xD0\xE7\x0Cr\xD0\xAB\xD3\xFA\xFC\x161\x18\xDB\xD7ZX\x15\xEA\xFE\x9F\x0Fx\xE2\x82\xDF\xB8pe\x0B\xE1dsolcC\0\x08\x13\x003";
const __DEPLOYED_BYTECODE: &[u8] = b"`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xCF\xD9|i\xE4*\xE1k\xC0\x7F\x88\xCC7+\xAE\xF2\xB2\x7F|\xE4\xDC\xA2\x1A\x9C\xE2\xFE\xB1;w\xD4\xAC\x7FdsolcC\0\x08\x13\x003";
/// The deployed bytecode of the contract.
pub static LIBSTAKINGCHANGELOG_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
Expand Down
2 changes: 1 addition & 1 deletion binding/src/subnet_actor_diamond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub mod subnet_actor_diamond {
pub static SUBNETACTORDIAMOND_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R6\x15`\x91W`\0\x805`\x01`\x01`\xE0\x1B\x03\x19\x16\x80\x82R\x7F\x80n\x0C\xBB\x9F\xCE)k\xBC3jH\xF4+\xF1\xDB\xC6\x97\"\xD1\x8D\x90\xD6\xFEp[u\x82\xC2\xBBK\xD2` R`@\x82 T`\x01`\x01`\xA0\x1B\x03\x16\x90\x81\x15`oWP\x81\x80\x916\x82\x807\x816\x91Z\xF4=\x82\x80>\x15`kW=\x90\xF3[=\x90\xFD[c\n\x82\xDDs`\xE3\x1B`\x80R`\x01`\x01`\xE0\x1B\x03\x19\x16`\x84R`\x7F\x19`\xA4\x01`\x80\xFD[`\x06T`\x01`\x01`\xA0\x1B\x03\x163\x03`\xA4W\0[c\xE7\xE6\x01\xDB`\xE0\x1B`\x80R`\x04`\x80\xFD\xFE\xA2dipfsX\"\x12 \x88\x19\xE1\xE1r\xC9nR\x8Bv\xC5\xE9\n\x91D\xCD\x8B\xA7\x921&\x92\xFE\x9E\x1EA\n9\xB6\xFD\xAEZdsolcC\0\x08\x13\x003";
const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R6\x15`\x91W`\0\x805`\x01`\x01`\xE0\x1B\x03\x19\x16\x80\x82R\x7F\x80n\x0C\xBB\x9F\xCE)k\xBC3jH\xF4+\xF1\xDB\xC6\x97\"\xD1\x8D\x90\xD6\xFEp[u\x82\xC2\xBBK\xD2` R`@\x82 T`\x01`\x01`\xA0\x1B\x03\x16\x90\x81\x15`oWP\x81\x80\x916\x82\x807\x816\x91Z\xF4=\x82\x80>\x15`kW=\x90\xF3[=\x90\xFD[c\n\x82\xDDs`\xE3\x1B`\x80R`\x01`\x01`\xE0\x1B\x03\x19\x16`\x84R`\x7F\x19`\xA4\x01`\x80\xFD[`\x06T`\x01`\x01`\xA0\x1B\x03\x163\x03`\xA4W\0[c\xE7\xE6\x01\xDB`\xE0\x1B`\x80R`\x04`\x80\xFD\xFE\xA2dipfsX\"\x12 \xBA\xB0*4\xDBU\xC3\x89t\xE4\"\xC7>\xD3\r\xE0\x9C\xCC\x9A\xA8|}-\\\nt\xEA\x0BZKr>dsolcC\0\x08\x13\x003";
/// The deployed bytecode of the contract.
pub static SUBNETACTORDIAMOND_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
Expand Down
79 changes: 79 additions & 0 deletions binding/src/subnet_actor_getter_facet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,36 @@ pub mod subnet_actor_getter_facet {
},
],
),
(
::std::borrow::ToOwned::to_owned("getRelayerReward"),
::std::vec![
::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("getRelayerReward"),
inputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("relayer"),
kind: ::ethers::core::abi::ethabi::ParamType::Address,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("address"),
),
},
],
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("getValidator"),
::std::vec![
Expand Down Expand Up @@ -814,6 +844,15 @@ pub mod subnet_actor_getter_facet {
.method_hash([128, 247, 96, 33], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `getRelayerReward` (0xb2bd295e) function
pub fn get_relayer_reward(
&self,
relayer: ::ethers::core::types::Address,
) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
self.0
.method_hash([178, 189, 41, 94], relayer)
.expect("method not found (this should never happen)")
}
///Calls the contract's `getValidator` (0x1904bb2e) function
pub fn get_validator(
&self,
Expand Down Expand Up @@ -1072,6 +1111,21 @@ pub mod subnet_actor_getter_facet {
)]
#[ethcall(name = "getParent", abi = "getParent()")]
pub struct GetParentCall;
///Container type for all input parameters for the `getRelayerReward` function with signature `getRelayerReward(address)` and selector `0xb2bd295e`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "getRelayerReward", abi = "getRelayerReward(address)")]
pub struct GetRelayerRewardCall {
pub relayer: ::ethers::core::types::Address,
}
///Container type for all input parameters for the `getValidator` function with signature `getValidator(address)` and selector `0x1904bb2e`
#[derive(
Clone,
Expand Down Expand Up @@ -1256,6 +1310,7 @@ pub mod subnet_actor_getter_facet {
GetBootstrapNodes(GetBootstrapNodesCall),
GetConfigurationNumbers(GetConfigurationNumbersCall),
GetParent(GetParentCall),
GetRelayerReward(GetRelayerRewardCall),
GetValidator(GetValidatorCall),
HasSubmittedInLastBottomUpCheckpointHeight(HasSubmittedInLastBottomUpCheckpointHeightCall),
IpcGatewayAddr(IpcGatewayAddrCall),
Expand Down Expand Up @@ -1323,6 +1378,11 @@ pub mod subnet_actor_getter_facet {
if let Ok(decoded) = <GetParentCall as ::ethers::core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetParent(decoded));
}
if let Ok(decoded) =
<GetRelayerRewardCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::GetRelayerReward(decoded));
}
if let Ok(decoded) = <GetValidatorCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::GetValidator(decoded));
Expand Down Expand Up @@ -1404,6 +1464,7 @@ pub mod subnet_actor_getter_facet {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::GetParent(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::GetRelayerReward(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::GetValidator(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::HasSubmittedInLastBottomUpCheckpointHeight(element) => {
::ethers::core::abi::AbiEncode::encode(element)
Expand Down Expand Up @@ -1445,6 +1506,7 @@ pub mod subnet_actor_getter_facet {
Self::GetBootstrapNodes(element) => ::core::fmt::Display::fmt(element, f),
Self::GetConfigurationNumbers(element) => ::core::fmt::Display::fmt(element, f),
Self::GetParent(element) => ::core::fmt::Display::fmt(element, f),
Self::GetRelayerReward(element) => ::core::fmt::Display::fmt(element, f),
Self::GetValidator(element) => ::core::fmt::Display::fmt(element, f),
Self::HasSubmittedInLastBottomUpCheckpointHeight(element) => {
::core::fmt::Display::fmt(element, f)
Expand Down Expand Up @@ -1519,6 +1581,11 @@ pub mod subnet_actor_getter_facet {
Self::GetParent(value)
}
}
impl ::core::convert::From<GetRelayerRewardCall> for SubnetActorGetterFacetCalls {
fn from(value: GetRelayerRewardCall) -> Self {
Self::GetRelayerReward(value)
}
}
impl ::core::convert::From<GetValidatorCall> for SubnetActorGetterFacetCalls {
fn from(value: GetValidatorCall) -> Self {
Self::GetValidator(value)
Expand Down Expand Up @@ -1716,6 +1783,18 @@ pub mod subnet_actor_getter_facet {
Hash,
)]
pub struct GetParentReturn(pub SubnetID);
///Container type for all return fields from the `getRelayerReward` function with signature `getRelayerReward(address)` and selector `0xb2bd295e`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct GetRelayerRewardReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `getValidator` function with signature `getValidator(address)` and selector `0x1904bb2e`
#[derive(
Clone,
Expand Down
1 change: 1 addition & 0 deletions lib/elliptic-curve-solidity
3 changes: 2 additions & 1 deletion remappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"fevmate=lib/fevmate/contracts",
"murky/=lib/murky/src"
"murky/=lib/murky/src",
"elliptic-curve-solidity/=lib/elliptic-curve-solidity"
]
}
3 changes: 2 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/
fevmate=lib/fevmate/contracts
murky/=lib/murky/src
murky/=lib/murky/src
elliptic-curve-solidity/=lib/elliptic-curve-solidity
1 change: 0 additions & 1 deletion src/gateway/GatewayManagerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ contract GatewayManagerFacet is GatewayActorModifiers, ReentrancyGuard {
if (subnet.stake < s.minStake) {
subnet.status = Status.Inactive;
}

payable(subnet.id.getActor()).sendValue(amount);
}

Expand Down
10 changes: 9 additions & 1 deletion src/subnet/SubnetActorGetterFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ contract SubnetActorGetterFacet {
return (exists, checkpoint.toHash());
}

/// @notice returns the power scale in number of decimals from whole FIL
function powerScale() external view returns (int8) {
return s.powerScale;
}
Expand All @@ -140,8 +141,15 @@ contract SubnetActorGetterFacet {
return nodes;
}

// This exists for testing purposes.
/// @notice This exists for testing purposes.
/// @param messages - cross-messages to hash
function crossMsgsHash(CrossMsg[] calldata messages) external pure returns (bytes32) {
return keccak256(abi.encode(messages));
}

/// @notice Returns the current reward for the relayer
/// @param relayer - relayer address
function getRelayerReward(address relayer) external view returns (uint256) {
return s.relayerRewards[relayer];
}
}
Loading

0 comments on commit 6194844

Please sign in to comment.