Skip to content

Commit 84da4c0

Browse files
committed
default confirmations
1 parent 1ddb661 commit 84da4c0

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

.changeset/giant-schools-matter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@layerzerolabs/oft-solana-example": patch
3+
---
4+
5+
update Solana OFT debug script to state when default confirmations is used

examples/oft-solana/tasks/solana/debug.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,14 @@ function printOAppReceiveConfigs(
391391
// Print each property in the object
392392
DebugLogger.keyValue(`${oAppReceiveConfigIndexesToKeys[i]}`, '', 2)
393393
for (const [propKey, propVal] of Object.entries(item)) {
394-
const valueDisplay =
395-
(propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)
396-
? formatDvnAddresses(propVal as string[], metadata, chainKey)
397-
: String(propVal)
394+
let valueDisplay: string
395+
if ((propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)) {
396+
valueDisplay = formatDvnAddresses(propVal as string[], metadata, chainKey)
397+
} else if (propKey === 'confirmations' && String(propVal) === '0') {
398+
valueDisplay = '0 (Use Pathway Defaults)'
399+
} else {
400+
valueDisplay = String(propVal)
401+
}
398402
DebugLogger.keyValue(`${propKey}`, valueDisplay, 3)
399403
}
400404
} else {
@@ -427,10 +431,14 @@ function printOAppSendConfigs(
427431
if (typeof item === 'object' && item !== null) {
428432
DebugLogger.keyValue(`${sendOappConfigIndexesToKeys[i]}`, '', 2)
429433
for (const [propKey, propVal] of Object.entries(item)) {
430-
const valueDisplay =
431-
(propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)
432-
? formatDvnAddresses(propVal as string[], metadata, chainKey)
433-
: String(propVal)
434+
let valueDisplay: string
435+
if ((propKey === 'requiredDVNs' || propKey === 'optionalDVNs') && Array.isArray(propVal)) {
436+
valueDisplay = formatDvnAddresses(propVal as string[], metadata, chainKey)
437+
} else if (propKey === 'confirmations' && String(propVal) === '0') {
438+
valueDisplay = '0 (Use Pathway Defaults)'
439+
} else {
440+
valueDisplay = String(propVal)
441+
}
434442
DebugLogger.keyValue(`${propKey}`, valueDisplay, 3)
435443
}
436444
} else {

0 commit comments

Comments
 (0)