Skip to content

Commit

Permalink
eth/abi: implement packed encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
q9f committed Jan 2, 2025
1 parent 5d88db2 commit 5a023e2
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/eth/abi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def decode(types, data)
end
end

require "eth/abi/packed/decoder"
require "eth/abi/packed/encoder"
require "eth/abi/decoder"
require "eth/abi/encoder"
require "eth/abi/event"
Expand Down
29 changes: 29 additions & 0 deletions lib/eth/abi/packed/decoder.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2016-2023 The Ruby-Eth Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -*- encoding : ascii-8bit -*-

# Provides the {Eth} module.
module Eth

# Provides a Ruby implementation of the Ethereum Application Binary Interface (ABI).
module Abi
module Packed

# Provides a utility module to assist decoding ABIs.
module Decoder
end
end
end
end
29 changes: 29 additions & 0 deletions lib/eth/abi/packed/encoder.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2016-2023 The Ruby-Eth Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -*- encoding : ascii-8bit -*-

# Provides the {Eth} module.
module Eth

# Provides a Ruby implementation of the Ethereum Application Binary Interface (ABI).
module Abi
module Packed

# Provides a utility module to assist encoding ABIs.
module Encoder
end
end
end
end
6 changes: 6 additions & 0 deletions spec/eth/abi/packed/decoder_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- encoding : ascii-8bit -*-

require "spec_helper"

describe Abi::Packed::Decoder do
end
6 changes: 6 additions & 0 deletions spec/eth/abi/packed/encoder_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- encoding : ascii-8bit -*-

require "spec_helper"

describe Abi::Packed::Encoder do
end

0 comments on commit 5a023e2

Please sign in to comment.