You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: yarn-project/pxe/src/logs/log_service.ts
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -50,8 +50,8 @@ export class LogService {
50
50
]);
51
51
52
52
if(publicLog!==null&&privateLog!==null){
53
-
thrownewError(
54
-
`Found both a public and private log when searching for tag ${request.tag} from contract ${request.contractAddress}`,
53
+
this.log.warn(
54
+
`Found both a public and private log for tag ${request.tag} from contract ${request.contractAddress}. This may indicate a contract bug. Returning the public log.`,
55
55
);
56
56
}
57
57
@@ -73,9 +73,8 @@ export class LogService {
73
73
if(logsForTag.length===0){
74
74
returnnull;
75
75
}elseif(logsForTag.length>1){
76
-
// TODO(#11627): handle this case
77
-
thrownewError(
78
-
`Got ${logsForTag.length} logs for tag ${tag} and contract ${contractAddress.toString()}. getPublicLogByTag currently only supports a single log per tag`,
76
+
this.log.warn(
77
+
`Expected at most 1 public log for tag ${tag} and contract ${contractAddress.toString()}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`,
79
78
);
80
79
}
81
80
@@ -97,9 +96,8 @@ export class LogService {
97
96
if(logsForTag.length===0){
98
97
returnnull;
99
98
}elseif(logsForTag.length>1){
100
-
// TODO(#11627): handle this case
101
-
thrownewError(
102
-
`Got ${logsForTag.length} logs for tag ${siloedTag}. getPrivateLogByTag currently only supports a single log per tag`,
99
+
this.log.warn(
100
+
`Expected at most 1 private log for tag ${siloedTag}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`,
0 commit comments