Skip to content

Instantly share code, notes, and snippets.

View CyberHoward's full-sized avatar
🧨

CyberHoward

🧨
View GitHub Profile
@CyberHoward
CyberHoward / test.rs
Last active June 16, 2022 10:14
Test
fn main() {
println!("Hello World!")
}
@CyberHoward
CyberHoward / PoC.rs
Last active August 31, 2022 08:24
[ Proof of Concept ] Environment-generic test and deployment scripting for CosmWasm contracts in Rust.
#![allow(unused)]
use std::marker::PhantomData;
/// Goal: Create a generic interface to perform integration tests and live tests/deployments with minimal syntax.
///
/// Why: This would give developers the ability to easily interact with their contracts in different environments without much syntax changes.
/// It also speeds up development by replacing time-consuming and error-prone bash/typescript deployment scripts and it would speed up
/// the testing process as the contract calls are much more concise and easy to read.
use serde::Serialize;
@CyberHoward
CyberHoward / cosm-rust-script-example.rs
Created August 30, 2022 14:43
Example of a deployment script used by Abstract.
/// One of the scripts that deploys my contracts
/// Just look at the readability compared to a bash script!
pub async fn script() -> anyhow::Result<()> {
let (config, sender) = &get_configuration().await?;
let (memory, os_factory, version_control, module_factory) =
get_native_contracts(config, sender)?;
let (manager, proxy) = get_core_contracts(config, sender, None)?;
let (liquidity_interface, subscription) = get_add_ons(config, sender)?;
let (dex_api, staking_api) = get_apis(config, sender)?;
pub struct Deployment<'a, Chain: BootEnvironment> {
pub chain: &'a Chain,
pub version: Version,
pub ans_host: AnsHost<Chain>,
pub version_control: VersionControl<Chain>,
pub os_factory: OSFactory<Chain>,
pub module_factory: ModuleFactory<Chain>,
pub ibc_client: IbcClient<Chain>,
}
@CyberHoward
CyberHoward / optimize.sh
Created June 20, 2023 16:39
Arch agnostic optimize command
#!/usr/bin/env bash
if [[ $(arch) == "arm64" ]]; then
image="cosmwasm/workspace-optimizer-arm64"
else
image="cosmwasm/workspace-optimizer"
fi
# Optimized builds
docker run --rm -v "$(pwd)":/code \
@CyberHoward
CyberHoward / Dockerfile
Created September 8, 2023 09:39
Test-tube x86 Docker Coverage
FROM --platform=linux/amd64 rust:1.72 as base
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
gcc \
libclang-dev \
ca-certificates \
--no-install-recommends \