Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABS-166: Create accountability module #47

Merged
merged 73 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
917c736
create initial structure
0xmovses Aug 22, 2023
4539d87
create initial state
0xmovses Aug 22, 2023
afa4a1b
create handlers and msg
0xmovses Aug 22, 2023
b2f9d0a
create execute handler
0xmovses Aug 22, 2023
a938ec1
update names update state
0xmovses Aug 23, 2023
820eaeb
update handlers
0xmovses Aug 23, 2023
c511e32
add vote handler logic
0xmovses Aug 23, 2023
58ba5ef
fix handler compiler errors
0xmovses Aug 23, 2023
a34af41
Merge branch 'main' into 0xmovses/abs-166
0xmovses Aug 24, 2023
0cd6d9c
refactor, cleanup
0xmovses Aug 24, 2023
bf9d63b
update execute msg, more refactors
0xmovses Aug 24, 2023
7ddc6d6
create wasm test update toml
0xmovses Aug 24, 2023
c392981
create wasm test and setup for e2e
0xmovses Aug 24, 2023
4ebf3e0
Merge branch 'main' into 0xmovses/abs-166
0xmovses Aug 28, 2023
cdd2bde
create integration tests
0xmovses Aug 28, 2023
33662d7
add more tests
0xmovses Aug 28, 2023
8455147
add friend test cases
0xmovses Aug 29, 2023
0761101
add vote cases
0xmovses Aug 29, 2023
56f232b
updates
0xmovses Aug 29, 2023
bc02d4b
integrate adairrr feedback
0xmovses Aug 29, 2023
80c0057
update charge_penalty logic
0xmovses Aug 29, 2023
fa3912b
rebuilt wasms
0xmovses Aug 29, 2023
2302041
fix merge conflict
0xmovses Aug 29, 2023
485f696
rebuilt wasms
0xmovses Aug 30, 2023
0749614
fix tests and cleanup
0xmovses Aug 30, 2023
a109ada
clippy
0xmovses Aug 30, 2023
7f67ea4
integrate PR feedback
0xmovses Aug 31, 2023
23995ff
add impl methods on Vote and Friend
0xmovses Aug 31, 2023
0c2902d
update tests
0xmovses Aug 31, 2023
d97f69a
fix tests, refactor, cleanup
0xmovses Aug 31, 2023
29ba36a
integrate Buckram feedback
0xmovses Aug 31, 2023
1ccc033
add admin strike functionality and add challenge status
0xmovses Sep 1, 2023
668482f
update charge_penalty logic
0xmovses Sep 1, 2023
747ba8b
fix failing tests
0xmovses Sep 4, 2023
8159030
fix flaxy test, add remainder attribute
0xmovses Sep 4, 2023
c1ee4f9
merge main
0xmovses Sep 4, 2023
665ee6e
update to Timestamp use EndKind enum for user input
0xmovses Sep 4, 2023
faf7d92
add Timestamp to Checkin and vote_status
0xmovses Sep 4, 2023
a82034f
update contract logic
0xmovses Sep 4, 2023
f972ac5
remodel state, fix new ownership errors
0xmovses Sep 5, 2023
47fc6ff
update charge penalty math and state
0xmovses Sep 5, 2023
fa1b70a
fix tests intergrate feedback
0xmovses Sep 5, 2023
586ad1d
Merge branch 'main' into 0xmovses/abs-166
0xmovses Sep 5, 2023
78bfb14
update composite key and field names
0xmovses Sep 5, 2023
bea1879
update test after composite keys change
0xmovses Sep 5, 2023
b0b96ad
remove redundant
0xmovses Sep 5, 2023
667b32a
update comments
0xmovses Sep 5, 2023
4e5416f
update responses
0xmovses Sep 6, 2023
2038c82
add transfer msg
0xmovses Sep 6, 2023
9551a41
clippy
0xmovses Sep 6, 2023
33eb190
clippy more
0xmovses Sep 6, 2023
9be126f
run release_build
0xmovses Sep 6, 2023
0d4be6e
Update modules/contracts/apps/challenge/src/handlers/execute.rs
0xmovses Sep 6, 2023
a2df780
Update modules/contracts/apps/challenge/src/handlers/execute.rs
0xmovses Sep 6, 2023
022645f
integrate buckram feedback
0xmovses Sep 6, 2023
258e3a7
integrate Buckram feedback
0xmovses Sep 7, 2023
5aaacea
Merge branch 'main' into 0xmovses/abs-166
0xmovses Sep 7, 2023
6f763b5
generate schema
0xmovses Sep 7, 2023
e7c5a39
Merge branch 'main' into 0xmovses/abs-166
0xmovses Sep 7, 2023
58231c1
bump osmosis-test-tube
0xmovses Sep 7, 2023
b373994
Merge branch '0xmovses/abs-166' of https://github.com/AbstractSDK/abs…
0xmovses Sep 7, 2023
16977e7
Merge branch 'main' into 0xmovses/abs-166
0xmovses Sep 7, 2023
c1347ff
integrate buckram123 feedback
0xmovses Sep 7, 2023
a396d06
Merge branch '0xmovses/abs-166' of https://github.com/AbstractSDK/abs…
0xmovses Sep 7, 2023
a3568ae
merge main
0xmovses Sep 7, 2023
5f17a3b
Merge branch 'main' into 0xmovses/abs-166
0xmovses Sep 9, 2023
4133407
bump chrono
0xmovses Sep 9, 2023
00daa8a
bump chrono again
0xmovses Sep 9, 2023
05910db
chrono to 0.4.23
0xmovses Sep 9, 2023
2c7a03b
chrono to 0.4.27
0xmovses Sep 11, 2023
eee9c73
merge main
0xmovses Sep 11, 2023
7060482
chrono to 0.4.23
0xmovses Sep 11, 2023
5d26c7e
croncat version bump
Buckram123 Sep 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app-template/artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2ea249ee0244d88defe24e09de2ba63f829614cb8866e7d74c9daa2ede7f4d2 app.wasm
4e4b097907a9eb0a31d4757f73ba741ca4452e1b9f632a4500cc1dfbeba01f4d app-aarch64.wasm
2 changes: 1 addition & 1 deletion app-template/artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9a0d0614b1b6ddc9707739b30ab330ff65c6f244fdfd3893c6f7fca5b471b0e8 ./target/wasm32-unknown-unknown/release/app.wasm
6a3347162d4e89d6aebafd8c7cbd40c686d8161e4b68797b39e1ca49bb4cfb49 ./target/wasm32-unknown-unknown/release/app.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ thiserror = { version = "1.0.31" }
cw-multi-test = "0.13.2"
prost = "0.11.0"
serde_json = "1.0.85"
osmosis-test-tube = "15.1.0"
osmosis-test-tube = "19.0.0"
1 change: 1 addition & 0 deletions modules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ serde = { version = "1.0", default-features = false, features = ["derive"] }
thiserror = { version = "1.0" }
protobuf = { version = "2", features = ["with-bytes"] }

chrono = { version = "0.4", default-features = false }
clap = { version = "4.0.32", features = ["derive"] }
semver = "1.0"
cw-semver = { version = "1.0" }
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added modules/artifacts/abstract_dca_app-aarch64.wasm
Binary file not shown.
Binary file not shown.
Binary file added modules/artifacts/abstract_etf-aarch64.wasm
Binary file not shown.
Binary file not shown.
14 changes: 8 additions & 6 deletions modules/artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
19c6b70fbc7a42c21165d05190bfe978d77aa3dceaa8093e0e7b70258a3a931f target/wasm32-unknown-unknown/release/abstract_cw_staking.wasm
e64b57a6a2ab0b1c17bc4a403270392720be1e187ecf876a6ec46a3ca418c03d target/wasm32-unknown-unknown/release/abstract_dca_app.wasm
64e9f9d7d6cf17c75fdef0f8b09f1202ca9519a8c5da9d451c5d665bc5f291dd target/wasm32-unknown-unknown/release/abstract_dex_adapter.wasm
228771942dbc36dd7645004f9b402dcfcf3aee034b9a652fdf88a8e1d5dfcd30 target/wasm32-unknown-unknown/release/abstract_etf.wasm
f17185d2c579b1edf96b895b213e46a418b86af1e01add63ac4d24df27b248e3 target/wasm32-unknown-unknown/release/abstract_tendermint_staking_adapter.wasm
f70d503da22a814e516a658926a2109e9837a1ab58ec6ee8dd482cce27a95b2c target/wasm32-unknown-unknown/release/croncat_app.wasm
f6ff4989cbc6aac3d5ada6ebe6c4ea00d7bd1b2b889506d0f3cfba6c35d2fd7b target/wasm32-unknown-unknown/release/abstract_challenge_app.wasm
049aaf16853b1bb40841360d9f4763326cd338880dadbf7179d9b3fee073f3a8 target/wasm32-unknown-unknown/release/abstract_cw_staking.wasm
1e964735ea5b06b2040b258ee3d2d3c0b2f82ffaa2a3e4765c4ddfcdb66faaae target/wasm32-unknown-unknown/release/abstract_dca_app.wasm
3d16149cc183f6d75e8c665d5f9a9f2d32ed10beec54627db60f613845fa6e4c target/wasm32-unknown-unknown/release/abstract_dex_adapter.wasm
b0ab08be4104af9d09d812aed56ac24b3f197e5e2f9aec702e9bd61f0c75fedc target/wasm32-unknown-unknown/release/abstract_etf.wasm
81d2a2090c5baca4c8054f893742426377d2528c614350a65efeeea7394aedb3 target/wasm32-unknown-unknown/release/abstract_tendermint_staking_adapter.wasm
d2204708c0925b41ef75f5744cec3bf2e02793107b95b02fe398344c4dd18503 target/wasm32-unknown-unknown/release/croncat_app.wasm

Binary file added modules/artifacts/croncat_app-aarch64.wasm
Binary file not shown.
78 changes: 78 additions & 0 deletions modules/contracts/apps/challenge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[package]
name = "abstract-challenge-app"
version = "0.0.1"
authors = [
"CyberHoward <[email protected]>",
"Adair <[email protected]>",
"Abstract Money <[email protected]>",
"0xmovses <[email protected]>",
]
edition = "2021"
homepage = ""
documentation = ""
repository = ""
license = "GPL-3.0-or-later"
keywords = ["cosmos", "cosmwasm", "abstractsdk"]
resolver = "2"

exclude = ["contract.wasm", "hash.txt"]

[lib]
crate-type = ["cdylib", "rlib"]

[[example]]
name = "schema"
required-features = ["schema"]

[features]
default = ["export"]
export = []
# enable node-backed tests (ensure Docker is running)
# run with `cargo test --jobs 1 --features node-tests`
node-tests = ["interface"]
interface = ["export", "dep:abstract-interface", "dep:cw-orch"]
schema = ["abstract-app/schema"]

[dependencies]
cosmwasm-std = { workspace = true }
cosmwasm-schema = { workspace = true }
cw-address-like = { workspace = true }
cw-controllers = { workspace = true }
cw-storage-plus = { workspace = true }
thiserror = { workspace = true }
schemars = { workspace = true }
cw-asset = { workspace = true }
cw-utils = { workspace = true }

abstract-core = { workspace = true }
abstract-app = { workspace = true }
abstract-sdk = { workspace = true }

chrono = { workspace = true, default-features = false }

# Dependencies for interface
abstract-interface = { workspace = true, optional = true }
cw-orch = { workspace = true, optional = true }
croncat-app = { workspace = true, default-features = false }
abstract-dex-adapter = { workspace = true, default-features = false }

[dev-dependencies]
abstract-challenge-app = { path = ".", features = ["interface"] }
abstract-interface = { workspace = true, features = ["daemon"] }
abstract-testing = { workspace = true }
abstract-sdk = { workspace = true, features = ["test-utils"] }
speculoos = "0.11.0"
semver = "1.0"
dotenv = "0.15.0"
env_logger = "0.10.0"
cw-orch = { workspace = true, features = ["daemon"] }
lazy_static = "1.4.0"

croncat-integration-testing = { version = "1.1.0" }
wyndex-bundle = { workspace = true }
abstract-dex-adapter = { workspace = true, features = [
"interface",
"juno",
"testing",
] }
croncat-app = { workspace = true, features = ["interface"] }
0xmovses marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
28 changes: 28 additions & 0 deletions modules/contracts/apps/challenge/examples/deploy.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use cw_orch::{
anyhow,
prelude::{networks::parse_network, DaemonBuilder},
tokio::runtime::Runtime,
};

use abstract_challenge_app::{contract::CHALLENGE_APP_ID, ChallengeApp};
use abstract_interface::AppDeployer;
use semver::Version;

const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

fn main() -> anyhow::Result<()> {
0xmovses marked this conversation as resolved.
Show resolved Hide resolved
dotenv().ok();
env_logger::init();
let chain = parse_network("uni-6");
0xmovses marked this conversation as resolved.
Show resolved Hide resolved
use dotenv::dotenv;
let version: Version = CONTRACT_VERSION.parse().unwrap();
let rt = Runtime::new()?;
let chain = DaemonBuilder::default()
.chain(chain)
.handle(rt.handle())
.build()?;
let app = ChallengeApp::new(CHALLENGE_APP_ID, chain);

app.deploy(version)?;
Ok(())
}
14 changes: 14 additions & 0 deletions modules/contracts/apps/challenge/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use abstract_challenge_app::contract::ChallengeApp as App;
use cosmwasm_schema::remove_schemas;
use std::env::current_dir;
use std::fs::create_dir_all;

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

#[cfg(feature = "schema")]
App::export_schema(&out_dir);
}
110 changes: 110 additions & 0 deletions modules/contracts/apps/challenge/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Install the tools that are used in this justfile
install-tools:
cargo install cargo-nextest --locked
cargo install taplo-cli --locked
cargo install cargo-watch
cargo install cargo-limit

# Build everything
build:
cargo build --all-features

# Test everything
test:
cargo nextest run

watch-test:
cargo watch -x "nextest run"

# Format your code and `Cargo.toml` files
fmt:
cargo fmt --all
find . -type f -iname "*.toml" -print0 | xargs -0 taplo format

lint:
cargo clippy --all -- -D warnings

lintfix:
cargo clippy --fix --allow-staged --allow-dirty --all-features
just fmt

watch:
cargo watch -x "lcheck --all-features"

check:
cargo check --all-features

deploy:
cargo run --example deploy --features

wasm:
#!/usr/bin/env bash

# Delete all the current wasms first
rm -rf ./artifacts/*.wasm

if [[ $(arch) == "arm64" ]]; then
image="cosmwasm/rust-optimizer-arm64"
else
image="cosmwasm/rust-optimizer"
fi

# Optimized builds
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
${image}:0.12.13

# Generate the schemas for the app contract
schema:
cargo schema

# Generate the typescript client for the app contract
ts-codegen: schema
(cd typescript && npm run codegen)

# Publish the typescript sdk
ts-publish: ts-codegen
(cd typescript && npm publish --access public)

# Generate the schemas for this app and publish them to the schemas repository for access in the Abstract frontend
publish-schemas namespace name version: schema
#!/usr/bin/env bash
set -euxo pipefail

# Pre-run check for 'gh' CLI tool
if ! command -v gh &> /dev/null; then \
echo "'gh' could not be found. Please install GitHub CLI."; exit; \
fi

# check that the metadata exists
if [ ! -e "./metadata.json" ]; then \
echo "Please create metadata.json for module metadata"; exit; \
fi

tmp_dir="$(mktemp -d)"
schema_out_dir="$tmp_dir/{{namespace}}/{{name}}/{{version}}"
metadata_out_dir="$tmp_dir/{{namespace}}/{{name}}"

# Clone the repository to the temporary directory
git clone https://github.com/AbstractSDK/schemas "$tmp_dir"

# Create target directory structure and copy schemas
mkdir -p "$schema_out_dir"
cp -a "./schema/." "$schema_out_dir"

# Copy metadata.json to the target directory
cp "./metadata.json" "$metadata_out_dir"

# Create a new branch with a name based on the inputs
cd "$tmp_dir"
git checkout -b '{{namespace}}/{{name}}/{{version}}'

# Stage all new and changed files for commit
git add .

# Commit the changes with a message
git commit -m 'Add schemas for {{namespace}} {{name}} {{version}}'

# Create a pull request using 'gh' CLI tool
gh pr create --title 'Add schemas for {{namespace}} {{name}} {{version}}' --body ""
9 changes: 9 additions & 0 deletions modules/contracts/apps/challenge/metadata.json
0xmovses marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Challenge",
"description": "Create personal challenges and invite your friends to hold yourself accountable",
"website": "https://abstract.money/",
"docs": "",
"type": "app",
"icon": "RiCoinsLine",
"enabled": false
}
Loading
Loading