Skip to content

Commit

Permalink
fix: move optional value to end of schema, no empty memo (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
jurevans authored Dec 4, 2024
1 parent 7fa916b commit ee49600
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/namadillo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@namada/namadillo",
"version": "1.0.1",
"version": "1.0.2",
"description": "Namadillo",
"repository": "https://github.com/anoma/namada-interface/",
"author": "Heliax Dev <info@heliax.dev>",
Expand Down
6 changes: 3 additions & 3 deletions apps/namadillo/src/lib/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getTxProps = (
account: Account,
gasConfig: GasConfig,
chain: ChainSettings,
memo: string = ""
memo?: string
): WrapperTxProps => {
invariant(
!!account.publicKey,
Expand Down Expand Up @@ -93,7 +93,7 @@ export const buildTx = async <T>(
queryProps: T[],
txFn: (wrapperTxProps: WrapperTxProps, props: T) => Promise<TxMsgValue>,
publicKeyRevealed: boolean,
memo = ""
memo?: string
): Promise<EncodedTxData<T>> => {
const { tx } = sdk;
const wrapperTxProps = getTxProps(account, gasConfig, chain, memo);
Expand Down Expand Up @@ -184,7 +184,7 @@ export const buildTxPair = async <T>(
queryProps: T[],
txFn: (wrapperTxProps: WrapperTxProps, props: T) => Promise<TxMsgValue>,
owner: string,
memo = ""
memo?: string
): Promise<TransactionPair<T>> => {
const sdk = await getSdkInstance();
const publicKeyRevealed = await isPublicKeyRevealed(account.address);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/tx/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export class Tx {
return {
...wrapperTx,
commitments: commitments.map(
({ txType, hash, txCodeId, memo, data }) => ({
({ txType, hash, txCodeId, data, memo }) => ({
txType: txType as TxType,
hash,
txCodeId,
Expand Down
5 changes: 3 additions & 2 deletions packages/shared/lib/src/sdk/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ pub struct Commitment {
tx_type: TxType,
hash: String,
tx_code_id: String,
memo: Option<String>,
data: Vec<u8>,
memo: Option<String>,
}

#[derive(BorshSerialize, BorshDeserialize)]
Expand Down Expand Up @@ -242,6 +242,7 @@ impl TxDetails {
let memo = tx
.memo(&cmt)
.map(|memo_bytes| String::from_utf8_lossy(&memo_bytes).to_string());

let hash = cmt.get_hash().to_string();
let tx_code_id = tx
.get_section(cmt.code_sechash())
Expand All @@ -265,8 +266,8 @@ impl TxDetails {
tx_type,
hash,
tx_code_id,
memo,
data,
memo,
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/tx/schema/txDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export class CommitmentMsgValue {
@field({ type: "string" })
txCodeId!: string;

@field({ type: option("string") })
memo?: string;

@field({ type: vec("u8") })
data!: Uint8Array;

@field({ type: option("string") })
memo?: string;
}

export class TxDetailsMsgValue {
Expand Down

1 comment on commit ee49600

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.