From ff5d366759e3b5cd9cc1da3065705f04f70bb736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Pie=C5=84kowski?= Date: Mon, 17 Jul 2023 23:50:26 +0200 Subject: [PATCH] Add a test case for decoding an unsigned transaction --- spec/eth/tx_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/eth/tx_spec.rb b/spec/eth/tx_spec.rb index 1383457b..f4e02487 100644 --- a/spec/eth/tx_spec.rb +++ b/spec/eth/tx_spec.rb @@ -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