Przeglądaj źródła

enable dao contract

x 3 lat temu
rodzic
commit
3e2bf8c580

+ 2 - 4
src/consensus/validator.rs

@@ -22,7 +22,7 @@ use async_std::sync::{Arc, RwLock};
 use darkfi_sdk::{
     crypto::{
         constants::MERKLE_DEPTH,
-        contract_id::MONEY_CONTRACT_ID,
+        contract_id::{DAO_CONTRACT_ID, MONEY_CONTRACT_ID},
         schnorr::{SchnorrPublic, SchnorrSecret},
         MerkleNode, PublicKey, SecretKey,
     },
@@ -143,7 +143,7 @@ impl ValidatorState {
         // The faucet pubkeys are pubkeys which are allowed to create clear inputs
         // in the money contract.
         let money_contract_deploy_payload = serialize(&faucet_pubkeys);
-        //let dao_contract_deploy_payload = vec![];
+        let dao_contract_deploy_payload = vec![];
 
         // In this hashmap, we keep references to ZK proof verifying keys needed
         // for the circuits our native contracts provide.
@@ -156,14 +156,12 @@ impl ValidatorState {
                 include_bytes!("../contract/money/money_contract.wasm").to_vec(),
                 money_contract_deploy_payload,
             ),
-            /*
             (
                 "DAO Contract",
                 *DAO_CONTRACT_ID,
                 include_bytes!("../contract/dao/dao_contract.wasm").to_vec(),
                 dao_contract_deploy_payload,
             ),
-            */
         ];
 
         info!("Deploying native wasm contracts");

+ 1 - 0
src/contract/dao/Cargo.toml

@@ -25,6 +25,7 @@ rand = { version = "0.8.5", optional = true }
 [dev-dependencies]
 async-std = {version = "1.12.0", features = ["attributes"]}
 darkfi = {path = "../../../", features = ["tx", "blockchain"]}
+darkfi-money-contract = { path = "../money", features = ["client"] }
 simplelog = "0.12.0"
 sled = "0.34.7"
 sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"]}

+ 1 - 1
src/contract/dao/Makefile

@@ -33,7 +33,7 @@ test-integration: all
 		--package darkfi-dao-contract \
 		--test integration
 
-test:
+test: test-integration
 
 clean:
 	rm -f $(PROOFS_BIN) $(WASM_BIN)

+ 1 - 1
src/contract/dao/tests/integration.rs

@@ -44,7 +44,7 @@ use harness::{init_logger, DaoTestHarness};
 // TODO: fix up code doc
 
 // TODO: Commenting this test until it works properly
-//#[async_std::test]
+#[async_std::test]
 async fn integration_test() -> Result<()> {
     init_logger()?;