Skip to content

Commit

Permalink
use debian bookworm-slim (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege authored Feb 26, 2024
1 parent b5f9465 commit c3e940c
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 29 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

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

82 changes: 81 additions & 1 deletion evm/abi/src/generated/host_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub mod host_manager {
::ethers::core::abi::ethabi::Contract {
constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor {
inputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("params"),
name: ::std::borrow::ToOwned::to_owned("managerParams"),
kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Address,
Expand Down Expand Up @@ -206,6 +206,26 @@ pub mod host_manager {
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("params"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("params"),
inputs: ::std::vec![],
outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
],),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("struct HostManagerParams"),
),
},],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("setIsmpHost"),
::std::vec![::ethers::core::abi::ethabi::Function {
Expand Down Expand Up @@ -317,6 +337,12 @@ pub mod host_manager {
.method_hash([18, 178, 82, 79], (p0,))
.expect("method not found (this should never happen)")
}
///Calls the contract's `params` (0xcff0ab96) function
pub fn params(&self) -> ::ethers::contract::builders::ContractCall<M, HostManagerParams> {
self.0
.method_hash([207, 240, 171, 150], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `setIsmpHost` (0x0e8324a2) function
pub fn set_ismp_host(
&self,
Expand Down Expand Up @@ -441,6 +467,20 @@ pub mod host_manager {
abi = "onPostResponseTimeout(((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64),bytes,uint64,uint64))"
)]
pub struct OnPostResponseTimeoutCall(pub PostResponse);
///Container type for all input parameters for the `params` function with signature `params()`
/// and selector `0xcff0ab96`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "params", abi = "params()")]
pub struct ParamsCall;
///Container type for all input parameters for the `setIsmpHost` function with signature
/// `setIsmpHost(address)` and selector `0x0e8324a2`
#[derive(
Expand All @@ -466,6 +506,7 @@ pub mod host_manager {
OnPostRequestTimeout(OnPostRequestTimeoutCall),
OnPostResponse(OnPostResponseCall),
OnPostResponseTimeout(OnPostResponseTimeoutCall),
Params(ParamsCall),
SetIsmpHost(SetIsmpHostCall),
}
impl ::ethers::core::abi::AbiDecode for HostManagerCalls {
Expand Down Expand Up @@ -499,6 +540,9 @@ pub mod host_manager {
{
return Ok(Self::OnPostResponseTimeout(decoded));
}
if let Ok(decoded) = <ParamsCall as ::ethers::core::abi::AbiDecode>::decode(data) {
return Ok(Self::Params(decoded));
}
if let Ok(decoded) = <SetIsmpHostCall as ::ethers::core::abi::AbiDecode>::decode(data) {
return Ok(Self::SetIsmpHost(decoded));
}
Expand All @@ -516,6 +560,7 @@ pub mod host_manager {
Self::OnPostResponse(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::OnPostResponseTimeout(element) =>
::ethers::core::abi::AbiEncode::encode(element),
Self::Params(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::SetIsmpHost(element) => ::ethers::core::abi::AbiEncode::encode(element),
}
}
Expand All @@ -529,6 +574,7 @@ pub mod host_manager {
Self::OnPostRequestTimeout(element) => ::core::fmt::Display::fmt(element, f),
Self::OnPostResponse(element) => ::core::fmt::Display::fmt(element, f),
Self::OnPostResponseTimeout(element) => ::core::fmt::Display::fmt(element, f),
Self::Params(element) => ::core::fmt::Display::fmt(element, f),
Self::SetIsmpHost(element) => ::core::fmt::Display::fmt(element, f),
}
}
Expand Down Expand Up @@ -563,9 +609,43 @@ pub mod host_manager {
Self::OnPostResponseTimeout(value)
}
}
impl ::core::convert::From<ParamsCall> for HostManagerCalls {
fn from(value: ParamsCall) -> Self {
Self::Params(value)
}
}
impl ::core::convert::From<SetIsmpHostCall> for HostManagerCalls {
fn from(value: SetIsmpHostCall) -> Self {
Self::SetIsmpHost(value)
}
}
///Container type for all return fields from the `params` function with signature `params()`
/// and selector `0xcff0ab96`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct ParamsReturn(pub HostManagerParams);
///`HostManagerParams(address,address,uint256)`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct HostManagerParams {
pub admin: ::ethers::core::types::Address,
pub host: ::ethers::core::types::Address,
pub para_id: ::ethers::core::types::U256,
}
}
1 change: 1 addition & 0 deletions evm/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pallet-ismp = { path = "../../modules/ismp/pallet" }
ismp-solidity-abi = { path = "../abi", features = ["build-abi"] }
beefy-prover = { path = "../../modules/consensus/beefy/prover", default-features = false }
beefy-verifier-primitives = { path = "../../modules/consensus/beefy/primitives" }
pallet-relayer-fees = { path = "../../modules/relayer-fees" }

rs_merkle = { git = "https://github.com/polytope-labs/rs-merkle", branch = "seun/2d-merkle-proofs" }
foundry-evm = { git = "https://github.com/polytope-labs/foundry", rev = "068ef4d82e8421f9f96fdc33b061dc4848b7019a" }
27 changes: 11 additions & 16 deletions evm/integration-tests/src/tests/host_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ use ismp::{
host::{Ethereum, StateMachine},
router::Post,
};
use ismp_solidity_abi::{
evm_host::{HostParams, WithdrawParams},
shared_types::PostRequest,
};
use ismp_solidity_abi::{evm_host::HostParams, shared_types::PostRequest};
use pallet_relayer_fees::withdrawal::WithdrawalParams;
use primitive_types::{H160, U256};
use std::{env, path::PathBuf};

Expand All @@ -18,12 +16,11 @@ async fn test_host_manager_withdraw() -> Result<(), anyhow::Error> {
let mut runner = Runner::new(PathBuf::from(&base_dir));
let mut contract = runner.deploy("HostManagerTest").await;

let params = WithdrawParams {
beneficiary: H160::random(),
let params = WithdrawalParams {
beneficiary_address: H160::random().as_bytes().to_vec(),
amount: U256::from(500_000_000_000_000_000_000u128),
};
let mut data = vec![0u8];
data.extend_from_slice(params.encode().as_slice());
let data = params.abi_encode();

// create post request object
let post = Post {
Expand Down Expand Up @@ -51,12 +48,11 @@ async fn test_host_manager_unauthorized_request() -> Result<(), anyhow::Error> {
let mut runner = Runner::new(PathBuf::from(&base_dir));
let mut contract = runner.deploy("HostManagerTest").await;

let params = WithdrawParams {
beneficiary: H160::random(),
let params = WithdrawalParams {
beneficiary_address: H160::random().as_bytes().to_vec(),
amount: U256::from(500_000_000_000_000_000_000u128),
};
let mut data = vec![0u8];
data.extend_from_slice(params.encode().as_slice());
let data = params.abi_encode();

// create post request object
let post = Post {
Expand Down Expand Up @@ -93,12 +89,11 @@ async fn test_host_manager_insufficient_balance() -> Result<(), anyhow::Error> {
let mut runner = Runner::new(PathBuf::from(&base_dir));
let mut contract = runner.deploy("HostManagerTest").await;

let params = WithdrawParams {
beneficiary: H160::random(),
let params = WithdrawalParams {
beneficiary_address: H160::random().as_bytes().to_vec(),
amount: U256::from(500_000_000_000_000_000_000u128),
};
let mut data = vec![0u8];
data.extend_from_slice(params.encode().as_slice());
let data = params.abi_encode();

// create post request object
let post = Post {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ finality-grandpa = { version = "0.16.0", features = ["derive-codec"], default-fe

# polytope labs
ismp = { git = "https://github.com/polytope-labs/ismp-rs", branch = "main", default-features = false }
primitives = { package = "ismp-grandpa-primitives", path = "./primitives", default-features = false }
verifier = { package = "ismp-grandpa-verifier", path = "./verifier", default-features = false}
primitives = { package = "ismp-grandpa-primitives", path = "primitives", default-features = false }
verifier = { package = "ismp-grandpa-verifier", path = "verifier", default-features = false}
pallet-ismp = { path = "../pallet-ismp", default-features = false }


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion parachain/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hyperbridge"
version = "0.3.1"
version = "0.3.2"
authors = ["Polytope Labs <hello@polytope.technology>"]
description = "The Hyperbridge coprocessor node"
repository = "https://github.com/polytope-labs/hyperbridge"
Expand Down
7 changes: 0 additions & 7 deletions scripts/docker/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/docker/slim.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/debian:bullseye-slim
FROM docker.io/library/debian:bookworm-slim

RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates

Expand Down

0 comments on commit c3e940c

Please sign in to comment.