Skip to content

Commit

Permalink
fix(namada-tx): comma
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Jun 6, 2024
1 parent c1fb669 commit 04d79c8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 23 deletions.
5 changes: 3 additions & 2 deletions packages/namada/namada-pos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@ class NamadaValidator extends Staking.Validator {
connection.log.warn("consensus address when fetching all validators: not implemented")
}

const prefix = `validator ${this.namadaAddress} details: ${requests.length} request(s)`
if (options?.parallel) {
connection.log.debug(`fetchDetails: ${requests.length} request(s) in parallel`)
connection.log.debug(prefix, `in parallel`)
} else {
connection.log.debug(`fetchDetails: ${requests.length} request(s) in sequence`)
connection.log.debug(prefix, `in sequence`)
}
await optionallyParallel(options?.parallel, requests)

Expand Down
61 changes: 40 additions & 21 deletions packages/namada/namada-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class NamadaBlock extends Block {

static async fetchByHeight (
connection: { url: string|URL, decode?: typeof Decode, chain?: Namada },
height: number|string|bigint,
raw?: boolean
height: number|string|bigint,
raw?: boolean,
): Promise<NamadaBlock> {

const { url, decode = Decode, chain } = connection ?? {}
Expand Down Expand Up @@ -120,34 +120,54 @@ class NamadaBlock extends Block {

class NamadaTransaction {

id!: string
height?: number
chainId!: string
expiration!: string|null
timestamp!: string
codeHash!: string
dataHash!: string
memoHash!: string
txType!: 'Raw'|'Wrapper'|'Decrypted'|'Protocol'
sections!: Section[]
content?: object

constructor (properties: Partial<NamadaTransaction> = {}) {
console.log(properties)
assign(this, properties, [
'id',
'height',
'chainId',
'expiration',
'timestamp',
'codeHash',
'dataHash',
'memoHash',
'txType',
'sections',
'content'
'content',
'batch',
])
}

id!: string

height?: number

chainId!: string

expiration!: string|null

timestamp!: string

feeToken?: string

feeAmountPerGasUnit?: string

multiplier?: BigInt

gasLimitMultiplier?: BigInt

atomic!: boolean

txType!: 'Raw'|'Wrapper'|'Decrypted'|'Protocol'

sections!: Section[]

content?: object

batch!: Array<{
hash: string,
codeHash: string,
dataHash: string,
memoHash: string
}>

static fromDecoded ({ id, sections, type, ...header }: {
id: string,
type: 'Raw'|'Wrapper'|'Decrypted'|'Protocol',
Expand Down Expand Up @@ -275,12 +295,11 @@ class NamadaProtocolTransaction extends NamadaTransaction {
//['ValSetUpdateVext', unit],
//)],
//]

}

export {
NamadaBlock as Block,
NamadaTransaction as Transaction
NamadaBlock as Block,
NamadaTransaction as Transaction,
}

export const Transactions = {
Expand Down

0 comments on commit 04d79c8

Please sign in to comment.