11import * as assert from 'assert' ;
22
3- import { extractMsgBufferFromPayGoAttestationProof } from '../../src/paygo' ;
3+ import { parsePayGoAttestation } from '../../src/paygo' ;
44import { generatePayGoAttestationProof } from '../../src/testutil' ;
55
66const addressFromPubKeyBase58 = 'bitgoAddressToExtract' ;
@@ -12,7 +12,7 @@ describe('extractAddressBufferFromPayGoAttestationProof', () => {
1212 '00000000-0000-0000-0000-000000000000' ,
1313 bufferAddressPubKeyB58
1414 ) ;
15- const { entropy, address, uuid } = extractMsgBufferFromPayGoAttestationProof ( paygoAttestationProof ) ;
15+ const { entropy, address, uuid } = parsePayGoAttestation ( paygoAttestationProof ) ;
1616 assert . deepStrictEqual ( Buffer . compare ( address , bufferAddressPubKeyB58 ) , 0 ) ;
1717 assert . deepStrictEqual ( uuid . toString ( ) , '00000000-0000-0000-0000-000000000000' ) ;
1818 assert . deepStrictEqual ( entropy . length , 64 ) ;
@@ -23,7 +23,7 @@ describe('extractAddressBufferFromPayGoAttestationProof', () => {
2323 '12345678-1234-4567-6890-231928472123' ,
2424 bufferAddressPubKeyB58
2525 ) ;
26- const { entropy, address, uuid } = extractMsgBufferFromPayGoAttestationProof ( paygoAttestationProof ) ;
26+ const { entropy, address, uuid } = parsePayGoAttestation ( paygoAttestationProof ) ;
2727 assert . deepStrictEqual ( Buffer . compare ( address , bufferAddressPubKeyB58 ) , 0 ) ;
2828 assert . deepStrictEqual ( uuid . toString ( ) , '12345678-1234-4567-6890-231928472123' ) ;
2929 assert . deepStrictEqual ( entropy . length , 64 ) ;
@@ -34,13 +34,13 @@ describe('extractAddressBufferFromPayGoAttestationProof', () => {
3434 '000000000000000-000000-0000000-000000-0000000000000000' ,
3535 bufferAddressPubKeyB58
3636 ) ;
37- const { address } = extractMsgBufferFromPayGoAttestationProof ( paygoAttestationProof ) ;
37+ const { address } = parsePayGoAttestation ( paygoAttestationProof ) ;
3838 assert . notDeepStrictEqual ( Buffer . compare ( address , bufferAddressPubKeyB58 ) , 0 ) ;
3939 } ) ;
4040
4141 it ( 'should throw an error if the paygo attestation proof is too short' , ( ) => {
4242 assert . throws (
43- ( ) => extractMsgBufferFromPayGoAttestationProof ( Buffer . from ( 'shortproof-shrug' ) ) ,
43+ ( ) => parsePayGoAttestation ( Buffer . from ( 'shortproof-shrug' ) ) ,
4444 'PayGo attestation proof is too short to contain a valid address.'
4545 ) ;
4646 } ) ;
0 commit comments