Skip to content

Commit

Permalink
Reorganize files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating committed Aug 5, 2021
1 parent dd26668 commit 4bcc62d
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 13 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
MOLOCH_ACCOUNT_ID=$(shell grep MOLOCH_ACCOUNT_ID .env | cut -d "=" -f2)

build:
./build.sh
./scripts/build.sh

deploy:
$(MAKE) build
./deploy.sh
./scripts/deploy.sh

clean:
./clean.sh
./scripts/clean.sh

deploy_contract:
$(MAKE) build
near deploy --wasmFile res/moloch.wasm --accountId $(MOLOCH_ACCOUNT_ID).mrkeating.testnet

unit:
cd contracts && cargo test --all

end_to_end:
$(MAKE) deploy
yarn run test
$(MAKE) clean
29 changes: 29 additions & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/target
Cargo.lock

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

*/packages/kubernetes/*
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ impl FungibleTokenReceiver for Moloch {
#[cfg(test)]
mod tests {
use super::*;
use near_sdk::test_utils::{
get_created_receipts, get_logs, testing_env_with_promise_results, VMContextBuilder,
};
use near_sdk::test_utils::{testing_env_with_promise_results, VMContextBuilder};
use near_sdk::{testing_env, Balance, MockedBlockchain, PromiseResult, VMContext};
use std::convert::TryInto;

Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions moloch/src/lib.rs → contracts/moloch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use near_contract_standards::fungible_token::core_impl::ext_fungible_token;
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::{LookupMap, UnorderedMap, Vector};
use near_sdk::json_types::{U128, U64};
use near_sdk::{
env, ext_contract, near_bindgen, setup_alloc, AccountId, Balance, PanicOnDefault, Promise,
};
use near_sdk::{env, near_bindgen, setup_alloc, AccountId, Balance, PanicOnDefault, Promise};

use serde::{Deserialize, Serialize};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions build.sh → scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
cd "`dirname $0`"
cd "./contracts"
cargo build --all --target wasm32-unknown-unknown --release
cp target/wasm32-unknown-unknown/release/*.wasm ./res/
cp ./target/wasm32-unknown-unknown/release/*.wasm ./res/
File renamed without changes.
4 changes: 2 additions & 2 deletions deploy.sh → scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ FDAI_ACCOUNT_ID=$(grep FDAI_ACCOUNT_ID .env | cut -d "=" -f2)
# ten second periods, voting period 20 seconds grace 10 seconds
near create-account $MOLOCH_ACCOUNT_ID.mrkeating.testnet --master-account mrkeating.testnet
near create-account $FDAI_ACCOUNT_ID.mrkeating.testnet --master-account mrkeating.testnet
near deploy --wasmFile res/test_fungible_token.wasm --accountId $FDAI_ACCOUNT_ID.mrkeating.testnet
near deploy --wasmFile contracts/res/test_fungible_token.wasm --accountId $FDAI_ACCOUNT_ID.mrkeating.testnet
near call $FDAI_ACCOUNT_ID.mrkeating.testnet new_default_meta --accountId $FDAI_ACCOUNT_ID.mrkeating.testnet --args '{"owner_id":"mrkeating.testnet","total_supply":"1000000000"}'

near deploy --wasmFile res/moloch.wasm --accountId $MOLOCH_ACCOUNT_ID.mrkeating.testnet
near deploy --wasmFile contracts/res/moloch.wasm --accountId $MOLOCH_ACCOUNT_ID.mrkeating.testnet
near call $MOLOCH_ACCOUNT_ID.mrkeating.testnet new --accountId $MOLOCH_ACCOUNT_ID.mrkeating.testnet --args '{"summoner": "mrkeating.testnet", "approved_token": "'$FDAI_ACCOUNT_ID.mrkeating.testnet'", "period_duration": "10000000000", "voting_period_length": "2", "grace_period_length": "1", "abort_window": "2", "proposal_deposit": "10", "dilution_bound": "1", "processing_reward": "1"}'

0 comments on commit 4bcc62d

Please sign in to comment.