Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jun 1, 2024
1 parent 625a274 commit 4aad5da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/controllers/multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default class MultisigController {
const tx = result.json
const lockHash = scriptToHash(addressToScript(fullPayload))

if (tx.transaction && tx?.multisig_configs) {
if (tx.transaction) {
tx.transaction = parseMultisigTxJsonFromCkbCli(tx)
}

Expand Down
5 changes: 3 additions & 2 deletions packages/neuron-wallet/src/models/chain/cell-dep.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import OutPoint from './out-point'
import { snakeToCamel } from '../../utils/deep-camelize-keys'

export enum DepType {
Code = 'code',
Expand All @@ -14,8 +15,8 @@ export default class CellDep {
this.depType = depType
}

public static fromObject({ outPoint, depType }: { outPoint: OutPoint; depType: DepType | 'dep_group' }): CellDep {
const _depType = depType == 'dep_group' ? DepType.DepGroup : depType
public static fromObject({ outPoint, depType }: { outPoint: OutPoint; depType: DepType }): CellDep {
const _depType = snakeToCamel(depType) as DepType
return new CellDep(OutPoint.fromObject(outPoint), _depType)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/src/utils/deep-camelize-keys.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function snakeToCamel(key: string) {
export function snakeToCamel(key: string) {
let keyArr = key.split('_')
for (let i = 0; i < keyArr.length; i++) {
if (i !== 0) {
Expand All @@ -24,4 +24,4 @@ export function deepCamelizeKeys(param: Json): Json {
return param
}

export default { deepCamelizeKeys }
export default { deepCamelizeKeys, snakeToCamel }

1 comment on commit 4aad5da

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Packaging for test is done in 9328028724

Please sign in to comment.