Skip to content

Commit 0b778b5

Browse files
committed
ci(spm): harden sed patterns for Data.bytes → Array(data) in SSFTransferService files (whitespace tolerant + broad fallbacks)
Signed-off-by: William Richter <[email protected]>
1 parent 3927d51 commit 0b778b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/spm-shared-features-fixes.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,20 @@ patch_private_key_calls() {
114114
local f1="$base/Sources/SSFTransferService/WalletConnectTransferServiceAssembly.swift"
115115
local f2="$base/Sources/SSFTransferService/InternalServices/Ethereum/EthereumTransferServiceAssembly.swift"
116116
if [[ -f "$f1" ]]; then
117+
# Strict replacement
117118
/usr/bin/sed -i '' -e 's/EthereumPrivateKey(privateKey: privateKey\.bytes)/EthereumPrivateKey(privateKey: Array(privateKey))/' "$f1" || true
119+
# Whitespace-tolerant replacement
120+
/usr/bin/sed -E -i '' -e 's/EthereumPrivateKey\(\s*privateKey:\s*privateKey\s*\.\s*bytes\s*\)/EthereumPrivateKey(privateKey: Array(privateKey))/' "$f1" || true
121+
# Fallback: replace property access broadly within this file only
122+
/usr/bin/sed -E -i '' -e 's/privateKey\s*\.\s*bytes/Array(privateKey)/g' "$f1" || true
118123
fi
119124
if [[ -f "$f2" ]]; then
125+
# Strict replacement
120126
/usr/bin/sed -i '' -e 's/EthereumPrivateKey(privateKey: secretKeyData\.bytes)/EthereumPrivateKey(privateKey: Array(secretKeyData))/' "$f2" || true
127+
# Whitespace-tolerant replacement
128+
/usr/bin/sed -E -i '' -e 's/EthereumPrivateKey\(\s*privateKey:\s*secretKeyData\s*\.\s*bytes\s*\)/EthereumPrivateKey(privateKey: Array(secretKeyData))/' "$f2" || true
129+
# Fallback: replace property access broadly within this file only
130+
/usr/bin/sed -E -i '' -e 's/secretKeyData\s*\.\s*bytes/Array(secretKeyData)/g' "$f2" || true
121131
fi
122132
}
123133

0 commit comments

Comments
 (0)