fix function signature for trimHistory RPC

This commit is contained in:
ansuz
2020-02-05 11:53:47 -05:00
parent 49b082c032
commit 5808c534b5
2 changed files with 10 additions and 6 deletions

View File

@@ -93,7 +93,15 @@ Channel.removeOwnedChannel = function (Env, safeKey, channelId, cb) {
});
};
Channel.removeOwnedChannelHistory = function (Env, channelId, unsafeKey, hash, cb) { // XXX UNSAFE
Channel.trimHistory = function (Env, safeKey, data, cb) {
if (!(data && typeof(data.channel) === 'string' && typeof(data.hash) === 'string' && data.hash.length === 64)) {
return void cb('INVALID_ARGS');
}
var channelId = data.channel;
var unsafeKey = Util.unescapeKeyCharacters(safeKey);
var hash = data.hash;
nThen(function (w) {
Metadata.getMetadata(Env, channelId, w(function (err, metadata) {
if (err) { return void cb(err); }