Conversation
|
saturn-dbeal
left a comment
There was a problem hiding this comment.
Tests pass (6/6). The output formatting improvements are nice — cleaner structure with separators and better readability. However, there are a few issues that should be addressed:
-
Balance check moved inside
!quietblock — The insufficient balance check is now gated byif (!quiet), meaning in quiet mode the user won't get the early error and will instead get a cryptic transaction failure. The balance check should always run. -
Breaking change to function signature — The
tagsparameter was moved beforeonChainRegistryin the function signature. This is a breaking change for any callers using positional arguments. Not necessarily wrong, but worth documenting if intentional. -
Changed from
toStorage.registry.publishManytoonChainRegistry.publishMany— This bypasses the storage abstraction layer. IftoStorage.registrywas ever a different registry implementation thanonChainRegistry, this would change behavior. Looks like they're always the same in practice, but the change is worth calling out.
|
|
||
| if (totalFees >= balance) { | ||
| throw new Error('You do not appear to have enough ETH in your wallet to publish'); | ||
| } |
There was a problem hiding this comment.
The balance check is now inside if (!quiet), meaning in quiet mode the insufficient balance check is skipped. The transaction will still fail, but the user gets a less helpful error. Consider moving the balance check outside the !quiet block:
if (onChainRegistry instanceof OnChainRegistry) {
const totalFees = await onChainRegistry.calculatePublishingFee(publishCalls.length);
if (totalFees > 0n) {
const balance = await onChainRegistry.provider!.getBalance({
address: onChainRegistry.signer!.address
});
if (totalFees >= balance) {
throw new Error('You do not appear to have enough ETH in your wallet to publish');
}
}
if (!quiet) {
log(bold('\nTransaction Details:'));
log(gray(` Publishing Fee: ${viem.formatEther(totalFees)} ETH`));
}
}| if (!verification.confirmation) { | ||
| log('Cancelled'); | ||
| process.exit(1); | ||
| if (!proceed) { |
There was a problem hiding this comment.
Good change — throw new Error('User aborted') is much better than process.exit(1) for testability and proper error handling upstream.
|
|
||
| if (!quiet) { | ||
| log(`\n${green('✓')} Successfully published packages`); | ||
| for (const txHash of txHashes) { |
There was a problem hiding this comment.
Good change — returning the txHashes makes this function more useful for programmatic consumers.
saturn-dbeal
left a comment
There was a problem hiding this comment.
Tests pass (6/6). The output formatting improvements are nice — cleaner structure with separators and better readability. However, there are a few issues that should be addressed:
-
Balance check moved inside
!quietblock — The insufficient balance check is now gated byif (!quiet), meaning in quiet mode the user won't get the early error and will instead get a cryptic transaction failure. The balance check should always run. -
Breaking change to function signature — The
tagsparameter was moved beforeonChainRegistryin the function signature. This is a breaking change for any callers using positional arguments. Not necessarily wrong, but worth documenting if intentional. -
Changed from
toStorage.registry.publishManytoonChainRegistry.publishMany— This bypasses the storage abstraction layer. IftoStorage.registrywas ever a different registry implementation thanonChainRegistry, this would change behavior. Looks like they're always the same in practice, but the change is worth calling out.
|
|
||
| if (totalFees >= balance) { | ||
| throw new Error('You do not appear to have enough ETH in your wallet to publish'); | ||
| } |
There was a problem hiding this comment.
The balance check is now inside if (!quiet), meaning in quiet mode the insufficient balance check is skipped. The transaction will still fail, but the user gets a less helpful error. Consider moving the balance check outside the !quiet block:
if (onChainRegistry instanceof OnChainRegistry) {
const totalFees = await onChainRegistry.calculatePublishingFee(publishCalls.length);
if (totalFees > 0n) {
const balance = await onChainRegistry.provider!.getBalance({
address: onChainRegistry.signer!.address
});
if (totalFees >= balance) {
throw new Error('You do not appear to have enough ETH in your wallet to publish');
}
}
if (!quiet) {
log(bold('\nTransaction Details:'));
log(gray(` Publishing Fee: ${viem.formatEther(totalFees)} ETH`));
}
}| if (!verification.confirmation) { | ||
| log('Cancelled'); | ||
| process.exit(1); | ||
| if (!proceed) { |
There was a problem hiding this comment.
Good change — throw new Error('User aborted') is much better than process.exit(1) for testability and proper error handling upstream.
|
|
||
| if (!quiet) { | ||
| log(`\n${green('✓')} Successfully published packages`); | ||
| for (const txHash of txHashes) { |
There was a problem hiding this comment.
Good change — returning the txHashes makes this function more useful for programmatic consumers.
saturn-dbeal
left a comment
There was a problem hiding this comment.
Tests pass (6/6). The output formatting improvements are nice — cleaner structure with separators and better readability. However, there are a few issues that should be addressed:
-
Balance check moved inside
!quietblock — The insufficient balance check is now gated byif (!quiet), meaning in quiet mode the user won't get the early error and will instead get a cryptic transaction failure. The balance check should always run. -
Breaking change to function signature — The
tagsparameter was moved beforeonChainRegistryin the function signature. This is a breaking change for any callers using positional arguments. Not necessarily wrong, but worth documenting if intentional. -
Changed from
toStorage.registry.publishManytoonChainRegistry.publishMany— This bypasses the storage abstraction layer. IftoStorage.registrywas ever a different registry implementation thanonChainRegistry, this would change behavior. Looks like they're always the same in practice, but the change is worth calling out.
saturn-dbeal
left a comment
There was a problem hiding this comment.
Tests pass (6/6). The output formatting improvements are nice — cleaner structure with separators and better readability. However, there are a few issues that should be addressed:
-
Balance check moved inside
!quietblock — The insufficient balance check is now gated byif (!quiet), meaning in quiet mode the user won't get the early error and will instead get a cryptic transaction failure. The balance check should always run. -
Breaking change to function signature — The
tagsparameter was moved beforeonChainRegistryin the function signature. This is a breaking change for any callers using positional arguments. Not necessarily wrong, but worth documenting if intentional. -
Changed from
toStorage.registry.publishManytoonChainRegistry.publishMany— This bypasses the storage abstraction layer. IftoStorage.registrywas ever a different registry implementation thanonChainRegistry, this would change behavior. Looks like they're always the same in practice, but the change is worth calling out.
No description provided.