diff --git a/.changeset/quiet-otters-repeat.md b/.changeset/quiet-otters-repeat.md new file mode 100644 index 0000000000..9b4b1b4cad --- /dev/null +++ b/.changeset/quiet-otters-repeat.md @@ -0,0 +1,11 @@ +--- +"@layerzerolabs/lzapp-migration-example": patch +"@layerzerolabs/mint-burn-oft-adapter-example": patch +"@layerzerolabs/native-oft-adapter-example": patch +"@layerzerolabs/oft-adapter-example": patch +"@layerzerolabs/oft-solana-example": patch +"@layerzerolabs/oft-upgradeable-example": patch +"@layerzerolabs/ovault-evm-example": patch +--- + +Omit the `OFT:` fragment from send-task error messages when `--oft-address` is not supplied, instead of printing `OFT: undefined`. diff --git a/examples/lzapp-migration/tasks/evm/v1/sendEvm.ts b/examples/lzapp-migration/tasks/evm/v1/sendEvm.ts index e1e5724786..7b2adafc77 100644 --- a/examples/lzapp-migration/tasks/evm/v1/sendEvm.ts +++ b/examples/lzapp-migration/tasks/evm/v1/sendEvm.ts @@ -45,7 +45,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/lzapp-migration/tasks/solana/sendSolana.ts b/examples/lzapp-migration/tasks/solana/sendSolana.ts index 8d3f32ccf7..a3214a9bcf 100644 --- a/examples/lzapp-migration/tasks/solana/sendSolana.ts +++ b/examples/lzapp-migration/tasks/solana/sendSolana.ts @@ -163,7 +163,7 @@ export async function sendSolana({ } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/mint-burn-oft-adapter/tasks/sendEvm.ts b/examples/mint-burn-oft-adapter/tasks/sendEvm.ts index 359f0c2f80..f63faaaf57 100644 --- a/examples/mint-burn-oft-adapter/tasks/sendEvm.ts +++ b/examples/mint-burn-oft-adapter/tasks/sendEvm.ts @@ -55,7 +55,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -216,7 +216,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -229,7 +229,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_SENDING_TRANSACTION, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/native-oft-adapter/tasks/sendEvm.ts b/examples/native-oft-adapter/tasks/sendEvm.ts index 714e451270..2593523735 100644 --- a/examples/native-oft-adapter/tasks/sendEvm.ts +++ b/examples/native-oft-adapter/tasks/sendEvm.ts @@ -78,7 +78,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -271,7 +271,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -298,7 +298,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_SENDING_TRANSACTION, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/oft-adapter/tasks/sendEvm.ts b/examples/oft-adapter/tasks/sendEvm.ts index 359f0c2f80..f63faaaf57 100644 --- a/examples/oft-adapter/tasks/sendEvm.ts +++ b/examples/oft-adapter/tasks/sendEvm.ts @@ -55,7 +55,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -216,7 +216,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -229,7 +229,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_SENDING_TRANSACTION, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/oft-solana/tasks/evm/sendEvm.ts b/examples/oft-solana/tasks/evm/sendEvm.ts index b5bddd5055..2ea8545850 100644 --- a/examples/oft-solana/tasks/evm/sendEvm.ts +++ b/examples/oft-solana/tasks/evm/sendEvm.ts @@ -37,7 +37,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -114,7 +114,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -127,7 +127,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_SENDING_TRANSACTION, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/oft-solana/tasks/solana/sendSolana.ts b/examples/oft-solana/tasks/solana/sendSolana.ts index 4f763330b3..e777bdbaab 100644 --- a/examples/oft-solana/tasks/solana/sendSolana.ts +++ b/examples/oft-solana/tasks/solana/sendSolana.ts @@ -183,7 +183,7 @@ export async function sendSolana({ } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/oft-upgradeable/tasks/sendEvm.ts b/examples/oft-upgradeable/tasks/sendEvm.ts index 359f0c2f80..f63faaaf57 100644 --- a/examples/oft-upgradeable/tasks/sendEvm.ts +++ b/examples/oft-upgradeable/tasks/sendEvm.ts @@ -55,7 +55,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -216,7 +216,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -229,7 +229,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_SENDING_TRANSACTION, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } diff --git a/examples/ovault-evm/tasks/sendEvm.ts b/examples/ovault-evm/tasks/sendEvm.ts index c7a416b296..551a0d58d4 100644 --- a/examples/ovault-evm/tasks/sendEvm.ts +++ b/examples/ovault-evm/tasks/sendEvm.ts @@ -55,7 +55,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_GETTING_HRE, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -231,7 +231,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_QUOTING_NATIVE_GAS_COST, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error } @@ -254,7 +254,7 @@ export async function sendEvm( } catch (error) { DebugLogger.printErrorAndFixSuggestion( KnownErrors.ERROR_SENDING_TRANSACTION, - `For network: ${endpointIdToNetwork(srcEid)}, OFT: ${oftAddress}` + `For network: ${endpointIdToNetwork(srcEid)}${oftAddress ? `, OFT: ${oftAddress}` : ''}` ) throw error }