Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Nov 1, 2023
1 parent 0b332ee commit a82162a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Lib9c.Policy/NCStagePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ public IEnumerable<Transaction> Iterate(BlockChain blockChain, bool filtered = t
if (_accessControlService != null)
{
// update txQuotaPerSigner if ACS returns a value for the signer.
int? acsTxQuota = _accessControlService.GetTxQuota(tx.Signer);
Console.WriteLine("[ACS-TEST] acsTxQuota for {0}: {1}", tx.Signer, acsTxQuota);
if (acsTxQuota.HasValue)
if (_accessControlService.GetTxQuota(tx.Signer) is { } acsTxQuota)
{
Console.WriteLine("[ACS-TEST] acsTxQuota for {0}: {1} NOT NULL", tx.Signer, acsTxQuota);
txQuotaPerSigner = (int)acsTxQuota;
Console.WriteLine("[ACS-TEST] acsTxQuota for {0}: {1}", tx.Signer, acsTxQuota);
txQuotaPerSigner = acsTxQuota;
}
}

Expand All @@ -96,8 +94,10 @@ public IEnumerable<Transaction> Iterate(BlockChain blockChain, bool filtered = t
public bool Stage(BlockChain blockChain, Transaction transaction)
{
var acsTxQuota = _accessControlService?.GetTxQuota(transaction.Signer);
if (_accessControlService != null && acsTxQuota == 0)
Console.WriteLine("[ACS-TEST-STAGE] STAGE acsTxQuota for {0}: {1}", transaction.Signer, acsTxQuota);
if (acsTxQuota == 0)
{
Console.WriteLine("[ACS-TEST-STAGE] DENY TX STAGING for {0}: {1}", transaction.Signer, acsTxQuota);
return false;
}

Expand Down

0 comments on commit a82162a

Please sign in to comment.