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

Optimizing the fee estimation calculation interface. #3510

Open
wants to merge 61 commits into
base: release/2.0.0
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2d92792
feat:add charging address.
ssun0121 Nov 23, 2023
61a5920
feat:change type to string.
ssun0121 Nov 24, 2023
b3acc84
Merge branch 'master' into feature/calculate-fee
ssun0121 Nov 24, 2023
4a95366
feat:change output structure.
ssun0121 Nov 27, 2023
ac7fb26
feat:Modifying the description.
ssun0121 Nov 28, 2023
6c27a29
feat:change output property.
ssun0121 Nov 28, 2023
ea085f3
test:add test.
ssun0121 Nov 28, 2023
5c6c669
feat: add ModifyTokenIssuerAndOwner, SetTokenIssuerAndOwnerModificati…
kaiwenzhengaelf Dec 7, 2023
a1cb698
fix: format code
kaiwenzhengaelf Dec 7, 2023
82b284a
fix: ModifyTokenIssuerAndOwner
kaiwenzhengaelf Dec 7, 2023
242638e
fix: assert message
kaiwenzhengaelf Dec 8, 2023
c910c95
Merge pull request #3490 from AElfProject/feature/modify-issuer-owner
kaiwenzhengaelf Dec 8, 2023
913ed5b
fix:change SetTokenIssuerAndOwnerModificationEnabled to SetTokenIssue…
kaiwenzhengaelf Dec 8, 2023
c521d69
fix: improve semantic accuracy
kaiwenzhengaelf Dec 8, 2023
1864d2e
fix: typo
kaiwenzhengaelf Dec 8, 2023
b403f2f
fix: remove redundant message
kaiwenzhengaelf Dec 8, 2023
3a0445d
feat: add ut
kaiwenzhengaelf Dec 9, 2023
c391774
Merge pull request #3494 from AElfProject/fix/modify-issuer-owner
jason-aelf Dec 9, 2023
7541806
Merge pull request #3493 from AElfProject/release/1.6.1
jason-aelf Dec 10, 2023
2bf43ff
Add ProfitContract state to limit the max profit receiving period count.
jason-aelf Jan 8, 2024
b3011d1
Change the logic of calculating max profit receiving period count
jason-aelf Jan 10, 2024
4ed4215
Fix wrong period of profits.
jason-aelf Jan 11, 2024
c05c2c3
Add comments for method 'GetMaximumPeriodCountForProfitableDetail'
jason-aelf Jan 12, 2024
456d45e
Add one time claimable profit amount to return value
jason-aelf Jan 16, 2024
89c8604
Fix build error
jason-aelf Jan 17, 2024
39d1120
Enhance ProfitContract with methods for getting all profit amount
jason-aelf Jan 23, 2024
06d1e43
Remove duplicate codes
jason-aelf Jan 23, 2024
07adf84
Change to return all profit amount
jason-aelf Jan 23, 2024
d32538f
Fix unit test error
jason-aelf Jan 23, 2024
20f4821
Merge branch 'release/2.0.0' into feature/calculate-fee
jason-aelf Jan 23, 2024
ef9ae57
Remove duplicate codes
jason-aelf Jan 24, 2024
0c8e1dc
Merge pull request #3519 from AElfProject/feature/change-max-profit-r…
jason-aelf Jan 31, 2024
7edbdc7
feat:remove nft decimal restriction
louis4li Feb 22, 2024
6c4f6c8
feat: create token on specified chain
louis4li Feb 26, 2024
5f364ff
feat: add seed when cross chain create
louis4li Feb 29, 2024
0815a2b
feat: SetSymbolSeed update
louis4li Feb 29, 2024
ab522bb
feat: add batch approve
louis4li Feb 29, 2024
2d30519
Merge pull request #3526 from AElfProject/release/1.7.0
jason-aelf Feb 29, 2024
7d84b6b
feat: update MaximumBatchApproveCount check
louis4li Mar 1, 2024
7095554
feat:update description
louis4li Mar 1, 2024
079c247
Merge branch 'release/1.8.0' into feature/remove-nft-decimal-restriction
jason-aelf Mar 1, 2024
eb4ceaa
feat: ApproveInputList distinct
louis4li Mar 1, 2024
109e92f
Merge pull request #3525 from AElfProject/feature/remove-nft-decimal-…
jason-aelf Mar 1, 2024
2c92a32
Merge branch 'release/1.8.0' into feature/create-token-on-specified-c…
jason-aelf Mar 1, 2024
cc028e2
feat: method rename
louis4li Mar 1, 2024
b4263e3
feat: update BatchApproveInputCount check
louis4li Mar 1, 2024
db75acf
feat:seed cannot create token on side chain
louis4li Mar 2, 2024
4787599
Merge remote-tracking branch 'origin/feature/create-token-on-specifie…
louis4li Mar 2, 2024
664382e
Merge pull request #3531 from AElfProject/feature/create-token-on-spe…
jason-aelf Mar 3, 2024
cdd34cd
Merge branch 'release/1.8.0' into feature/batch-approve
jason-aelf Mar 3, 2024
aa1b5b3
feat:rename MaxBatchApproveCount
louis4li Mar 3, 2024
ede52ed
Merge remote-tracking branch 'origin/feature/batch-approve' into feat…
louis4li Mar 3, 2024
4f7f563
feat:update BatchApprove check
louis4li Mar 3, 2024
7dbd094
Merge pull request #3532 from AElfProject/feature/batch-approve
jason-aelf Mar 3, 2024
2753cb9
feat:Compatibility with historical NFT creations
louis4li Mar 6, 2024
777e040
feat:Modify the verification order
louis4li Mar 7, 2024
821000d
Merge remote-tracking branch 'origin/release/1.8.0' into feature/crea…
louis4li Mar 7, 2024
9133b3c
Merge pull request #3534 from AElfProject/feature/create-token-on-spe…
louis4li Mar 7, 2024
88e0c3c
Merge branch 'master' into release/1.8.0
jason-aelf Mar 28, 2024
1842512
Merge pull request #3536 from AElfProject/release/1.8.0
jason-aelf Mar 28, 2024
40bf0de
Resolve conflicts
eanzhao May 17, 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
feat: update BatchApproveInputCount check
  • Loading branch information
louis4li committed Mar 1, 2024
commit b4263e3d2c5ce5930c08e842afb5b70e501794ec
3 changes: 1 addition & 2 deletions contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs
Original file line number Diff line number Diff line change
@@ -270,19 +270,18 @@
}

public override Empty BatchApprove(BatchApproveInput input)
{

Check warning on line 273 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L273

Added line #L273 was not covered by tests
Assert(input != null && input.Value != null, "Invalid input .");
Assert(input.Value.Count <= GetMaxBatchApproveCount(), "Exceeds the maximum batch approve count.");

Check warning on line 275 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L275

Added line #L275 was not covered by tests
foreach (var approve in input.Value)
{
AssertValidInputAddress(approve.Spender);
AssertValidToken(approve.Symbol, approve.Amount);
}

var approveInputList = input.Value.GroupBy(approve => approve.Symbol + approve.Spender, approve => approve)
.Select(approve => approve.Last()).ToList();

Check warning on line 282 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L277-L282

Added lines #L277 - L282 were not covered by tests
Assert(approveInputList.Count <= GetMaxBatchApproveCount(), "Exceeds the maximum batch approve count.");
foreach (var approve in approveInputList)
Approve(approve.Spender, approve.Symbol, approve.Amount);

Check warning on line 284 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L284

Added line #L284 was not covered by tests
return new Empty();
}

@@ -650,25 +649,25 @@
}

public override Empty SetMaxBatchApproveCount(Int32Value input)
{
AssertSenderAddressWith(GetDefaultParliamentController().OwnerAddress);
Assert(input.Value > 0, "Invalid input.");
State.MaximumBatchApproveCount.Value = input.Value;
return new Empty();
}

Check warning on line 657 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L652-L657

Added lines #L652 - L657 were not covered by tests

public override Int32Value GetMaxBatchApproveCount(Empty input)
{
return new Int32Value
{
Value = GetMaxBatchApproveCount()
};
}

Check warning on line 665 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L660-L665

Added lines #L660 - L665 were not covered by tests

private int GetMaxBatchApproveCount()
{

Check warning on line 668 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L668

Added line #L668 was not covered by tests
var maximumBatchApproveCount = State.MaximumBatchApproveCount.Value == 0
? TokenContractConstants.DefaultMaxBatchApproveCount
: State.MaximumBatchApproveCount.Value;
return maximumBatchApproveCount;
}

Check warning on line 673 in contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs

Codecov / codecov/patch

contract/AElf.Contracts.MultiToken/TokenContract_Actions.cs#L670-L673

Added lines #L670 - L673 were not covered by tests