Sha256: 32063129c944ca12082d44c3fdb6afb4c74f44ba6d88047e1e0c38dd0baf8e97

Contents?: true

Size: 496 Bytes

Versions: 9

Compression:

Stored size: 496 Bytes

Contents

# encoding: ascii-8bit

module Bitcoin

  module Protocol

    class ScriptWitness

      # witness stack
      attr_reader :stack

      def initialize
        @stack = []
      end

      # check empty
      def empty?
        stack.empty?
      end

      # output script in raw binary format
      def to_payload
        payload = Bitcoin::Protocol.pack_var_int(stack.size)
        payload << stack.map{|e| Bitcoin::Protocol.pack_var_int(e.bytesize) << e }.join
      end

    end

  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
bitcoin-ruby-0.0.18 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.17 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.16 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.15 lib/bitcoin/protocol/script_witness.rb
monacoin-ruby-0.1.3 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.14 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.13 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.12 lib/bitcoin/protocol/script_witness.rb
bitcoin-ruby-0.0.11 lib/bitcoin/protocol/script_witness.rb