File tree Expand file tree Collapse file tree
yarn-project/simulator/src/public Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ export class PublicContractsDB implements PublicContractsDBInterface {
5656 this . log = createLogger ( 'simulator:contracts-data-source' , bindings ) ;
5757 }
5858
59- public addContracts ( contractDeploymentData : ContractDeploymentData ) : void {
59+ /** Parses raw log data from the C++/NAPI bridge and inserts the resulting contracts into the current checkpoint. */
60+ public addContractsFromLogs ( contractDeploymentData : ContractDeploymentData ) : void {
6061 const currentState = this . getCurrentState ( ) ;
6162
6263 this . addContractClassesFromEvents (
@@ -72,8 +73,8 @@ export class PublicContractsDB implements PublicContractsDBInterface {
7273
7374 public addNewContracts ( tx : Tx ) : void {
7475 const contractDeploymentData = AllContractDeploymentData . fromTx ( tx ) ;
75- this . addContracts ( contractDeploymentData . getNonRevertibleContractDeploymentData ( ) ) ;
76- this . addContracts ( contractDeploymentData . getRevertibleContractDeploymentData ( ) ) ;
76+ this . addContractsFromLogs ( contractDeploymentData . getNonRevertibleContractDeploymentData ( ) ) ;
77+ this . addContractsFromLogs ( contractDeploymentData . getRevertibleContractDeploymentData ( ) ) ;
7778 }
7879
7980 /** Injects contract class and instance overrides directly into the current checkpoint. */
Original file line number Diff line number Diff line change @@ -61,9 +61,8 @@ export class ContractProviderForCpp implements ContractProvider {
6161 // Construct ContractDeploymentData from plain object.
6262 const contractDeploymentData = ContractDeploymentData . fromPlainObject ( rawData ) ;
6363
64- // Add contracts to the contracts DB
65- this . log . trace ( `Calling contractsDB.addContracts` ) ;
66- this . contractsDB . addContracts ( contractDeploymentData ) ;
64+ this . log . trace ( `Calling contractsDB.addContractsFromLogs` ) ;
65+ this . contractsDB . addContractsFromLogs ( contractDeploymentData ) ;
6766 } ;
6867
6968 public getBytecodeCommitment = async ( classId : string ) : Promise < Buffer | undefined > => {
Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ export class PublicTxSimulator implements PublicTxSimulatorInterface {
401401 // However, things work as expected because later calls to getters on the hintingContractsDB
402402 // will pick up the new contracts and will generate the necessary hints.
403403 // So, a consumer of the hints will always see the new contracts.
404- this . contractsDB . addContracts ( context . nonRevertibleContractDeploymentData ) ;
404+ this . contractsDB . addContractsFromLogs ( context . nonRevertibleContractDeploymentData ) ;
405405 }
406406
407407 /**
@@ -490,7 +490,7 @@ export class PublicTxSimulator implements PublicTxSimulatorInterface {
490490 // However, things work as expected because later calls to getters on the hintingContractsDB
491491 // will pick up the new contracts and will generate the necessary hints.
492492 // So, a consumer of the hints will always see the new contracts.
493- this . contractsDB . addContracts ( context . revertibleContractDeploymentData ) ;
493+ this . contractsDB . addContractsFromLogs ( context . revertibleContractDeploymentData ) ;
494494 }
495495
496496 private async payFee ( context : PublicTxContext ) {
You can’t perform that action at this time.
0 commit comments