@swaptoshi/governance-module
Version:
Klayr governance on-chain module
59 lines • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.commandGovernanceContext = commandGovernanceContext;
exports.mutableTransactionHookGovernanceContext = mutableTransactionHookGovernanceContext;
exports.mutableBlockHookGovernanceContext = mutableBlockHookGovernanceContext;
exports.immutableTransactionHookGovernanceContext = immutableTransactionHookGovernanceContext;
exports.methodGovernanceContext = methodGovernanceContext;
exports.immutableMethodGovernanceContext = immutableMethodGovernanceContext;
exports.endpointGovernanceContext = endpointGovernanceContext;
function commandGovernanceContext(context) {
return {
context,
senderAddress: context.transaction.senderAddress,
height: context.header.height,
};
}
function mutableTransactionHookGovernanceContext(context) {
return {
context,
senderAddress: context.transaction.senderAddress,
height: context.header.height,
};
}
function mutableBlockHookGovernanceContext(context) {
return {
context,
senderAddress: Buffer.alloc(0),
height: context.header.height,
};
}
function immutableTransactionHookGovernanceContext(context) {
return {
context,
senderAddress: context.transaction.senderAddress,
height: context.header.height,
};
}
function methodGovernanceContext(context, senderAddress, height) {
return {
context,
senderAddress,
height,
};
}
function immutableMethodGovernanceContext(context, senderAddress, height) {
return {
context,
senderAddress,
height,
};
}
function endpointGovernanceContext(context) {
return {
context,
senderAddress: Buffer.alloc(0),
height: context.header.height,
};
}
//# sourceMappingURL=index.js.map