Skip to content

Commit

Permalink
fix TxManager.sendTx
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Dec 25, 2014
1 parent ecf7122 commit cc7f85d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cc-wallet-core",
"version": "0.3.0",
"version": "0.3.1",
"description": "",
"main": "./src/index.js",
"keywords": [],
Expand Down
69 changes: 35 additions & 34 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,40 @@ var createError = errors.createError || require('errno').create


/**
* ColoredCoinError
* +-- AlreadyExistsError
* +-- CoinColorValueError
* +-- IncompatibilityError
* | +-- ColoredFeeEstimatorError
* | +-- NetworkNotSupportVerificationMethodsError
* +-- InsufficientFundsError
* +-- MultiAssetTransactionNotSupportedError
* +-- MultiColorNotSupportedError
* +-- NetworkError
* | +-- NetworkChainError
* | +-- NetworkElectrumError
* | +-- NetworkGetTxError
* | +-- NetworkSendTxError
* +-- NotFoundError
* | +-- AssetNotFoundError
* | +-- ComposerFunctionNotFoundError
* | +-- HeaderNotFoundError
* | +-- TxNotFoundError
* +-- VerifiedBlockchainError
* | +-- VerifyChunkError
* | +-- VerifyHeaderError
* | +-- VerifyTxError
* +-- ToposortError
* +-- TxTransformError
* | +-- TxKindIsNotRecognizedError
* | +-- TargetKindIsNotReachableError
* +-- VerifyTypeError
* | +-- VerifyColorDefinitionTypeError
* | +-- VerifyPowerError
* | +-- VerifySeedHexError
* +-- WalletAlreadyInitializedError
* +-- WalletNotInitializedError
* Error
* +-- ColoredCoinError
* +-- AlreadyExistsError
* +-- CoinColorValueError
* +-- IncompatibilityError
* | +-- ColoredFeeEstimatorError
* | +-- NetworkNotSupportVerificationMethodsError
* +-- InsufficientFundsError
* +-- MultiAssetTransactionNotSupportedError
* +-- MultiColorNotSupportedError
* +-- NetworkError
* | +-- NetworkChainError
* | +-- NetworkElectrumError
* | +-- NetworkGetTxError
* | +-- NetworkSendTxError
* +-- NotFoundError
* | +-- AssetNotFoundError
* | +-- ComposerFunctionNotFoundError
* | +-- HeaderNotFoundError
* | +-- TxNotFoundError
* +-- VerifiedBlockchainError
* | +-- VerifyChunkError
* | +-- VerifyHeaderError
* | +-- VerifyTxError
* +-- ToposortError
* +-- TxTransformError
* | +-- TxKindIsNotRecognizedError
* | +-- TargetKindIsNotReachableError
* +-- VerifyTypeError
* | +-- VerifyColorDefinitionTypeError
* | +-- VerifyPowerError
* | +-- VerifySeedHexError
* +-- WalletAlreadyInitializedError
* +-- WalletNotInitializedError
*/

/**
Expand Down Expand Up @@ -271,5 +272,5 @@ module.exports = _.extend(errors, {
VerifyPowerError: VerifyPowerError,
VerifySeedHexError: VerifySeedHexError,
WalletAlreadyInitializedError: WalletAlreadyInitializedError,
WalletNotInitializedError: WalletNotInitializedError,
WalletNotInitializedError: WalletNotInitializedError
})
1 change: 1 addition & 0 deletions src/tx/TxManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ TxManager.prototype.sendTx = function (tx) {
status: txStatus.dispatch,
height: 0,
timestamp: getCurrentTimestamp(),
isBlockTimestamp: false,
tAddresses: [],
rAddresses: []
}
Expand Down
4 changes: 2 additions & 2 deletions test/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ describe('Wallet', function () {
var deferred = Q.defer()
deferred.promise.done(done, done)

var seed = '421fc385fdae762b246b80e0212f77bb'
var seed = '421fc385fdae724b246b80e0212f77bb'
wallet.initialize(seed)
wallet.addAssetDefinition(seed, goldAsset)
wallet.subscribeAndSyncAllAddresses(function (error) {
expect(error).to.be.null

var bitcoin = wallet.getAssetDefinitionByMoniker('bitcoin')
var targets = [{address: 'miFxiMoU4AmybucyCM5sXB8mPUVpEtP5E1', value: 10000}]
var targets = [{address: 'mkwmtrHX99ozTegy77wTgPZwodm4E2VbBr', value: 10000}]

wallet.createTx(bitcoin, targets, function (error, tx) {
expect(error).to.be.null
Expand Down

0 comments on commit cc7f85d

Please sign in to comment.