Merge branch 'master' into mining_e2e_tests_v2
This commit is contained in:
		
						commit
						69e8d49f07
					
				
							
								
								
									
										13
									
								
								backend/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										13
									
								
								backend/package-lock.json
									
									
									
										generated
									
									
									
								
							@ -23,6 +23,7 @@
 | 
			
		||||
      },
 | 
			
		||||
      "devDependencies": {
 | 
			
		||||
        "@types/compression": "^1.7.2",
 | 
			
		||||
        "@types/crypto-js": "^4.1.1",
 | 
			
		||||
        "@types/express": "^4.17.13",
 | 
			
		||||
        "@types/ws": "~8.5.3",
 | 
			
		||||
        "@typescript-eslint/eslint-plugin": "^5.30.5",
 | 
			
		||||
@ -232,6 +233,12 @@
 | 
			
		||||
        "@types/node": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/crypto-js": {
 | 
			
		||||
      "version": "4.1.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.1.tgz",
 | 
			
		||||
      "integrity": "sha512-BG7fQKZ689HIoc5h+6D2Dgq1fABRa0RbBWKBd9SP/MVRVXROflpm5fhwyATX5duFmbStzyzyycPB8qUYKDH3NA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/express": {
 | 
			
		||||
      "version": "4.17.13",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
 | 
			
		||||
@ -3246,6 +3253,12 @@
 | 
			
		||||
        "@types/node": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@types/crypto-js": {
 | 
			
		||||
      "version": "4.1.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.1.tgz",
 | 
			
		||||
      "integrity": "sha512-BG7fQKZ689HIoc5h+6D2Dgq1fABRa0RbBWKBd9SP/MVRVXROflpm5fhwyATX5duFmbStzyzyycPB8qUYKDH3NA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@types/express": {
 | 
			
		||||
      "version": "4.17.13",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
 | 
			
		||||
 | 
			
		||||
@ -43,6 +43,7 @@
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/compression": "^1.7.2",
 | 
			
		||||
    "@types/crypto-js": "^4.1.1",
 | 
			
		||||
    "@types/express": "^4.17.13",
 | 
			
		||||
    "@types/ws": "~8.5.3",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^5.30.5",
 | 
			
		||||
 | 
			
		||||
@ -5,8 +5,7 @@ import { IEsploraApi } from './esplora-api.interface';
 | 
			
		||||
import { IElectrumApi } from './electrum-api.interface';
 | 
			
		||||
import BitcoinApi from './bitcoin-api';
 | 
			
		||||
import logger from '../../logger';
 | 
			
		||||
import * as sha256 from 'crypto-js/sha256';
 | 
			
		||||
import * as hexEnc from 'crypto-js/enc-hex';
 | 
			
		||||
import crypto from "crypto-js";
 | 
			
		||||
import loadingIndicators from '../loading-indicators';
 | 
			
		||||
import memoryCache from '../memory-cache';
 | 
			
		||||
 | 
			
		||||
@ -144,8 +143,8 @@ class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private encodeScriptHash(scriptPubKey: string): string {
 | 
			
		||||
    const addrScripthash = hexEnc.stringify(sha256(hexEnc.parse(scriptPubKey)));
 | 
			
		||||
    return addrScripthash.match(/.{2}/g).reverse().join('');
 | 
			
		||||
    const addrScripthash = crypto.enc.Hex.stringify(crypto.SHA256(crypto.enc.Hex.parse(scriptPubKey)));
 | 
			
		||||
    return addrScripthash!.match(/.{2}/g)!.reverse().join('');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user