Skip to content

Commit 2d47ecc

Browse files
committed
Fix program extend size
1 parent ed59275 commit 2d47ecc

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/actions/write-program-buffer/action.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ runs:
7171
shell: bash
7272
run: |
7373
REQUIRED_SIZE=$(wc -c < ./target/deploy/${{ inputs.program }}.so)
74+
CURRENT_SIZE="${{ steps.check-program.outputs.data_len }}"
7475
echo "Required size: $REQUIRED_SIZE"
76+
echo "Current size: $CURRENT_SIZE"
7577
76-
if [ "$REQUIRED_SIZE" -gt "${{ steps.check-program.outputs.data_len }}" ]; then
77-
echo "Program needs to be resized"
78-
solana program extend ${{ inputs.program-id }} $REQUIRED_SIZE \
78+
if [ "$REQUIRED_SIZE" -gt "$CURRENT_SIZE" ]; then
79+
EXTEND_SIZE=$((REQUIRED_SIZE - CURRENT_SIZE))
80+
echo "Program needs to be extended by $EXTEND_SIZE bytes"
81+
solana program extend ${{ inputs.program-id }} $EXTEND_SIZE \
7982
--keypair ./deploy-keypair.json \
8083
--url ${{ inputs.rpc-url }} \
8184
--commitment confirmed

readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ npx ts-node scripts/squad-closebuffer.ts \
162162
--program "BhV84MZrRnEvtWLdWMRJGJr1GbusxfVMHAwc3pq92g4z"
163163
```
164164

165+
# Release v0.2.3
166+
167+
## Bug Fixes
168+
169+
- Fix extend program size check
170+
165171
# Release v0.2.2
166172

167173
## Bug Fixes

0 commit comments

Comments
 (0)