Skip to content

Commit

Permalink
Merge pull request #1487 from KeystoneHQ/merge/v1.7.12
Browse files Browse the repository at this point in the history
Merge/v1.7.12
  • Loading branch information
soralit authored Dec 3, 2024
2 parents 956715c + ff03650 commit 51425de
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 9 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG-ZH.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.7.12(2024-12-03)

### 新增

1. 新增支持管理 Cosmos 上的 Neutron App Chain 资产

### Bug 修复

1. 修复了通过 Backpack 签名 Squads 交易设备扫码后重启问题


## 1.7.10(2024-11-18)
### 新增

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 1.7.12(2024-12-03)

### What's New

1. Supported managing assets on Neutron App Chain in Cosmos

### Bug Fixes

1. Fixed device reboot issue after QR scanning with Backpack for Squads transactions


## 1.7.10(2024-11-18)

Expand Down
Binary file added images/coin/coinNtrn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions rust/apps/cosmos/src/transaction/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub fn get_network_by_chain_id(chain_id: &str) -> Result<String> {
map.insert("phoenix", "Terra");
map.insert("columbus", "Terra Classic");
map.insert("thorchain", "THORChain");
map.insert("neutron", "Neutron");
let chain_id_parts: Vec<&str> = chain_id.split("-").collect();
let chain_id_prefix = if chain_id_parts.len() > 1 {
chain_id_parts[..chain_id_parts.len() - 1].join("-")
Expand Down Expand Up @@ -96,6 +97,7 @@ pub fn get_chain_id_by_address(address: &str) -> String {
map.insert("quick", "quicksilver-1");
map.insert("terra", "phoenix-1");
map.insert("thor", "thorchain");
map.insert("neutron", "neutron");
for (k, v) in map {
if address.starts_with(k) {
return v.to_string();
Expand Down
40 changes: 36 additions & 4 deletions rust/apps/solana/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,16 +507,48 @@ impl ParsedSolanaTx {
},
));
}
if let ProgramDetail::SquadsV4MultisigCreateV2(v) = &d.kind {
let memo = v.memo.clone().unwrap();
let memo = serde_json::from_str::<serde_json::Value>(&memo).unwrap();
let wallet_name = memo["n"]
.as_str()
.unwrap_or("SquadsV4 Multisig Wallet")
.to_string();
let wallet_desc = memo["d"].as_str().unwrap_or("").to_string();
let threshold = v.threshold;
let member_count = v.members.len();
let members = v
.members
.iter()
.map(|m| m.key.to_string())
.collect::<Vec<String>>();
let total_value = format!("~{:.3} SOL", total_value);
return Ok(SolanaOverview::SquadsV4MultisigCreate(
ProgramOverviewMultisigCreate {
wallet_name,
wallet_desc,
threshold,
member_count,
members,
total_value,
transfers: transfer_overview_vec,
},
));
}
}
return Self::build_instructions_overview(details);
}
fn build_squads_overview(details: &[SolanaDetail]) -> Result<SolanaOverview> {
if details
.iter()
.any(|d| matches!(d.kind, ProgramDetail::SquadsV4MultisigCreate(_)))
{
if details.iter().any(|d| {
matches!(
d.kind,
ProgramDetail::SquadsV4MultisigCreate(_)
| ProgramDetail::SquadsV4MultisigCreateV2(_)
)
}) {
return Self::build_squads_v4_multisig_overview(details);
}

if details.iter().any(|d| {
matches!(
d.kind,
Expand Down
2 changes: 2 additions & 0 deletions rust/apps/solana/src/solana_lib/squads_v4/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ mod tests {
#[test]
fn test_calculate_instruction_sighash() {
let multisig_create_sighash = sighash(SIGHASH_GLOBAL_NAMESPACE, "multisig_create");
let multisig_create_sighash_v2 = sighash(SIGHASH_GLOBAL_NAMESPACE, "multisig_create_v2");
let proposal_create_sighash = sighash(SIGHASH_GLOBAL_NAMESPACE, "proposal_create");
assert_eq!("7a4d509f54585ac5", hex::encode(multisig_create_sighash));
assert_eq!("32ddc75d28f58be9", hex::encode(multisig_create_sighash_v2));
assert_eq!("dc3c49e01e6c4f9f", hex::encode(proposal_create_sighash));
}
}
2 changes: 1 addition & 1 deletion src/config/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define SOFTWARE_VERSION_MAX_LEN (32)
#define SOFTWARE_VERSION_MAJOR 1
#define SOFTWARE_VERSION_MINOR 7
#define SOFTWARE_VERSION_BUILD 10
#define SOFTWARE_VERSION_BUILD 12
#define SOFTWARE_VERSION_BETA 0
#define SOFTWARE_VERSION (SOFTWARE_VERSION_MAJOR * 10000 + SOFTWARE_VERSION_MINOR * 100 + SOFTWARE_VERSION_BUILD)

Expand Down
84 changes: 84 additions & 0 deletions src/ui/gui_assets/coin/coinNtrn.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ui/gui_assets/images_hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dfeb510bb42a50b6628b3afac1aaf26b
1520ba38448f23027c73aa6aac2ab4ad
1 change: 1 addition & 0 deletions src/ui/gui_chain/gui_chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef enum {
CHAIN_STELLAR,
CHAIN_COSMOS,
CHAIN_TIA,
CHAIN_NTRN,
CHAIN_DYM,
CHAIN_OSMO,
CHAIN_INJ,
Expand Down
1 change: 1 addition & 0 deletions src/ui/gui_chain/others/gui_cosmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ static char g_cosmosAddr[MAX_COSMOS_ADDR_LEN];
static char g_hdPath[26];
static const CosmosChain_t g_cosmosChains[COSMOS_CHAINS_LEN] = {
{CHAIN_TIA, "celestia", 118, XPUB_TYPE_COSMOS, "celestia"},
{CHAIN_NTRN, "neutron", 118, XPUB_TYPE_COSMOS, "neutron-1"},
{CHAIN_DYM, "dym", 118, XPUB_TYPE_ETH_BIP44_STANDARD, "dymension_1100-1"},
{CHAIN_ATOM, "cosmos", 118, XPUB_TYPE_COSMOS, "cosmoshub-4"},
{CHAIN_OSMO, "osmo", 118, XPUB_TYPE_COSMOS, "osmosis-1"},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/gui_chain/others/gui_cosmos.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "rust.h"
#include "account_public_info.h"
#define COSMOS_CHAINS_LEN 33
#define COSMOS_CHAINS_LEN (CHAIN_BUTT - CHAIN_TIA)

typedef struct {
uint8_t index;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/gui_components/gui_status_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const static CoinWalletInfo_t g_coinWalletBtn[] = {
{HOME_WALLET_CARD_SUI, "", &coinSui}, {HOME_WALLET_CARD_DASH, "", &coinDash},
{HOME_WALLET_CARD_ARWEAVE, "", &coinAr}, {HOME_WALLET_CARD_XLM, "", &coinXlm},
{HOME_WALLET_CARD_COSMOS, "", &coinCosmos}, {HOME_WALLET_CARD_TIA, "", &coinTia},
{HOME_WALLET_CARD_DYM, "", &coinDym}, {HOME_WALLET_CARD_OSMO, "", &coinOsmo},
{HOME_WALLET_CARD_NTRN, "", &coinNtrn}, {HOME_WALLET_CARD_DYM, "", &coinDym}, {HOME_WALLET_CARD_OSMO, "", &coinOsmo},
{HOME_WALLET_CARD_INJ, "", &coinInj}, {HOME_WALLET_CARD_ATOM, "", &coinAtom},
{HOME_WALLET_CARD_CRO, "", &coinCro}, {HOME_WALLET_CARD_RUNE, "", &coinRune},
{HOME_WALLET_CARD_KAVA, "", &coinKava}, {HOME_WALLET_CARD_LUNC, "", &coinLunc}, {HOME_WALLET_CARD_AXL, "", &coinAxl},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/gui_frame/gui_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ LV_IMG_DECLARE(coinSats);
LV_IMG_DECLARE(coinXlm);
LV_IMG_DECLARE(coinRune);
LV_IMG_DECLARE(coinHelium);

LV_IMG_DECLARE(coinNtrn);
// wallet
LV_IMG_DECLARE(walletKeystone);
LV_IMG_DECLARE(walletMetamask);
Expand Down
7 changes: 7 additions & 0 deletions src/ui/gui_widgets/general/gui_home_widgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static WalletState_t g_walletState[HOME_WALLET_CARD_BUTT] = {
{HOME_WALLET_CARD_XLM, false, "XLM", true},
{HOME_WALLET_CARD_COSMOS, false, "Cosmos Eco", true},
{HOME_WALLET_CARD_TIA, false, "TIA", true},
{HOME_WALLET_CARD_NTRN, false, "NTRN", true},
{HOME_WALLET_CARD_DYM, false, "DYM", true},
{HOME_WALLET_CARD_OSMO, false, "OSMO", true},
{HOME_WALLET_CARD_INJ, false, "INJ", true},
Expand Down Expand Up @@ -253,6 +254,12 @@ static const ChainCoinCard_t g_coinCardArray[HOME_WALLET_CARD_BUTT] = {
.chain = "Celestia",
.icon = &coinTia,
},
{
.index = HOME_WALLET_CARD_NTRN,
.coin = "NTRN",
.chain = "Neutron",
.icon = &coinNtrn,
},
{
.index = HOME_WALLET_CARD_DYM,
.coin = "DYM",
Expand Down
1 change: 1 addition & 0 deletions src/ui/gui_widgets/general/gui_home_widgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ typedef enum {
HOME_WALLET_CARD_XLM,
HOME_WALLET_CARD_COSMOS,
HOME_WALLET_CARD_TIA,
HOME_WALLET_CARD_NTRN,
HOME_WALLET_CARD_DYM,
HOME_WALLET_CARD_OSMO,
HOME_WALLET_CARD_INJ,
Expand Down
6 changes: 6 additions & 0 deletions src/ui/gui_widgets/general/gui_standard_receive_widgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ static uint32_t g_stellarSelectIndex[3] = {0};
static uint32_t g_aptosSelectIndex[3] = {0};
static uint32_t g_xrpSelectIndex[3] = {0};
static uint32_t g_tiaChainSelectIndex[3] = {0};
static uint32_t g_ntrnChainSelectIndex[3] = {0};
static uint32_t g_dymChainSelectIndex[3] = {0};
static uint32_t g_osmoChainSelectIndex[3] = {0};
static uint32_t g_injChainSelectIndex[3] = {0};
Expand Down Expand Up @@ -951,6 +952,7 @@ void GuiResetCurrentStandardAddressIndex(uint8_t index)
g_aptosSelectIndex[index] = 0;
g_xrpSelectIndex[index] = 0;
g_tiaChainSelectIndex[index] = 0;
g_ntrnChainSelectIndex[index] = 0;
g_dymChainSelectIndex[index] = 0;
g_osmoChainSelectIndex[index] = 0;
g_injChainSelectIndex[index] = 0;
Expand Down Expand Up @@ -993,6 +995,7 @@ void GuiResetAllStandardAddressIndex(void)
memset_s(g_aptosSelectIndex, sizeof(g_aptosSelectIndex), 0, sizeof(g_aptosSelectIndex));
memset_s(g_xrpSelectIndex, sizeof(g_xrpSelectIndex), 0, sizeof(g_xrpSelectIndex));
memset_s(g_tiaChainSelectIndex, sizeof(g_tiaChainSelectIndex), 0, sizeof(g_tiaChainSelectIndex));
memset_s(g_ntrnChainSelectIndex, sizeof(g_ntrnChainSelectIndex), 0, sizeof(g_ntrnChainSelectIndex));
memset_s(g_dymChainSelectIndex, sizeof(g_dymChainSelectIndex), 0, sizeof(g_dymChainSelectIndex));
memset_s(g_osmoChainSelectIndex, sizeof(g_osmoChainSelectIndex), 0, sizeof(g_osmoChainSelectIndex));
memset_s(g_injChainSelectIndex, sizeof(g_injChainSelectIndex), 0, sizeof(g_injChainSelectIndex));
Expand Down Expand Up @@ -1033,6 +1036,9 @@ static uint32_t* GetCosmosChainCurrentSelectIndex()
case HOME_WALLET_CARD_TIA:
return &g_tiaChainSelectIndex[GetCurrentAccountIndex()];
break;
case HOME_WALLET_CARD_NTRN:
return &g_ntrnChainSelectIndex[GetCurrentAccountIndex()];
break;
case HOME_WALLET_CARD_DYM:
return &g_dymChainSelectIndex[GetCurrentAccountIndex()];
break;
Expand Down

0 comments on commit 51425de

Please sign in to comment.