Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getAccountMetaKey(accKey: string): string {
const accKeyHex = ByteBuffer.fromUTF8(accKey).toHex();
return _KEYS.accountMetaSubstore.concat(accKeyHex);
}
function getPostReportOrUpvoteKey(permlink, user) {
const userHex = ByteBuffer.fromUTF8(user).toHex();
return getPostReportOrUpvotePrefix(permlink).concat(userHex);
}
Keys.getPostReportOrUpvoteKey = getPostReportOrUpvoteKey;
export function getPostCommentPrefix(permlink: string): string {
const permlinkHex = ByteBuffer.fromUTF8(permlink).toHex();
return _KEYS.postCommentSubStore.concat(permlinkHex).concat(_KEYS.sep);
}
export function getLinoStakeStatKey(day: string): string {
const dayHex = ByteBuffer.fromUTF8(day).toHex();
return _KEYS.linoStakeStatSubStore.concat(dayHex);
}
export function getValidatorKey(accKey: string): string {
const accKeyHex = ByteBuffer.fromUTF8(accKey).toHex();
return _KEYS.validatorSubstore.concat(accKeyHex);
}
export function getDelegateeKey(me: string, myDelegatee: string): string {
const myDelegateeHex = ByteBuffer.fromUTF8(myDelegatee).toHex();
return getDelegateePrefix(me).concat(myDelegateeHex);
}
function getExpiredProposalKey(proposalID) {
const proposalIDHex = ByteBuffer.fromUTF8(proposalID).toHex();
return _KEYS.expiredProposalSubStore.concat(proposalIDHex);
}
Keys.getExpiredProposalKey = getExpiredProposalKey;
export function getPendingCoinDayQueueKey(me: string): string {
const meHex = ByteBuffer.fromUTF8(me).toHex();
return _KEYS.accountPendingCoinDayQueueSubstore.concat(meHex).concat(_KEYS.sep);
}
export function getPostInfoKey(permlink: string): string {
const permlinkHex = ByteBuffer.fromUTF8(permlink).toHex();
return _KEYS.postInfoSubStore.concat(permlinkHex);
}
let setValue = function(key: string, obj: Object) {
let value = new protos.cockroach.server.serverpb.GetUIDataResponse.Value();
value.setValue(ByteBuffer.fromUTF8(JSON.stringify(obj)));
response.key_values.set(key, value);
};
setValue(uiKey1, uiObj1);