Method: Sidetree::Model::CoreProofFile#to_json

Defined in:
lib/sidetree/model/core_proof_file.rb

#to_jsonString

Build json string to be stored in CAS.

Returns:

  • (String)

    json string.



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/sidetree/model/core_proof_file.rb', line 92

def to_json
  operations = {}
  operations[:recover] = recover_proofs.map do |u|
    { signedData: u.to_s }
  end unless recover_proofs.empty?
  operations[:deactivate] = deactivate_proofs.map do |u|
    { signedData: u.to_s }
  end unless deactivate_proofs.empty?
  params = { operations: operations }
  params.to_json
end