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

chore: (#45) Fix failing java tests #46

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading