Module: Moac
- Defined in:
- lib/moac/open_ssl.rb,
lib/moac.rb,
lib/moac/tx.rb,
lib/moac/gas.rb,
lib/moac/key.rb,
lib/moac/sedes.rb,
lib/moac/utils.rb,
lib/moac/address.rb,
lib/moac/version.rb,
lib/moac/secp256k1.rb
Overview
Defined Under Namespace
Modules: Sedes, Utils
Classes: Address, Configuration, Gas, InvalidTransaction, Key, OpenSsl, Secp256k1, Tx, ValidationError
Constant Summary
collapse
- BYTE_ZERO =
"\x00".freeze
- UINT_MAX =
2**256 - 1
- UnsignedTx =
Tx.exclude([:v, :r, :s])
- VERSION =
"0.4.9"
Class Method Summary
collapse
Class Method Details
.chain_id ⇒ Object
28
29
30
|
# File 'lib/moac.rb', line 28
def chain_id
configuration.chain_id
end
|
20
21
22
|
# File 'lib/moac.rb', line 20
def configure
yield(configuration)
end
|
.prevent_replays? ⇒ Boolean
40
41
42
|
# File 'lib/moac.rb', line 40
def prevent_replays?
!chain_id.nil?
end
|
.replayable_chain_id ⇒ Object
24
25
26
|
# File 'lib/moac.rb', line 24
def replayable_chain_id
27
end
|
.replayable_v?(v) ⇒ Boolean
44
45
46
|
# File 'lib/moac.rb', line 44
def replayable_v?(v)
[replayable_chain_id, replayable_chain_id + 1].include? v
end
|
.tx_data_hex? ⇒ Boolean
48
49
50
|
# File 'lib/moac.rb', line 48
def tx_data_hex?
!!configuration.tx_data_hex
end
|
.v_base ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/moac.rb', line 32
def v_base
if chain_id
(chain_id * 2) + 35
else
replayable_chain_id
end
end
|