Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

prevent double ACL checking on transaction submission #4075

Merged
merged 2 commits into from
May 31, 2018

Conversation

nklincoln
Copy link
Contributor

@nklincoln nklincoln commented May 30, 2018

Signed-off-by: Nick Lincoln nkl199@yahoo.co.uk

closes #4072

  • Convert submitTransaction to async/await
  • Make sure that both transaction and historian registry create is tested in advance
  • When creating registry items for historian and transaction, pass a flag to skip checking the access rights on those registries again.

Signed-off-by: Nick Lincoln <nkl199@yahoo.co.uk>
@nklincoln nklincoln requested a review from mbwhite May 30, 2018 07:51

// check that we can add to both these registries ahead of time
LOG.debug(method, 'Validating ability to create in Transaction and Historian registries');
let canTxAdd = await txRegistry.testAdd(transaction);
Copy link
Contributor

@mbwhite mbwhite May 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if it would more efficient to put an if check after each call

let canTxAdd = await txRegistry.testAdd(transaction);
if (canTxAdd){
   throw canTxAdd;
}
let canHistorianAdd = await historian.testAdd(record);
if (canHistorianAdd){
  throw canHistoriandAdd;
}

@nklincoln nklincoln added the P1 label May 31, 2018
@mbwhite mbwhite added the Next Build To Merge This is the next build that should be merged when it is completed. label May 31, 2018
@mbwhite mbwhite merged commit 3e15c89 into hyperledger-archives:master May 31, 2018
@mbwhite mbwhite removed the Next Build To Merge This is the next build that should be merged when it is completed. label May 31, 2018
@nklincoln nklincoln deleted the submitTransaction branch June 4, 2018 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

Double checking on ACL rules inside transactions
2 participants