ethereum-tx 0.2.1 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/console +1 -1
- data/ethereum-tx.gemspec +5 -4
- data/lib/{ethereum/tx.rb → ethereum-tx.rb} +26 -3
- data/lib/{ethereum → ethereum-tx}/key.rb +1 -1
- data/lib/{ethereum → ethereum-tx}/open_ssl.rb +1 -1
- data/lib/{ethereum → ethereum-tx}/sedes.rb +1 -1
- data/lib/{ethereum → ethereum-tx}/utils.rb +2 -1
- metadata +24 -11
- data/lib/ethereum.rb +0 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7eff205b89b2dd3f4df69edeb1de683d078d1768
|
|
4
|
+
data.tar.gz: 0c2cb86325ab0e908cd1e91d6efd29c95ce1618c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b690b0f72f26621e368b33b79ca76bcc9c70a56642d56d783f0d057f8c835dd188b3179c5e0d71fbc471d7547fa57acb780ffd55ef7bb8416c3f5c387d16b112
|
|
7
|
+
data.tar.gz: 07a07199a54f69a8aae1b5ce3abb1e3f2e3c111a024bddf4b4d941e9b6064bb6c74849b83b01be62e16a39e87ad6ed72e4893b9a821c8ef8478ddbe5da361fe8
|
data/bin/console
CHANGED
data/ethereum-tx.gemspec
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'ethereum
|
|
4
|
+
require 'ethereum-tx'
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "ethereum-tx"
|
|
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Steve Ellis"]
|
|
10
10
|
spec.email = ["email@steveell.is"]
|
|
11
11
|
|
|
12
|
-
spec.summary = %q{
|
|
13
|
-
spec.description = %q{
|
|
14
|
-
spec.homepage = "https://github.com/se3000/
|
|
12
|
+
spec.summary = %q{Deprecated: see 'eth' gem instead}
|
|
13
|
+
spec.description = %q{Deprecated: see https://github.com/se3000/ruby-eth instead}
|
|
14
|
+
spec.homepage = "https://github.com/se3000/ruby-eth"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.require_paths = ["lib"]
|
|
21
21
|
|
|
22
22
|
spec.add_dependency "digest-sha3", "~> 1.1"
|
|
23
|
+
spec.add_dependency "ethereum-base", "0.1.2"
|
|
23
24
|
spec.add_dependency "ffi", "~> 1.0"
|
|
24
25
|
spec.add_dependency "money-tree", "~> 0.9"
|
|
25
26
|
spec.add_dependency "rlp", "~> 0.7"
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
require 'digest/sha3'
|
|
2
|
+
require 'ethereum/base'
|
|
3
|
+
require 'ffi'
|
|
4
|
+
require 'money-tree'
|
|
5
|
+
require 'rlp'
|
|
4
6
|
|
|
5
7
|
module Ethereum
|
|
6
8
|
class Tx
|
|
7
9
|
|
|
10
|
+
VERSION = "0.2.9"
|
|
11
|
+
|
|
12
|
+
BYTE_ZERO = "\x00".freeze
|
|
13
|
+
GTXCOST = 21000 # TX BASE GAS COST
|
|
14
|
+
GTXDATANONZERO = 68 # TX DATA NON ZERO BYTE GAS COST
|
|
15
|
+
GTXDATAZERO = 4 # TX DATA ZERO BYTE GAS COST
|
|
16
|
+
SECP256K1_N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
|
|
17
|
+
UINT_MAX = 2**256 - 1
|
|
18
|
+
|
|
19
|
+
autoload :Key, 'ethereum-tx/key'
|
|
20
|
+
autoload :OpenSsl, 'ethereum-tx/open_ssl'
|
|
21
|
+
autoload :Sedes, 'ethereum-tx/sedes'
|
|
22
|
+
autoload :Utils, 'ethereum-tx/utils'
|
|
23
|
+
|
|
24
|
+
class ValidationError < StandardError; end
|
|
25
|
+
class InvalidTransaction < ValidationError; end
|
|
26
|
+
|
|
8
27
|
include RLP::Sedes::Serializable
|
|
9
28
|
extend Sedes
|
|
10
29
|
|
|
@@ -44,6 +63,10 @@ module Ethereum
|
|
|
44
63
|
RLP.encode self
|
|
45
64
|
end
|
|
46
65
|
|
|
66
|
+
def hex
|
|
67
|
+
bin_to_hex encoded
|
|
68
|
+
end
|
|
69
|
+
|
|
47
70
|
def sign(key)
|
|
48
71
|
self.signature = key.sign(unsigned_encoded)
|
|
49
72
|
self.vrs = Utils.v_r_s_for signature
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ethereum-tx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steve Ellis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-07-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: digest-sha3
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: ethereum-base
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - '='
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 0.1.2
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - '='
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 0.1.2
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: ffi
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,7 +136,7 @@ dependencies:
|
|
|
122
136
|
- - "~>"
|
|
123
137
|
- !ruby/object:Gem::Version
|
|
124
138
|
version: '3.0'
|
|
125
|
-
description:
|
|
139
|
+
description: 'Deprecated: see https://github.com/se3000/ruby-eth instead'
|
|
126
140
|
email:
|
|
127
141
|
- email@steveell.is
|
|
128
142
|
executables: []
|
|
@@ -139,13 +153,12 @@ files:
|
|
|
139
153
|
- bin/console
|
|
140
154
|
- bin/setup
|
|
141
155
|
- ethereum-tx.gemspec
|
|
142
|
-
- lib/ethereum.rb
|
|
143
|
-
- lib/ethereum/key.rb
|
|
144
|
-
- lib/ethereum/open_ssl.rb
|
|
145
|
-
- lib/ethereum/sedes.rb
|
|
146
|
-
- lib/ethereum/
|
|
147
|
-
|
|
148
|
-
homepage: https://github.com/se3000/ethereum-tx
|
|
156
|
+
- lib/ethereum-tx.rb
|
|
157
|
+
- lib/ethereum-tx/key.rb
|
|
158
|
+
- lib/ethereum-tx/open_ssl.rb
|
|
159
|
+
- lib/ethereum-tx/sedes.rb
|
|
160
|
+
- lib/ethereum-tx/utils.rb
|
|
161
|
+
homepage: https://github.com/se3000/ruby-eth
|
|
149
162
|
licenses:
|
|
150
163
|
- MIT
|
|
151
164
|
metadata: {}
|
|
@@ -168,6 +181,6 @@ rubyforge_project:
|
|
|
168
181
|
rubygems_version: 2.5.1
|
|
169
182
|
signing_key:
|
|
170
183
|
specification_version: 4
|
|
171
|
-
summary:
|
|
184
|
+
summary: 'Deprecated: see ''eth'' gem instead'
|
|
172
185
|
test_files: []
|
|
173
186
|
has_rdoc:
|
data/lib/ethereum.rb
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
require 'digest/sha3'
|
|
2
|
-
require 'ffi'
|
|
3
|
-
require 'money-tree'
|
|
4
|
-
require 'rlp'
|
|
5
|
-
|
|
6
|
-
module Ethereum
|
|
7
|
-
|
|
8
|
-
BYTE_ZERO = "\x00".freeze
|
|
9
|
-
GTXCOST = 21000 # TX BASE GAS COST
|
|
10
|
-
GTXDATANONZERO = 68 # TX DATA NON ZERO BYTE GAS COST
|
|
11
|
-
GTXDATAZERO = 4 # TX DATA ZERO BYTE GAS COST
|
|
12
|
-
SECP256K1_N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
|
|
13
|
-
UINT_MAX = 2**256 - 1
|
|
14
|
-
|
|
15
|
-
autoload :Key, 'ethereum/key'
|
|
16
|
-
autoload :OpenSsl, 'ethereum/open_ssl'
|
|
17
|
-
autoload :Sedes, 'ethereum/sedes'
|
|
18
|
-
autoload :Tx, 'ethereum/tx'
|
|
19
|
-
autoload :Utils, 'ethereum/utils'
|
|
20
|
-
|
|
21
|
-
class ValidationError < StandardError; end
|
|
22
|
-
class InvalidTransaction < ValidationError; end
|
|
23
|
-
|
|
24
|
-
class Tx
|
|
25
|
-
VERSION = '0.2.1'
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
end
|