Skip to content

Commit db228e8

Browse files
committed
Merge dev branch, then resolve conflicts.
2 parents f6a60e5 + 542043d commit db228e8

File tree

143 files changed

+3631
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+3631
-533
lines changed

.bettercodehub.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# Depth of components to analyze (2 levels deep)
12
component_depth: 2
23

4+
# Programming languages to analyze
35
languages:
46
- csharp

.github/ISSUE_TEMPLATE/bug_report.md

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
---
2-
name: Bug report
3-
about: Create a report to help us improve
2+
name: 👾 Bug Report
3+
about: Report a bug or issue with the project.
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77

88
---
99

10-
**Describe the bug**
10+
### Description
1111
A clear and concise description of what the bug is.
1212

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
13+
### Steps To Reproduce
14+
1. Log in...
15+
2. Ensure that...
16+
3. Allow a long period of inactivity to pass...
17+
4. Observe that...
18+
5. Attempt to log in...
1919

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
20+
### Current Behavior
21+
- After the period of inactivity...
22+
- When the user tries to log in using another method...
23+
- This causes a bug due to...
2224

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
25+
### Expected Behavior
26+
- After a long period of inactivity...
27+
- When a user logs in successfully...
28+
- This ensures that only...
2529

26-
**Environment (please complete the following information):**
27-
- OS and version: [e.g. Ubuntu 18.04]
28-
- Dotnet core version [e.g. 2.2.106]
29-
30-
**Additional context**
31-
Add any other context about the problem here.
30+
### Environment
31+
- Platform: PC
32+
- Node: v18.18.0
33+
- Browser: Chrome 126.0.6478.56

.github/ISSUE_TEMPLATE/config.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
blank_issues_enabled: false
2+
issue_template:
3+
- name: 👾 Bug Report
4+
description: Report a bug or issue with the project.
5+
labels: ["bug"]
6+
template: bug_report.md
7+
- name: 💡 Feature Request
8+
description: Create a new ticket for a new feature request.
9+
labels: ["enhancement"]
10+
template: feature_request.md
+18-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
---
2-
name: Feature request
3-
about: Suggest an idea for this project
2+
name: 💡 Feature Request
3+
about: Create a new ticket for a new feature request
44
title: ''
5-
labels: ''
5+
labels: 'enhancement'
66
assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10+
### Expected Behavior
11+
Describe the expected behavior here.
1212

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
13+
### Specifications
14+
As a `user`, I would like to `action` so that `reason`.
1515

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
16+
**Features:**
17+
- describe feature details here.
1818

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
19+
**Development Tasks:**
20+
- [ ] Task 1
21+
- [ ] Task 2
22+
23+
### Dependencies
24+
List any dependencies that are required for this feature by providing links to the issues or repositories.
25+
26+
### References
27+
List any references that are related to this feature request.
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: benchmark_action
2+
on:
3+
push:
4+
tags:
5+
- '**'
6+
branches:
7+
- '**'
8+
9+
10+
11+
env:
12+
DOTNET_INSTALL_DIR: "./.dotnet"
13+
Solution_Name: AElf.All.sln
14+
Service_Name: AELF
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
pull-requests: write
21+
contents: write
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
- name: Setup dotnet
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: '6.0'
29+
30+
- name: 'Download AElf build tools'
31+
run: bash scripts/download_binary.sh
32+
33+
- name: 'Install protobuf'
34+
run: bash scripts/install_protobuf.sh
35+
36+
- name: Install dependencies
37+
run: dotnet restore bench/AElf.Benchmark/AElf.Benchmark.csproj --verbosity quiet
38+
39+
- name: BenchMark
40+
run: |
41+
cd bench/AElf.Benchmark
42+
dotnet run --filter '*MinerTests*'
43+
- name: Upload build artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: ${{ env.Service_Name }}
47+
path: bench/AElf.Benchmark/BenchmarkDotNet.Artifacts/results
48+
retention-days: 30

.github/workflows/sonarqube.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
pull_request:
3+
types: [opened, synchronize, reopened]
4+
5+
name: PR Static Code Analysis
6+
jobs:
7+
static-code-analysis:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Code Checkout
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: '7.0'
17+
- name: Create temporary global.json
18+
run: echo '{"sdk":{"version":"8.0.7"}}' > ./global.json
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 17
23+
- name: Cache SonarQube packages
24+
uses: actions/cache@v1
25+
with:
26+
path: ~/.sonar/cache
27+
key: ${{ runner.os }}-sonar
28+
restore-keys: ${{ runner.os }}-sonar
29+
- name: Cache SonarQube scanner
30+
id: cache-sonar-scanner
31+
uses: actions/cache@v1
32+
with:
33+
path: ./.sonar/scanner
34+
key: ${{ runner.os }}-sonar-scanner
35+
restore-keys: ${{ runner.os }}-sonar-scanner
36+
- name: Install SonarScanner for .NET
37+
run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
38+
- name: Add .NET global tools to PATH
39+
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
40+
- name: Install protobuf
41+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
42+
- name: Begin SonarQube analysis
43+
run: |
44+
./.sonar/scanner/dotnet-sonarscanner begin /k:"AElf" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
45+
dotnet build AElf.All.sln
46+
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
47+
48+
49+

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,4 @@ tools
312312
.idea/.idea.AElf/.idea/projectSettingsUpdater.xml
313313
.idea/.idea.AElf/.idea/vcs.xml
314314
.idea/.idea.AElf/.idea/workspace.xml
315-
.idea/.idea.AElf/riderModule.iml
315+
.idea/.idea.AElf/riderModule.iml

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sphinx:
1414
# Optionally build your docs in additional formats such as PDF and ePub
1515
formats: all
1616

17-
# Optionally set the version of Python and requirements required to build your docs
17+
# Optionally set the version of python and requirements required to build your docs
1818
python:
1919
version: 3.7
2020
install:

AElf.ContractTools.targets

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
</PropertyGroup>
3333
</Otherwise>
3434
</Choose>
35-
35+
36+
<!-- Generate protobuf code before building and getting the target path -->
3637
<Target Name="GenerateProtobufCode" BeforeTargets="BeforeBuild;GetTargetPath">
3738
<PropertyGroup>
3839
<LocalProtobufDir>$(ProjectDir)/Protobuf</LocalProtobufDir>

AElf.Contracts.sln

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
32
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "contract", "contract", "{651F0F6E-86CF-42D2-9110-5F3EAE5704F0}"
43
EndProject
54
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{26990847-E0A2-4FCC-8C71-267CA77557CD}"

AElf.sln.DotSettings

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2+
xmlns:s="clr-namespace:System;assembly=mscorlib"
3+
xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml"
4+
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
25
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean>
3-
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JS/@EntryIndexedValue">JS</s:String>
4-
<s:Boolean x:Key="/Default/UserDictionary/Words/=aelf/@EntryIndexedValue">True</s:Boolean>
5-
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
6-
<s:Boolean x:Key="/Default/UserDictionary/Words/=blockchain/@EntryIndexedValue">True</s:Boolean>
7-
<s:Boolean x:Key="/Default/UserDictionary/Words/=Blockchains/@EntryIndexedValue">True</s:Boolean>
8-
<s:Boolean x:Key="/Default/UserDictionary/Words/=DPOS/@EntryIndexedValue">True</s:Boolean>
9-
<s:Boolean x:Key="/Default/UserDictionary/Words/=grpc/@EntryIndexedValue">True</s:Boolean>
10-
<s:Boolean x:Key="/Default/UserDictionary/Words/=hangfire/@EntryIndexedValue">True</s:Boolean>
11-
<s:Boolean x:Key="/Default/UserDictionary/Words/=Merkle/@EntryIndexedValue">True</s:Boolean>
12-
<s:Boolean x:Key="/Default/UserDictionary/Words/=pubkey/@EntryIndexedValue">True</s:Boolean>
13-
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ssdb/@EntryIndexedValue">True</s:Boolean>
14-
<s:Boolean x:Key="/Default/UserDictionary/Words/=Xunit/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
6+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JS/@EntryIndexedValue">JS</s:String>
7+
<s:Boolean x:Key="/Default/UserDictionary/Words/=aelf/@EntryIndexedValue">True</s:Boolean>
8+
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
9+
<s:Boolean x:Key="/Default/UserDictionary/Words/=blockchain/@EntryIndexedValue">True</s:Boolean>
10+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Blockchains/@EntryIndexedValue">True</s:Boolean>
11+
<s:Boolean x:Key="/Default/UserDictionary/Words/=DPOS/@EntryIndexedValue">True</s:Boolean>
12+
<s:Boolean x:Key="/Default/UserDictionary/Words/=grpc/@EntryIndexedValue">True</s:Boolean>
13+
<s:Boolean x:Key="/Default/UserDictionary/Words/=hangfire/@EntryIndexedValue">True</s:Boolean>
14+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Merkle/@EntryIndexedValue">True</s:Boolean>
15+
<s:Boolean x:Key="/Default/UserDictionary/Words/=pubkey/@EntryIndexedValue">True</s:Boolean>
16+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ssdb/@EntryIndexedValue">True</s:Boolean>
17+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Xunit/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

CodeCoverage.runsettings

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This XML defines run settings for code coverage. -->
23
<!-- File name extension must be .runsettings -->
34
<RunSettings>
45
<DataCollectionRunSettings>

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# appveyor configuration file
12
version: 1.0.0.{build}
23
skip_tags: true
34
os: Windows Server 2012 R2

azure-myget-publish.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Azure DevOps pipeline configuration for publishing NuGet packages to MyGet
12
pool:
23
vmImage: ubuntu-latest
34
pr: none

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# File: azure-pipelines.yml
1+
# Azure Pipelines configuration file
22
jobs:
33
- template: templates/build-template-window.yml
44
parameters:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using BenchmarkDotNet.Exporters;
2+
using BenchmarkDotNet.Loggers;
3+
using BenchmarkDotNet.Reports;
4+
5+
using System.Collections.Generic;
6+
using System.IO;
7+
8+
9+
public class HtmlSummaryExporter : IExporter
10+
{
11+
public string Name => nameof(HtmlSummaryExporter);
12+
13+
public void ExportToLog(Summary summary, ILogger logger)
14+
{
15+
16+
}
17+
18+
public IEnumerable<string> ExportToFiles(Summary summary, ILogger consoleLogger)
19+
{
20+
string directoryPath = summary.ResultsDirectoryPath;
21+
string outputPath = Path.Combine(directoryPath, "Summary.html");
22+
23+
var htmlFiles = Directory.GetFiles(directoryPath, "*.html");
24+
25+
using (StreamWriter writer = new StreamWriter(outputPath))
26+
{
27+
writer.WriteLine("<html>");
28+
writer.WriteLine("<head>");
29+
writer.WriteLine("<title>Benchmark Summary</title>");
30+
31+
writer.WriteLine("<style>");
32+
foreach (var file in htmlFiles)
33+
{
34+
string content = File.ReadAllText(file);
35+
string styleContent = GetStyleContent(content);
36+
writer.WriteLine(styleContent);
37+
}
38+
writer.WriteLine("</style>");
39+
40+
writer.WriteLine("</head>");
41+
writer.WriteLine("<body>");
42+
43+
foreach (var file in htmlFiles)
44+
{
45+
string fileName = Path.GetFileName(file);
46+
writer.WriteLine($"<h2>{fileName}</h2>");
47+
string content = File.ReadAllText(file);
48+
string bodyContent = GetBodyContent(content);
49+
writer.WriteLine(bodyContent);
50+
}
51+
52+
writer.WriteLine("</body>");
53+
writer.WriteLine("</html>");
54+
}
55+
56+
consoleLogger.WriteLine($"Summary HTML file created successfully at {outputPath}.");
57+
58+
return new[] { outputPath };
59+
}
60+
61+
private string GetBodyContent(string html)
62+
{
63+
int bodyStartIndex = html.IndexOf("<body>") + "<body>".Length;
64+
int bodyEndIndex = html.IndexOf("</body>");
65+
if (bodyStartIndex >= 0 && bodyEndIndex >= 0)
66+
{
67+
return html.Substring(bodyStartIndex, bodyEndIndex - bodyStartIndex);
68+
}
69+
return string.Empty;
70+
}
71+
72+
private string GetStyleContent(string html)
73+
{
74+
int styleStartIndex = html.IndexOf("<style>") + "<style>".Length;
75+
int styleEndIndex = html.IndexOf("</style>");
76+
if (styleStartIndex >= 0 && styleEndIndex >= 0)
77+
{
78+
return html.Substring(styleStartIndex, styleEndIndex - styleStartIndex);
79+
}
80+
return string.Empty;
81+
}
82+
}

0 commit comments

Comments
 (0)