Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: omiga inscription name and symbol can't be null string #1560

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/utils/ckb_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def self.parse_omiga_inscription_info(hex_data)
expected_supply = [data.slice!(0, 32)].pack("H*").unpack1("Q<2")
mint_limit = [data.slice!(0, 32)].pack("H*").unpack1("Q<2")
mint_status = "0x#{data.slice!(0, 2)}".to_i(16)
{ decimal:, name:, symbol:, udt_hash:, expected_supply:,
{ decimal:, name: name.presence, symbol: symbol.presence, udt_hash:, expected_supply:,
mint_limit:, mint_status: }
end
end
6 changes: 6 additions & 0 deletions test/utils/ckb_utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ class CkbUtilsTest < ActiveSupport::TestCase
udt_hash: "0xe0f8e095d975e21e1b451b582c9d0685104471d377c6589339b723f76c035c74", expected_supply: 2100000000000000, mint_limit: 100000000000, mint_status: 0 }
end

test "parse omiga inscription info data when name is null" do
data = "0x08004b42204669737420496e736372697074696f6e04434b4249e0f8e095d975e21e1b451b582c9d0685104471d377c6589339b723f76c035c740040075af0750700000000000000000000e8764817000000000000000000000000"
info = CkbUtils.parse_omiga_inscription_info(data)
assert_equal info[:name], nil
end

private

def node_data_processor
Expand Down
Loading