UNPKG

scryinfo

Version:

A real data storage library on ethereum

29 lines (25 loc) 668 B
/** en: The normalized struct data for callback in scry system. zh: scry系统中统一返回的回调参数数据结构. @author Danny Yan @date 2017-07 */ var ScryStatus = { code: { OK: 0, ERROR: 1, TRANSCOMMITED: 100 } } ScryStatus.returnOK = function(data, msg) { return { st: ScryStatus.code.OK, data:data, msg: msg }; } ScryStatus.returnError = function(msg, error) { return { st: ScryStatus.code.ERROR, msg: msg, error: error }; } ScryStatus.return = function(code, data, msg, error) { return { st: code, data:data, msg: msg, error: error }; } module.exports = ScryStatus;