Skip to content

Commit

Permalink
Merge pull request #86 from Alien-Worlds/DEMZNE-1123_eosdac-fix-tests…
Browse files Browse the repository at this point in the history
…-after-recent-changes

Demzne 1123 eosdac fix tests after recent changes
  • Loading branch information
angelol authored Nov 4, 2022
2 parents 11d1357 + c2cf5cb commit 97212d8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/dacproposals/dacproposals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ describe('Dacproposals', () => {
context('with more denied than approved votes', async () => {
context('with insufficient votes', async () => {
before(async () => {
for (const custodian of propDacCustodians) {
for (const custodian of propDacCustodians.slice(1)) {
await shared.dacproposals_contract.voteprop(
custodian.name,
newpropid,
Expand Down
15 changes: 12 additions & 3 deletions contracts/msigworlds/msigworlds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,19 @@ class [[eosio::contract("msigworlds")]] multisig : public eosio::contract {
void assertValidCustodian(const name proposer, const name dac_id) {
const auto dac = eosdac::dacdir::dac_for_id(dac_id);
const auto custodian_contract = dac.account_for_type_maybe(eosdac::dacdir::CUSTODIAN);

if (custodian_contract) {
const auto custodians = eosdac::custodians_table{*custodian_contract, dac_id.value};
const auto is_custodian = custodians.find(proposer.value) != custodians.end();
check(is_custodian, "ERR::MUST_BE_CUSTODIAN:: %s must be active custodian.", proposer);
const auto custodians = eosdac::custodians_table{*custodian_contract, dac_id.value};
const auto is_custodian = custodians.find(proposer.value) != custodians.end();
const auto referendum_contract = dac.account_for_type_maybe(eosdac::dacdir::REFERENDUM);

if (referendum_contract) {
if (proposer != *referendum_contract) {
check(is_custodian, "ERR::MUST_BE_CUSTODIAN:: %s must be active custodian.", proposer);
}
} else {
check(is_custodian, "ERR::MUST_BE_CUSTODIAN:: %s must be active custodian.", proposer);
}
}
}
};
4 changes: 2 additions & 2 deletions contracts/stakevote/stakevote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ describe('Stakevote', () => {
from: staker,
}
);
await shared.dac_token_contract.unstake(staker.name, '0.9989 STADAC', {
await shared.dac_token_contract.unstake(staker.name, '0.9983 STADAC', {
from: staker,
});
await shared.dac_token_contract.unstake(staker.name, '0.0001 STADAC', {
await shared.dac_token_contract.unstake(staker.name, '0.0007 STADAC', {
from: staker,
});
});
Expand Down

0 comments on commit 97212d8

Please sign in to comment.