重命名 ActTransfer 为 ActionTransfer,贯彻“全称命名”的规范,以尽可能消灭所有可能的歧义。
This commit is contained in:
		
							parent
							
								
									f647747b0b
								
							
						
					
					
						commit
						ac2a97346e
					
				
							
								
								
									
										6
									
								
								tic.js
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								tic.js
									
									
									
									
									
								
							@ -1,7 +1,7 @@
 | 
				
			|||||||
'use strict'
 | 
					'use strict'
 | 
				
			||||||
const axios = require('axios')
 | 
					const axios = require('axios')
 | 
				
			||||||
const Ticrypto = require('tic.crypto')
 | 
					const Ticrypto = require('tic.crypto')
 | 
				
			||||||
const ticActTransfer = require('tic.action').ActTransfer
 | 
					const ticActionTransfer = require('tic.action').ActionTransfer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TIC_TXFEE = 10;
 | 
					const TIC_TXFEE = 10;
 | 
				
			||||||
const TIC_NODE = require('./netConfig').TIC_NODE
 | 
					const TIC_NODE = require('./netConfig').TIC_NODE
 | 
				
			||||||
@ -78,7 +78,7 @@ class TIC {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    async sendTransaction(toAddress, amount, option = {gasFee : TIC_TXFEE}){
 | 
					    async sendTransaction(toAddress, amount, option = {gasFee : TIC_TXFEE}){
 | 
				
			||||||
        if(!toAddress||!amount){throw new Error("ERROR:RequiredParamsMissing")}  //amount cannot be zero
 | 
					        if(!toAddress||!amount){throw new Error("ERROR:RequiredParamsMissing")}  //amount cannot be zero
 | 
				
			||||||
        let action = new ticActTransfer({
 | 
					        let action = new ticActionTransfer({
 | 
				
			||||||
            amount: parseInt(amount), 
 | 
					            amount: parseInt(amount), 
 | 
				
			||||||
            toAddress: toAddress,
 | 
					            toAddress: toAddress,
 | 
				
			||||||
            fee: option.gasFee
 | 
					            fee: option.gasFee
 | 
				
			||||||
@ -108,7 +108,7 @@ class TIC {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    getSerializedTx(option){
 | 
					    getSerializedTx(option){
 | 
				
			||||||
        if(!option.toAddress||!option.amount){throw new Error("ERROR:RequiredParamsMissing")}
 | 
					        if(!option.toAddress||!option.amount){throw new Error("ERROR:RequiredParamsMissing")}
 | 
				
			||||||
        let action=new ticActTransfer({
 | 
					        let action=new ticActionTransfer({
 | 
				
			||||||
            amount: parseInt(option.amount), 
 | 
					            amount: parseInt(option.amount), 
 | 
				
			||||||
            toAddress: option.toAddress,
 | 
					            toAddress: option.toAddress,
 | 
				
			||||||
            fee:option.fee||this._defaultFee
 | 
					            fee:option.fee||this._defaultFee
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user