Skip to content

Commit

Permalink
feat: create type script when process block
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Aug 1, 2019
1 parent be5b7e3 commit ccd1027
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/models/ckb_sync/node_data_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def build_cell_outputs(node_outputs, ckb_transaction, addresses)
addresses << address
cell_output = build_cell_output(ckb_transaction, output, address, cell_index)
build_lock_script(cell_output, output.lock, address)
build_type_script(cell_output, output.type)
cell_index += 1

cell_output
Expand All @@ -170,5 +171,15 @@ def build_lock_script(cell_output, lock_script, address)
hash_type: lock_script.hash_type
)
end

def build_type_script(cell_output, type_script)
return if type_script.blank?

cell_output.build_type_script(
args: type_script.args,
code_hash: type_script.code_hash,
hash_type: type_script.hash_type
)
end
end
end

0 comments on commit ccd1027

Please sign in to comment.