Skip to content

Commit

Permalink
Merge pull request #114 from LayerTwo-Labs/marc
Browse files Browse the repository at this point in the history
new starter file format
  • Loading branch information
mplatt8 authored Sep 13, 2024
2 parents a87abe0 + b40fa50 commit f29a950
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 16 deletions.
Binary file added assets/images/icons8-wallet-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/images/icons8-wallet-100.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://ur4flpu4avin"
path="res://.godot/imported/icons8-wallet-100.png-f1451533ce8867fe9dac141a0838dbe6.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/icons8-wallet-100.png"
dest_files=["res://.godot/imported/icons8-wallet-100.png-f1451533ce8867fe9dac141a0838dbe6.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added assets/images/wallet-check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/images/wallet-check.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://idhpbwi2nf2o"
path="res://.godot/imported/wallet-check.png-73faf5f04c852000fbd6f5b45366f1b4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/wallet-check.png"
dest_files=["res://.godot/imported/wallet-check.png-73faf5f04c852000fbd6f5b45366f1b4.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
4 changes: 4 additions & 0 deletions entropy_theme.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[gd_resource type="Theme" format=3 uid="uid://ddwjiywfvqp62"]

[resource]
LineEdit/colors/font_placeholder_color = Color(1, 0.427451, 0, 1)
Binary file added resource/theme/bin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions resource/theme/bin.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bxg5warvc0q60"
path="res://.godot/imported/bin.png-8e6fb9dd765b426d1ed0ed2a988104b3.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://resource/theme/bin.png"
dest_files=["res://.godot/imported/bin.png-8e6fb9dd765b426d1ed0ed2a988104b3.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
35 changes: 19 additions & 16 deletions source/application/wallet_creator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -942,27 +942,30 @@ func get_sidechain_info():
return sidechain_info

func save_sidechain_info(sidechain_data):
var user_data_dir = OS.get_user_data_dir()
var wallet_starters_dir = user_data_dir.path_join("wallet_starters")

# Save master seed file
var master_seed_file = FileAccess.open(wallet_starters_dir.path_join("wallet_master_seed.txt"), FileAccess.WRITE)
if master_seed_file:
# Assuming sidechain_data["mainchain"] contains all necessary information
master_seed_file.store_string(JSON.stringify(sidechain_data["mainchain"]))
master_seed_file.close()
else:
print("Failed to save master seed file")

# Save mainchain and sidechain files with only the mnemonic phrases
for key in sidechain_data.keys():
if key.begins_with("sidechain_"):
var slot = key.split("_")[1]
var user_data_dir = OS.get_user_data_dir()
var filename = user_data_dir.path_join("wallet_starters/sidechain_%s_starter.txt" % slot)
if key.begins_with("sidechain_") or key == "mainchain":
var filename = wallet_starters_dir.path_join(key + "_starter.txt")
var file = FileAccess.open(filename, FileAccess.WRITE)
if file:
file.store_string(JSON.stringify(sidechain_data[key]))
# Save only the mnemonic phrase as plain text
file.store_string(sidechain_data[key]["mnemonic"])
file.close()
else:
print("Failed to save sidechain starter information for slot ", slot)
elif key.begins_with("mainchain"):
var user_data_dir = OS.get_user_data_dir()
var filename = user_data_dir.path_join("wallet_starters/mainchain_starter.txt")
var file = FileAccess.open(filename, FileAccess.WRITE)
if file:
file.store_string(JSON.stringify(sidechain_data[key]))
file.close()
else:
print("Failed to save sidechain starter information for mainchain")

print("Failed to save starter information for ", key)

func reset_wallet_tab():
clear_all_output()
entropy_in.text = ""
Expand Down

0 comments on commit f29a950

Please sign in to comment.