Skip to content

Commit 8f124c3

Browse files
sgbettclaude
andcommitted
fix: pass args as positional Hash to create_action (#414)
The wallet's create_action signature is `create_action(args, _originator: nil)` where args is a positional Hash. Passing bare keyword arguments fails on Ruby 3.0+ with `ArgumentError: unknown keywords`. Wrap in explicit `{}` and update spec mocks to match the real wallet interface signature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1314cf0 commit 8f124c3

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

gem/bsv-attest/lib/bsv/attest.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ def publish(data, wallet: nil, description: nil)
3535
desc = description || 'Attest data hash to chain'
3636

3737
result = w.create_action(
38-
description: desc,
39-
outputs: [{
40-
locking_script: script.to_hex,
41-
satoshis: 0,
42-
output_description: 'Attestation hash'
43-
}],
44-
options: { randomize_outputs: false }
38+
{
39+
description: desc,
40+
outputs: [{
41+
locking_script: script.to_hex,
42+
satoshis: 0,
43+
output_description: 'Attestation hash'
44+
}],
45+
options: { randomize_outputs: false }
46+
}
4547
)
4648

4749
raise BroadcastError, result[:broadcast_error] if result[:broadcast_error]

gem/bsv-attest/spec/bsv/attest_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
let(:mock_wallet) do
4848
Class.new do
49-
def create_action(_args)
49+
def create_action(_args, _originator: nil)
5050
{ txid: 'bb' * 32 }
5151
end
5252
end.new
@@ -56,7 +56,7 @@ def create_action(_args)
5656
Class.new do
5757
attr_reader :last_args
5858

59-
def create_action(args)
59+
def create_action(args, _originator: nil)
6060
@last_args = args
6161
{ txid: 'bb' * 32 }
6262
end
@@ -101,7 +101,7 @@ def create_action(args)
101101

102102
it 'raises BroadcastError on broadcast failure' do
103103
failing_wallet = Class.new do
104-
def create_action(_args)
104+
def create_action(_args, _originator: nil)
105105
{ txid: 'bb' * 32, broadcast_error: 'transaction rejected' }
106106
end
107107
end.new

0 commit comments

Comments
 (0)