Created
January 24, 2018 12:36
-
-
Save adsc-cloudtec/11fe6b28e7f13c0526d43f73af120ed6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: Use token model | |
let token = {}; | |
token.hash = tx.hash; | |
let valid = true; | |
tx.outputs.forEach(function(output) { | |
// Try to understand output as appId | |
token.appIds = []; | |
template.appIds.forEach(function(appId) { | |
if (appId.address === output.addresses[0]) { | |
console.log('found appId address: ' + appId.address); | |
if (output.value !== minAmount) { | |
console.log('invalid appId amount'); | |
valid = false; | |
return; | |
} | |
token.appIds.push(appId); | |
} | |
}); | |
}, this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment