abiparser 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +0 -1
- data/Rakefile +0 -1
- data/lib/abiparser/constructor.rb +3 -2
- data/lib/abiparser/function.rb +10 -10
- data/lib/abiparser/version.rb +1 -1
- data/lib/abiparser.rb +0 -3
- metadata +2 -17
- data/lib/abiparser/export/interface.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a9e9d6e7fd96f5cc50bf046151754aec1d11ab4a4df53bb9efe8c7a3cf237ba
|
4
|
+
data.tar.gz: ef846c87b232b62ff1df5cc482a6bcdf729ef2a0ad91e97366f0a403cdbe9182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b80f5b2331c82b00c3fa887d6b12df87b04559c73f17c867708e68e691d31ea3415bbe91ef621e287be3a21ad11465f9bedde695f40588e5fd666bfec015075
|
7
|
+
data.tar.gz: 7c6d57732d945ce73e68994804946237a443dc7ae0cb3268b53917021e9a1774b2a862e300344478cdb8544bc3de58c3895dacdc3805713236a9eea909ab7b6e
|
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -47,7 +47,8 @@ class Constructor
|
|
47
47
|
end
|
48
48
|
|
49
49
|
|
50
|
-
attr_reader :inputs
|
50
|
+
attr_reader :inputs
|
51
|
+
## :input_types
|
51
52
|
|
52
53
|
def initialize( inputs: [],
|
53
54
|
payable: false )
|
@@ -57,7 +58,7 @@ class Constructor
|
|
57
58
|
## parse inputs into types
|
58
59
|
## note: use "calculated" sig(nature) and NOT the type
|
59
60
|
## (differs for tuples, that is, types with components !!!)
|
60
|
-
@input_types = @inputs.map {|param| Type.parse( param.sig ) }
|
61
|
+
## @input_types = @inputs.map {|param| Type.parse( param.sig ) }
|
61
62
|
end
|
62
63
|
|
63
64
|
|
data/lib/abiparser/function.rb
CHANGED
@@ -54,8 +54,8 @@ class Function
|
|
54
54
|
|
55
55
|
|
56
56
|
attr_reader :name,
|
57
|
-
:inputs, :outputs
|
58
|
-
:input_types, :output_types
|
57
|
+
:inputs, :outputs
|
58
|
+
## :input_types, :output_types
|
59
59
|
|
60
60
|
def initialize( name,
|
61
61
|
inputs: [],
|
@@ -73,14 +73,14 @@ class Function
|
|
73
73
|
## parse inputs & outputs into types
|
74
74
|
## note: use "calculated" sig(nature) and NOT the type
|
75
75
|
## (differs for tuples, that is, types with components !!!)
|
76
|
-
@input_types = @inputs.map do |param|
|
77
|
-
|
78
|
-
|
79
|
-
@output_types = @outputs.map do |param|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
76
|
+
## @input_types = @inputs.map do |param|
|
77
|
+
## Type.parse( param.sig )
|
78
|
+
## end
|
79
|
+
## @output_types = @outputs.map do |param|
|
80
|
+
## ## pp param
|
81
|
+
## ## puts "sig: #{param.sig}"
|
82
|
+
## Type.parse( param.sig )
|
83
|
+
## end
|
84
84
|
end
|
85
85
|
|
86
86
|
|
data/lib/abiparser/version.rb
CHANGED
data/lib/abiparser.rb
CHANGED
@@ -36,7 +36,6 @@ def sig( bin )
|
|
36
36
|
end
|
37
37
|
|
38
38
|
|
39
|
-
require 'abicoder'
|
40
39
|
|
41
40
|
|
42
41
|
## our own code
|
@@ -49,8 +48,6 @@ require_relative 'abiparser/utils'
|
|
49
48
|
require_relative 'abiparser/contract'
|
50
49
|
require_relative 'abiparser/interface'
|
51
50
|
|
52
|
-
require_relative 'abiparser/export/interface'
|
53
|
-
|
54
51
|
|
55
52
|
|
56
53
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abiparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocos
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: abicoder
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rdoc
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,7 +103,6 @@ files:
|
|
117
103
|
- lib/abiparser.rb
|
118
104
|
- lib/abiparser/constructor.rb
|
119
105
|
- lib/abiparser/contract.rb
|
120
|
-
- lib/abiparser/export/interface.rb
|
121
106
|
- lib/abiparser/function.rb
|
122
107
|
- lib/abiparser/interface.rb
|
123
108
|
- lib/abiparser/param.rb
|
@@ -1,56 +0,0 @@
|
|
1
|
-
module ABI
|
2
|
-
class Contract
|
3
|
-
|
4
|
-
|
5
|
-
def generate_interface( name: ) ## interface declarations
|
6
|
-
buf = ''
|
7
|
-
buf << "interface #{name} {"
|
8
|
-
|
9
|
-
|
10
|
-
# include constructor - why? why not?
|
11
|
-
#
|
12
|
-
# if @ctor
|
13
|
-
# buf << "\n"
|
14
|
-
# buf << "// Constructor\n"
|
15
|
-
# buf << "#{@ctor.decl}\n"
|
16
|
-
# end
|
17
|
-
|
18
|
-
if payable_functions.size > 0
|
19
|
-
buf << "\n"
|
20
|
-
buf << "// #{payable_functions.size} Payable Function(s)\n"
|
21
|
-
payable_functions.each do |func|
|
22
|
-
buf << "#{func.decl}\n"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
if transact_functions.size > 0
|
27
|
-
buf << "\n"
|
28
|
-
buf << "// #{transact_functions.size} Transact Functions(s)\n"
|
29
|
-
transact_functions.each do |func|
|
30
|
-
buf << "#{func.decl}\n"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
if query_functions.size > 0
|
35
|
-
buf << "\n"
|
36
|
-
buf << "// #{query_functions.size} Query Functions(s)\n"
|
37
|
-
query_functions.each do |func|
|
38
|
-
buf << "#{func.decl}\n"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
if helper_functions.size > 0
|
43
|
-
buf << "\n"
|
44
|
-
buf << "// #{helper_functions.size} Helper Functions(s)\n\n"
|
45
|
-
helper_functions.each do |func|
|
46
|
-
buf << "#{func.decl}\n"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
buf << "}\n"
|
51
|
-
buf
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
end ## class Contract
|
56
|
-
end ## module ABI
|