All files / ethers.js/src.ts/transaction authorization.ts

50% Statements 7/14
100% Branches 0/0
0% Functions 0/1
50% Lines 7/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x 1x 1x 1x 1x 1x                
import { getAddress } from "../address/index.js";
import { Signature } from "../crypto/index.js";
import { getBigInt } from "../utils/index.js";
 
import type { Authorization, AuthorizationLike } from "./index.js";
 
export function authorizationify(auth: AuthorizationLike): Authorization {
    return {
        address: getAddress(auth.address),
        nonce: getBigInt((auth.nonce != null) ? auth.nonce: 0),
        chainId: getBigInt((auth.chainId != null)? auth.chainId: 0),
        signature: Signature.from(auth.signature)
    };
}