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

CDAO Airdrop Implementation #410

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
31945a0
chore(shared_utils/individual_user/ml_data): fix clippy warnings
rupansh Sep 7, 2024
c14dde7
chore: switch to pocket-ic 0.6
rupansh Sep 29, 2024
cf7892a
feat(shared_utils): add utility for proof of participation
rupansh Sep 29, 2024
dfcd7ff
feat: initial integration for proof of participation
rupansh Sep 29, 2024
76c5ae6
feat: add new referral flow with proof of participation
rupansh Sep 29, 2024
66b27a1
feat(individual_user_template): initial airdrop flow implementation
rupansh Sep 29, 2024
f360264
fix(individual_user_template): airdrop bug fixes
rupansh Oct 2, 2024
4adce99
chore: add integration tests for airdrop
rupansh Oct 2, 2024
7b39321
Merge remote-tracking branch 'origin/main' into rupansh/airdrop
rupansh Oct 2, 2024
b26bd32
Merge remote-tracking branch 'origin/main' into rupansh/airdrop
rupansh Oct 7, 2024
7a3bb9a
Merge remote-tracking branch 'origin/main' into rupansh/airdrop
rupansh Oct 23, 2024
ebaffed
chore: rename Proof of Participant related identifiers
rupansh Oct 23, 2024
a23380f
refactor: move airdrop data to heap
rupansh Oct 23, 2024
b5038c0
refactor+perf: make ancestral flow static for airdrop
rupansh Oct 23, 2024
bb3e7d8
fix: update post_upgrade hooks for individual user and user index
rupansh Oct 24, 2024
4328e6d
refactor: use `DFX_NETWORK` instead of feature flag for local network…
rupansh Oct 24, 2024
ba8af74
chore(scripts/local_deploy/install_all_canisters): remove unnecessary…
rupansh Oct 24, 2024
5ed899e
chore: update nix env
rupansh Oct 24, 2024
f64f91d
Merge branch 'main' into rupansh/airdrop
ravi-sawlani-yral Oct 25, 2024
8c453c3
feat: add proof of participation merkleization
rupansh Nov 3, 2024
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
56 changes: 51 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ members = [
[workspace.dependencies]
candid = "0.10.2"
ciborium = "0.2.1"
pocket-ic = "3.0.0"
pocket-ic = "5.0.0"
ic-cdk = "0.15.1"
ic-cdk-timers = "0.7.0"
ic-cdk-macros = "0.16.0"
Expand Down
Binary file modified pocket-ic
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ char_escaped=$(printf "%s" "$char" | sed 's/../\\&/g')

# Create a shell script with the escaped hexadecimal string
printf "(\"v1.0.0\", blob \"%s\")" "$char_escaped" > argument
dfx canister call user_index create_pool_of_individual_user_available_canisters --argument-file argument
dfx ledger fabricate-cycles --cycles 20000000000000000 --canister user_index
dfx canister call user_index create_pool_of_individual_user_available_canisters --argument-file argument
19 changes: 13 additions & 6 deletions scripts/canisters/local_deploy/install_all_canisters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ dfx canister create --no-wallet post_cache
dfx canister create --no-wallet user_index
dfx canister create --no-wallet platform_orchestrator

gzip_canister() {
gzip -f -1 ./target/wasm32-unknown-unknown/release/$1.wasm
# HACK: dfx doesn't support specifying feature flags....
rebuild_canister() {
cargo build --target wasm32-unknown-unknown --release --features local -p $1 --locked
wasm-opt ./target/wasm32-unknown-unknown/release/$1.wasm -o ./target/wasm32-unknown-unknown/release/$1.wasm -Oz
gzip -fk -1 ./target/wasm32-unknown-unknown/release/$1.wasm
cp ./target/wasm32-unknown-unknown/release/$1.wasm.gz .dfx/local/canisters/$1/$1.wasm.gz
}

scripts/candid_generator.sh

gzip_canister individual_user_template
gzip_canister user_index
gzip_canister post_cache
gzip_canister platform_orchestrator
rebuild_canister individual_user_template
rebuild_canister user_index
rebuild_canister post_cache
rebuild_canister platform_orchestrator

if [[ $skip_test != true ]]
then
Expand Down Expand Up @@ -90,6 +94,9 @@ dfx canister install user_index --argument "(record {
vec { variant { CanisterAdmin }; variant { CanisterController }; }
};
};
proof_of_participation = opt record {
chain = vec {};
};
version= \"v1.0.0\"
})"

Expand Down
16 changes: 16 additions & 0 deletions scripts/canisters/local_deploy/local_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -euo pipefail

build_canister() {
cargo build --target wasm32-unknown-unknown --release -p $1 --locked
wasm-opt ./target/wasm32-unknown-unknown/release/$1.wasm -o ./target/wasm32-unknown-unknown/release/$1.wasm -O3 -Os
gzip -f -1 ./target/wasm32-unknown-unknown/release/$1.wasm
}

build_canister individual_user_template
build_canister user_index
build_canister post_cache
build_canister platform_orchestrator

POCKET_IC_BIN=$PWD/pocket-ic cargo test --no-fail-fast
3 changes: 3 additions & 0 deletions src/canister/individual_user_template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ hex = "0.4.3"

[dev-dependencies]
test_utils = { workspace = true }

[features]
local = ["shared_utils/local"]
Loading
Loading