Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Nov 3, 2023
1 parent d543905 commit c519726
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Lib9c.Policy/NCStagePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ public IEnumerable<Transaction> Iterate(BlockChain blockChain, bool filtered = t
s.Add(tx);
int txQuotaPerSigner = _quotaPerSigner;
Console.WriteLine("[ACS-TEST] 1. txQuota for {0}: txQuotaPerSigner: {1} _quotaPerSigner: {2} sCount: {3}", tx.Signer, txQuotaPerSigner, _quotaPerSigner, s.Count);
if (_accessControlService != null)

// update txQuotaPerSigner if ACS returns a value for the signer.
if (_accessControlService?.GetTxQuota(tx.Signer) is { } acsTxQuota)
{
// update txQuotaPerSigner if ACS returns a value for the signer.
if (_accessControlService.GetTxQuota(tx.Signer) is { } acsTxQuota)
{
Console.WriteLine("[ACS-TEST] acsTxQuota for {0}: {1}", tx.Signer, acsTxQuota);
txQuotaPerSigner = acsTxQuota;
}
Console.WriteLine("[ACS-TEST] acsTxQuota for {0}: {1}", tx.Signer, acsTxQuota);
txQuotaPerSigner = acsTxQuota;
}

Console.WriteLine("[ACS-TEST] 2. txQuota for {0}: txQuotaPerSigner: {1} _quotaPerSigner: {2} sCount: {3}", tx.Signer, txQuotaPerSigner, _quotaPerSigner, s.Count);
Expand All @@ -93,9 +91,9 @@ public IEnumerable<Transaction> Iterate(BlockChain blockChain, bool filtered = t

public bool Stage(BlockChain blockChain, Transaction transaction)
{
var acsTxQuota = _accessControlService?.GetTxQuota(transaction.Signer);
Console.WriteLine("[ACS-TEST-STAGE] STAGE acsTxQuota for {0}: {1}", transaction.Signer, acsTxQuota);
if (acsTxQuota == 0)
// var acsTxQuota = _accessControlService?.GetTxQuota(transaction.Signer);
// Console.WriteLine("[ACS-TEST-STAGE] STAGE acsTxQuota for {0}: {1}", transaction.Signer, acsTxQuota);
if (_accessControlService?.GetTxQuota(transaction.Signer) is { } acsTxQuota and 0)

Check failure on line 96 in Lib9c.Policy/NCStagePolicy.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'and pattern' is not available in C# 8.0. Please use language version 9.0 or greater.

Check failure on line 96 in Lib9c.Policy/NCStagePolicy.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Feature 'and pattern' is not available in C# 8.0. Please use language version 9.0 or greater.
{
Console.WriteLine("[ACS-TEST-STAGE] DENY TX STAGING for {0}: {1}", transaction.Signer, acsTxQuota);
return false;
Expand Down

0 comments on commit c519726

Please sign in to comment.