Closed d4mk0 closed 1 year ago
Yes, we marshall the parameters.
par = { to: "0x0000000000000000000000000000000000000000", value: 101 }
# => {:to=>"0x0000000000000000000000000000000000000000", :value=>101}
inf = Client.create "https://mainnet.infura.io/v3/#{TOKEN}"
# => #<Eth::Client::Http:0x0000563d103d1f50
# @gas_limit=21000,
# @host="mainnet.infura.io",
# @id=0,
# @max_fee_per_gas=0.4269e11,
# @max_priority_fee_per_gas=0.101e10,
# @port=443,
# @ssl=true,
# @uri=#<URI::HTTPS https://mainnet.infura.io/v3/#{TOKEN}>>
inf.eth_estimate_gas(par)
# => {"jsonrpc"=>"2.0", "id"=>1, "result"=>"0x5208"}
par
# => {:to=>"0x0000000000000000000000000000000000000000", :value=>"0x65"}
I have not considered this a problem, but I understand that this might cause an inconvenience. I'd be happy to accept a .dup
here.
Hi! I found unexpected problem with mutating object which i send as param. Code example
May be we solve this unexpected behavior by adding something like
params = params.dup
after https://github.com/q9f/eth.rb/blob/main/lib/eth/client.rb#L464 ?I can work with it, but some people can get problem like me now.