diff --git a/packages/namada/namada-pos.ts b/packages/namada/namada-pos.ts index 10098faecf..8b23497153 100644 --- a/packages/namada/namada-pos.ts +++ b/packages/namada/namada-pos.ts @@ -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) diff --git a/packages/namada/namada-tx.ts b/packages/namada/namada-tx.ts index a0e3c5d426..fac8f362ec 100644 --- a/packages/namada/namada-tx.ts +++ b/packages/namada/namada-tx.ts @@ -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 { const { url, decode = Decode, chain } = connection ?? {} @@ -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 = {}) { + 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', @@ -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 = {