Skip to content

Commit b68c7fb

Browse files
authored
Merge pull request #219 from BitGo/BTC-3062/require-material-in-fromhex
fix: make material required in DotTransaction.fromHex/fromBytes
2 parents 8a654e6 + 9290793 commit b68c7fb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/wasm-dot/js/transaction.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class DotTransaction {
2727
* @param material - Chain material from the fullnode. See {@link fromHex}
2828
* for why material is needed at deserialization time.
2929
*/
30-
static fromBytes(bytes: Uint8Array, material?: Material): DotTransaction {
31-
const ctx = material ? createContext(material) : undefined;
30+
static fromBytes(bytes: Uint8Array, material: Material): DotTransaction {
31+
const ctx = createContext(material);
3232
const inner = new WasmTransaction(bytes, ctx);
3333
return new DotTransaction(inner);
3434
}
@@ -71,8 +71,8 @@ export class DotTransaction {
7171
* @param material - Chain material from the fullnode (genesisHash,
7272
* chainName, specName, specVersion, txVersion, metadata)
7373
*/
74-
static fromHex(hex: string, material?: Material): DotTransaction {
75-
const ctx = material ? createContext(material) : undefined;
74+
static fromHex(hex: string, material: Material): DotTransaction {
75+
const ctx = createContext(material);
7676
const inner = WasmTransaction.fromHex(hex, ctx);
7777
return new DotTransaction(inner);
7878
}

0 commit comments

Comments
 (0)