@radixdlt/tx-parser
Version:
Parsing of Radix Engine transactions and instructions
21 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidatorOwnerCopy = void 0;
const _types_1 = require("./_types");
const preparedStake_1 = require("./preparedStake");
const reAddress_1 = require("./reAddress");
const makeValidatorValidatorOwnerCopy = (bufferReader, lengthData) => (0, preparedStake_1.makeBaseValidatorSubstateFromBuffer)(_types_1.SubStateType.VALIDATOR_OWNER_COPY)(bufferReader).andThen((base) => reAddress_1.REAddress.fromBufferReader(bufferReader).map((owner) => {
const reserved = base.reserved;
const validator = base.validator;
return Object.assign(Object.assign({}, base), { owner, toBuffer: () => Buffer.concat([
lengthData,
base.toBuffer(),
owner.toBuffer(),
]), toString: () => `${(0, _types_1.stringifySubstateType)(_types_1.SubStateType.VALIDATOR_OWNER_COPY)} { reserved: ${reserved}, validator: 0x${validator.toString()}, owner: 0x${owner
.toBuffer()
.toString('hex')} }` });
}));
exports.ValidatorOwnerCopy = {
fromBufferReader: (bufferReader, lengthData) => makeValidatorValidatorOwnerCopy(bufferReader, lengthData),
};
//# sourceMappingURL=validatorOwnerCopy.js.map