把大多数ticc方法的参数类型统一为 { ... } 对象
This commit is contained in:
		
							parent
							
								
									94152ec736
								
							
						
					
					
						commit
						bbba2589d5
					
				
							
								
								
									
										3
									
								
								btc.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								btc.js
									
									
									
									
									
								
							@ -10,7 +10,8 @@ const BTC_TXFEE = 30
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class BTC {
 | 
					class BTC {
 | 
				
			||||||
  constructor (privateKey) {
 | 
					  constructor (privateKey) {
 | 
				
			||||||
    if (!ticc.is_seckey(privateKey)) throw new Error('Invalid PrivateKey')
 | 
					    if (!ticc.is_seckey({ seckey: privateKey }))
 | 
				
			||||||
 | 
					      throw new Error('Invalid PrivateKey')
 | 
				
			||||||
    var publicKey = ticc.seckey_to_pubkey(privateKey)
 | 
					    var publicKey = ticc.seckey_to_pubkey(privateKey)
 | 
				
			||||||
    Object.defineProperties(this, {
 | 
					    Object.defineProperties(this, {
 | 
				
			||||||
      privateKey: {
 | 
					      privateKey: {
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tic.js
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tic.js
									
									
									
									
									
								
							@ -8,7 +8,7 @@ const TIC_NODE = require('./netConfig').TIC_NODE
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class TIC {
 | 
					class TIC {
 | 
				
			||||||
  constructor (seckey, option = {}) {
 | 
					  constructor (seckey, option = {}) {
 | 
				
			||||||
    if (!seckey || !ticc.is_seckey(seckey)) throw 'ERROR:Invalid Seckey'
 | 
					    if (!seckey || !ticc.is_seckey({ seckey })) throw 'ERROR:Invalid Seckey'
 | 
				
			||||||
    Object.defineProperties(this, {
 | 
					    Object.defineProperties(this, {
 | 
				
			||||||
      seckey: {
 | 
					      seckey: {
 | 
				
			||||||
        value: seckey,
 | 
					        value: seckey,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user