Skip to content

Commit

Permalink
feat: handle hash_type:data2 (#3264)
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan authored Nov 13, 2024
1 parent 9a82bc4 commit 9746c68
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface SpecialAssetCell {
lock: {
args: string
codeHash: string
hashType: 'type' | 'data'
hashType: 'type' | 'data' | 'data1' | 'data2'
}
lockHash: string
multiSignBlake160: string
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/types/Controller/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ declare namespace Controller {
interface Response {
cellDep: any
codeHash: string
hashType: 'data' | 'type'
hashType: 'data' | 'type' | 'data1' | 'data2'
}
}
interface SUDTAccount {
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-wallet/src/models/asset-account-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ function toScriptInfo(sporeConfig: SporeScript): ScriptCellInfo {
if (sporeScriptHashType === 'type') return ScriptHashType.Type
if (sporeScriptHashType === 'data') return ScriptHashType.Data
if (sporeScriptHashType === 'data1') return ScriptHashType.Data1
if (sporeScriptHashType === 'data2') return ScriptHashType.Data2

throw new Error(`Invalid hash type: ${sporeScriptHashType}`)
})()
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-wallet/src/models/chain/live-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const LUMOS_HASH_TYPE_MAP: Record<string, ScriptHashType> = {
type: ScriptHashType.Type,
data1: ScriptHashType.Data1,
data: ScriptHashType.Data,
data2: ScriptHashType.Data2,
}

export type CellWithOutPoint = Cell & { outPoint: IOutPoint }
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-wallet/src/models/chain/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum ScriptHashType {
Data = 'data',
Type = 'type',
Data1 = 'data1',
Data2 = 'data2',
}

export default class Script {
Expand Down

1 comment on commit 9746c68

@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 11809141742

Please sign in to comment.