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

Release/omm v1.3.1 #227

Merged
merged 37 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
67aa0b5
chore: check topPrep list for jail status and commission rate
Anurupa03 Dec 29, 2023
e66f3bc
fix:fetched key value from correct dict
Anurupa03 Jan 2, 2024
868b5b4
chore:valid preps implementation
Anurupa03 Jan 4, 2024
5790433
test: added test for IISS4
Anurupa03 Jan 4, 2024
dd71f56
chore: added checks for validators
Anurupa03 Jan 4, 2024
e118be1
test: added test for validator checks
Anurupa03 Jan 4, 2024
6c4ee36
chore: dynamic commission rate
Anurupa03 Jan 4, 2024
f3503e3
chore: query prep status on system score
Anurupa03 Jan 4, 2024
2b17780
chore: optimize imports
Anurupa03 Jan 4, 2024
3001dc0
test : warp context.call for unit testing purpose
Anurupa03 Jan 4, 2024
ecda596
chore:combine remaining amount transfer to daoFund in single transaction
Anurupa03 Jan 8, 2024
ae97c80
chore:ensure prep list returns all preps in the system
Anurupa03 Jan 8, 2024
313f524
chore: check valid prep size before delegating to network
Anurupa03 Jan 8, 2024
348704c
chore: check valid prep list inside updateDelegationInNetwork function
Anurupa03 Jan 8, 2024
7eb940b
chore: merge conflict solved
Anurupa03 Jan 12, 2024
0eb93f5
chore: added remaining amount to fee collected db
Anurupa03 Jan 30, 2024
fe3b16c
chore: code optimization
Anurupa03 Jan 30, 2024
f477f7a
chore: constructor params changed
Anurupa03 Jan 30, 2024
f0e2dbb
chore: for better readability
Anurupa03 Jan 30, 2024
ce22a23
chore: jailed preps fee saved in db for sending it to daoFund
Anurupa03 Jan 31, 2024
11fef58
Merge branch 'release/omm-v1.3.0' into audit/issue-32-fix
Anurupa03 Jan 31, 2024
7dbd385
test: unit test fixed
Anurupa03 Feb 1, 2024
514d0cf
test: constructor parameters changed
Anurupa03 Feb 1, 2024
97b9156
chore: resetting validator share after distribution
Anurupa03 Feb 8, 2024
9d01ca8
Merge pull request #180 from ommfinance/release/omm-v1.3.0
Suyog007 Feb 9, 2024
2a828c0
chore: changing build number
Anurupa03 Feb 9, 2024
84706a7
chore: fixed unit test
Anurupa03 Feb 9, 2024
83b180c
Merge branch 'develop' into audit/issue-32-fix
Anurupa03 Feb 9, 2024
ea7580e
chore: final variable key for db
Anurupa03 Feb 9, 2024
ba6d29d
Merge pull request #222 from ommfinance/release/omm-v1.3.0
Suyog007 Feb 26, 2024
1de5478
chore: jailed prep reward subtracted
Anurupa03 Mar 4, 2024
4e95ff5
chore: method to update valid preps list added
Anurupa03 Mar 4, 2024
5bfa8c2
chore: build no updated
Anurupa03 Mar 4, 2024
0eaa872
Merge pull request #213 from ommfinance/audit/issue-32-fix
Suyog007 Mar 6, 2024
25f6f84
test:unit test for validator status check added
Anurupa03 Mar 7, 2024
4398ace
chore:validator check for status added
Anurupa03 Mar 7, 2024
2c662bf
Merge pull request #228 from ommfinance/fix/prep-status-check
Suyog007 Mar 7, 2024
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
Prev Previous commit
Next Next commit
chore: code optimization
  • Loading branch information
Anurupa03 committed Jan 30, 2024
commit fe3b16c37096390362a7fcec9ba42f2dd5e59bb7
Original file line number Diff line number Diff line change
@@ -97,6 +97,9 @@ private BigInteger distributeFeeToValidator(Address lendingPoolCoreAddr,BigInteg
BigInteger remaining = BigInteger.ZERO;

for (String validator : ommValidators.keySet()) {
if (denominator.signum() == 0){
break;
}
Address validatorAddr = Address.fromString(validator);

BigInteger currentPercentage = ommValidators.get(validator);
@@ -112,24 +115,15 @@ private BigInteger distributeFeeToValidator(Address lendingPoolCoreAddr,BigInteg
}

}
if (remaining.signum() > 0){
return remaining;
// Address daoFundAddr = getAddress(Contracts.DAO_FUND.getKey());
// BigInteger feeCollected = collectedFee.getOrDefault(daoFundAddr, BigInteger.ZERO);
// collectedFee.put(daoFundAddr, feeCollected.add(remaining));
// call(Contracts.sICX,"transfer",daoFundAddr,remaining);
}

return remaining;
}

private boolean checkPrepStatus(Address prepAddr){
Map<String, Object> prepDict = call(Map.class,ZERO_SCORE_ADDRESS, "getPRep", prepAddr);
BigInteger jailFlags = (BigInteger) prepDict.get("jailFlags");

if (jailFlags == null || jailFlags.equals(BigInteger.ZERO)) {
return true;
}
return false;
return jailFlags == null || jailFlags.signum() == 0;
}

@EventLog(indexed = 3)
Original file line number Diff line number Diff line change
@@ -104,8 +104,7 @@ public void updatePreps(){
for (int i = 0; i < totalPreps; i++) {
this.topPreps.removeLast();
}
List<Address> validPreps = getValidPreps();
int size = validPreps.size();
int size = this.validPreps.size();

for (int i = 0; i < size; i++) {
this.validPreps.removeLast();
@@ -467,8 +466,7 @@ private void checkForIscore() {
Context.call(SYSTEM_SCORE_ADDRESS, "claimIScore");

List<Address> topPrep = getTopPreps();
List<Address> validPreps = getValidPreps();
int size = validPreps.size();
int size = this.validPreps.size();
for (int i = 0; i < size; i++) {
this.validPreps.removeLast();
}