Skip to content

Commit ee49600

Browse files
authored
fix: move optional value to end of schema, no empty memo (#1379)
1 parent 7fa916b commit ee49600

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

apps/namadillo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@namada/namadillo",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Namadillo",
55
"repository": "https://github.com/anoma/namada-interface/",
66
"author": "Heliax Dev <[email protected]>",

apps/namadillo/src/lib/query.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const getTxProps = (
5050
account: Account,
5151
gasConfig: GasConfig,
5252
chain: ChainSettings,
53-
memo: string = ""
53+
memo?: string
5454
): WrapperTxProps => {
5555
invariant(
5656
!!account.publicKey,
@@ -93,7 +93,7 @@ export const buildTx = async <T>(
9393
queryProps: T[],
9494
txFn: (wrapperTxProps: WrapperTxProps, props: T) => Promise<TxMsgValue>,
9595
publicKeyRevealed: boolean,
96-
memo = ""
96+
memo?: string
9797
): Promise<EncodedTxData<T>> => {
9898
const { tx } = sdk;
9999
const wrapperTxProps = getTxProps(account, gasConfig, chain, memo);
@@ -184,7 +184,7 @@ export const buildTxPair = async <T>(
184184
queryProps: T[],
185185
txFn: (wrapperTxProps: WrapperTxProps, props: T) => Promise<TxMsgValue>,
186186
owner: string,
187-
memo = ""
187+
memo?: string
188188
): Promise<TransactionPair<T>> => {
189189
const sdk = await getSdkInstance();
190190
const publicKeyRevealed = await isPublicKeyRevealed(account.address);

packages/sdk/src/tx/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ export class Tx {
467467
return {
468468
...wrapperTx,
469469
commitments: commitments.map(
470-
({ txType, hash, txCodeId, memo, data }) => ({
470+
({ txType, hash, txCodeId, data, memo }) => ({
471471
txType: txType as TxType,
472472
hash,
473473
txCodeId,

packages/shared/lib/src/sdk/tx.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ pub struct Commitment {
211211
tx_type: TxType,
212212
hash: String,
213213
tx_code_id: String,
214-
memo: Option<String>,
215214
data: Vec<u8>,
215+
memo: Option<String>,
216216
}
217217

218218
#[derive(BorshSerialize, BorshDeserialize)]
@@ -242,6 +242,7 @@ impl TxDetails {
242242
let memo = tx
243243
.memo(&cmt)
244244
.map(|memo_bytes| String::from_utf8_lossy(&memo_bytes).to_string());
245+
245246
let hash = cmt.get_hash().to_string();
246247
let tx_code_id = tx
247248
.get_section(cmt.code_sechash())
@@ -265,8 +266,8 @@ impl TxDetails {
265266
tx_type,
266267
hash,
267268
tx_code_id,
268-
memo,
269269
data,
270+
memo,
270271
});
271272
}
272273
}

packages/types/src/tx/schema/txDetails.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export class CommitmentMsgValue {
1212
@field({ type: "string" })
1313
txCodeId!: string;
1414

15-
@field({ type: option("string") })
16-
memo?: string;
17-
1815
@field({ type: vec("u8") })
1916
data!: Uint8Array;
17+
18+
@field({ type: option("string") })
19+
memo?: string;
2020
}
2121

2222
export class TxDetailsMsgValue {

0 commit comments

Comments
 (0)