Adjust inspect for ExtrinsicPayload (#4862)
* Adjust inspect for ExtrinsicPayload * Adjust
This commit is contained in:
@@ -54,13 +54,15 @@ export class Bytes extends Raw {
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
override inspect (isBare?: boolean): Inspect {
|
||||
const clength = compactToU8a(this.length);
|
||||
|
||||
return {
|
||||
outer: this.length
|
||||
? [clength, super.toU8a()]
|
||||
: [clength]
|
||||
outer: isBare
|
||||
? [super.toU8a()]
|
||||
: this.length
|
||||
? [clength, super.toU8a()]
|
||||
: [clength]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -231,12 +231,16 @@ export class Struct<
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
inspect (isBare?: BareOpts): Inspect {
|
||||
const inner = new Array<Inspect>();
|
||||
|
||||
for (const [k, v] of this.entries()) {
|
||||
inner.push({
|
||||
...v.inspect(),
|
||||
...v.inspect(
|
||||
!isBare || isBoolean(isBare)
|
||||
? isBare
|
||||
: isBare[k]
|
||||
),
|
||||
name: stringCamelCase(k as string)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export interface Codec {
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect;
|
||||
inspect (isBare?: BareOpts): Inspect;
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
||||
|
||||
Reference in New Issue
Block a user