parsec-node
Version:
https://parseclabs.readthedocs.io/en/latest/
22 lines (18 loc) • 531 B
JavaScript
/**
* Copyright (c) 2018-present, Parsec Labs (parseclabs.org)
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of this source tree.
*/
const { Type } = require('parsec-lib');
const { checkInsAndOuts } = require('./utils');
module.exports = (state, tx) => {
if (tx.type !== Type.TRANSFER) {
throw new Error('Transfer tx expected');
}
checkInsAndOuts(
tx,
state,
({ address }, i) => address === tx.inputs[i].signer
);
};