Skip to content

Commit

Permalink
Add a test case for decoding an unsigned transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
pienkowb committed Jul 17, 2023
1 parent 9d44467 commit ff5d366
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/eth/tx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,17 @@
expect(tx.chain_id).to eq 56
end
end

describe '.decode an unsigned transaction' do
it "keeps the 'from' field blank" do
raw = "0x02f0050584b2d05e00851010b872008303841494caedbd63fb25c3126bfe96c1af208e4688e9817e87f6a3d9c63df00080c0"
tx = Tx.decode raw

expect(tx.signature_y_parity).to eq nil
expect(tx.signature_r).to eq 0
expect(tx.signature_s).to eq 0

expect(tx.sender).to eq ""
end
end
end

0 comments on commit ff5d366

Please sign in to comment.