Skip to content

Commit

Permalink
chore: (#45) Fix failing java tests (#46)
Browse files Browse the repository at this point in the history
* chore: (#45) Fix failing java tests

* Apply changes after review

* Apply changes to formatting
  • Loading branch information
OT-kraftchain authored Dec 16, 2024
1 parent fe43b16 commit 905e359
Show file tree
Hide file tree
Showing 18 changed files with 1,014 additions and 820 deletions.
40 changes: 40 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

6 changes: 4 additions & 2 deletions src/deploy/java/com/axlabs/neo/grantshares/DeployConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ static ContractParameter getGovDeployConfig() {
MIN_ACCEPTANCE_RATE_KEY, Config.getIntProperty(MIN_ACCEPTANCE_RATE_KEY),
MIN_QUORUM_KEY, Config.getIntProperty(MIN_QUORUM_KEY),
THRESHOLD_KEY, Config.getIntProperty(THRESHOLD_KEY)
));
)
);
}

/**
Expand Down Expand Up @@ -94,6 +95,7 @@ static ContractParameter getTreasuryDeployConfig(Hash160 grantSharesGovHash) {
hash160(grantSharesGovHash),
fundersParam,
map(tokens),
Config.getIntProperty(THRESHOLD_KEY));
Config.getIntProperty(THRESHOLD_KEY)
);
}
}
9 changes: 6 additions & 3 deletions src/deploy/java/com/axlabs/neo/grantshares/Deployment.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ private static Hash160 deployGrantSharesGov(AccountSigner signer) throws Throwab
"error message: " + log.getExecutions().get(0).getException());
}
Hash160 contractHash = SmartContract.calcContractHash(signer.getScriptHash(),
res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName());
res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName()
);
System.out.println("GrantSharesGov Contract Hash: " + contractHash);
return contractHash;
}
Expand All @@ -50,7 +51,8 @@ private static void deployGrantSharesTreasury(Hash160 grantSharesGovHash, Accoun
CompilationUnit res = new Compiler().compile(GrantSharesTreasury.class.getCanonicalName());
TransactionBuilder builder = new ContractManagement(getNeow3j())
.deploy(res.getNefFile(), res.getManifest(),
DeployConfig.getTreasuryDeployConfig(grantSharesGovHash))
DeployConfig.getTreasuryDeployConfig(grantSharesGovHash)
)
.signers(signer);

Hash256 txHash = builder.sign().send().getSendRawTransaction().getHash();
Expand All @@ -63,7 +65,8 @@ private static void deployGrantSharesTreasury(Hash160 grantSharesGovHash, Accoun
"error message: " + log.getExecutions().get(0).getException());
}
Hash160 contractHash = SmartContract.calcContractHash(signer.getScriptHash(),
res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName());
res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName()
);
System.out.println("GrantSharesTreasury Contract Hash: " + contractHash);

}
Expand Down
9 changes: 6 additions & 3 deletions src/deploy/java/com/axlabs/neo/grantshares/Invocations.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ private static void endorseProposal(GrantSharesGovContract gov, Account a, int i
System.out.println(txHash.toString());
}

static void createProposal(GrantSharesTreasuryContract treasury, GrantSharesGovContract gov, Account a) throws Throwable {
static void createProposal(GrantSharesTreasuryContract treasury, GrantSharesGovContract gov, Account a)
throws Throwable {
IntentParam intent = IntentParam.releaseTokenProposal(treasury.getScriptHash(), NeoToken.SCRIPT_HASH,
a.getScriptHash(), BigInteger.ONE);
a.getScriptHash(), BigInteger.ONE
);
NeoApplicationLog.Execution exec = signSendAwait(
gov.createProposal(a.getScriptHash(), "https://github.com/axlabs/grantshares-dev/issues/42", -1,
intent), a);
intent
), a);
}

static NeoApplicationLog.Execution signSendAwait(TransactionBuilder b, Account signer) throws Throwable {
Expand Down
Loading

0 comments on commit 905e359

Please sign in to comment.