-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3615 from AElfProject/release/1.11.0
Release version 1.11.0
- Loading branch information
Showing
11 changed files
with
249 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- master | ||
- feature/use-github-actions | ||
|
||
env: | ||
DOTNET_INSTALL_DIR: "./.dotnet" | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.0' | ||
|
||
- name: Download AElf build tools | ||
run: bash scripts/download_binary.sh | ||
|
||
- name: Install Protobuf | ||
run: bash scripts/install_protobuf.sh | ||
|
||
- name: Build Solution | ||
run: bash scripts/build.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- master | ||
- feature/use-github-actions | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- name: Run dotnet ci action | ||
uses: AElfProject/[email protected] | ||
with: | ||
commit-token: ${{ secrets.COMMIT_TOKEN }} | ||
codecov-token: ${{ secrets.CODECOV_TOKEN }} | ||
branch-name: "feature/badge-json" | ||
solution-name: "AElf.All.sln" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System; | ||
using System.Linq; | ||
using Google.Protobuf; | ||
|
||
namespace AElf.Types | ||
{ | ||
public partial class MultiTransaction | ||
{ | ||
private Hash _transactionId; | ||
|
||
public Hash GetHash() | ||
{ | ||
if (_transactionId == null) | ||
_transactionId = HashHelper.ComputeFrom(GetSignatureData()); | ||
|
||
return _transactionId; | ||
} | ||
|
||
public ValidationStatus VerifyFields() | ||
{ | ||
if (Transactions.Count < 2) | ||
return ValidationStatus.OnlyOneTransaction; | ||
|
||
if (!AllTransactionsHaveSameFrom()) | ||
return ValidationStatus.MoreThanOneFrom; | ||
|
||
if (Transactions.Any(transaction => string.IsNullOrEmpty(transaction.Transaction.MethodName))) | ||
return ValidationStatus.MethodNameIsEmpty; | ||
|
||
if (Transactions.Any(transaction => transaction.Transaction.Signature.IsEmpty)) | ||
{ | ||
return ValidationStatus.UserSignatureIsEmpty; | ||
} | ||
|
||
return ValidationStatus.Success; | ||
} | ||
|
||
public enum ValidationStatus | ||
{ | ||
Success, | ||
OnlyOneTransaction, | ||
MoreThanOneFrom, | ||
MethodNameIsEmpty, | ||
UserSignatureIsEmpty | ||
} | ||
|
||
private bool AllTransactionsHaveSameFrom() | ||
{ | ||
var firstFrom = Transactions[0].Transaction.From; | ||
return Transactions.All(transaction => transaction.Transaction.From == firstFrom); | ||
} | ||
|
||
private byte[] GetSignatureData() | ||
{ | ||
var verifyResult = VerifyFields(); | ||
if (verifyResult != ValidationStatus.Success) | ||
throw new InvalidOperationException($"Invalid multi transaction, {verifyResult.ToString()}: {this}"); | ||
|
||
if (Signature.IsEmpty) | ||
return this.ToByteArray(); | ||
|
||
var multiTransaction = Clone(); | ||
multiTransaction.Signature = ByteString.Empty; | ||
return multiTransaction.ToByteArray(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/AElf.WebApp.Application.Chain/Dto/SendMultiTransactionInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace AElf.WebApp.Application.Chain.Dto; | ||
|
||
public class SendMultiTransactionInput : SendTransactionsInput | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
src/AElf.WebApp.Application.Chain/Dto/SendMultiTransactionOutput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace AElf.WebApp.Application.Chain.Dto; | ||
|
||
public class SendMultiTransactionOutput | ||
{ | ||
public string[] TransactionIds { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace AElf.WebApp.Application.Chain; | ||
|
||
public class MultiTransactionOptions | ||
{ | ||
public string GatewayAddress { get; set; } | ||
public string GatewayContractAddress { get; set; } | ||
} |
Oops, something went wrong.