File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 33 */
44import { BigNumber } from 'bignumber.js' ;
55import { bip32 , BIP32Interface } from '@bitgo/secp256k1' ;
6+ import { coins , EosCoin } from '@bitgo/statics' ;
67import { createHash , randomBytes } from 'crypto' ;
78import { Api , ApiInterfaces , JsonRpc , RpcInterfaces } from 'eosjs' ;
89import * as ecc from 'eosjs-ecc' ;
@@ -1123,7 +1124,7 @@ export class Eos extends BaseCoin {
11231124 }
11241125
11251126 if ( txPrebuild . coin === 'eos' || txPrebuild . coin === 'teos' ) {
1126- const expectedSymbol = _ . isNil ( txPrebuild . token ) ? 'EOS' : txPrebuild . token . split ( ':' ) [ 1 ] ;
1127+ const expectedSymbol = _ . isNil ( txPrebuild . token ) ? 'EOS' : ( coins . get ( txPrebuild . token ) as EosCoin ) . symbol ;
11271128
11281129 if ( actualAmountAndCoin [ 1 ] !== expectedSymbol ) {
11291130 throw new Error ( 'txHex receive symbol does not match expected recipient symbol' ) ;
Original file line number Diff line number Diff line change @@ -166,5 +166,36 @@ describe('EOS Token:', function () {
166166 . verifyTransaction ( { txParams, txPrebuild, wallet, verification } )
167167 . should . be . rejectedWith ( 'txHex receive symbol does not match expected recipient symbol' ) ;
168168 } ) ;
169+
170+ it ( 'should be able to verify vaulta transaction' , async function ( ) {
171+ const vaultaCoin = bitgo . coin ( 'teos:VAULTA' ) ;
172+ const txParams = {
173+ recipients : [
174+ {
175+ address : 'lionteste212' ,
176+ amount : '1000' ,
177+ } ,
178+ ] ,
179+ } ;
180+ const txPrebuild = {
181+ txHex :
182+ '5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191ee694868c24f71ef56f10000000100408c7a02ea3055000000000085269d000302323801004c8eda6ca02e45000000572d3ccdcd0170e5e73f5643715600000000a8ed32322170e5e73f5643715620825019ab3ca98be803000000000000044100000000000000000000000000000000000000000000000000000000000000000000000000000000' ,
183+ transaction : {
184+ packed_trx :
185+ 'ee694868c24f71ef56f10000000100408c7a02ea3055000000000085269d000302323801004c8eda6ca02e45000000572d3ccdcd0170e5e73f5643715600000000a8ed32322170e5e73f5643715620825019ab3ca98be80300000000000004410000000000000000' ,
186+ signatures : [ ] ,
187+ compression : 'none' ,
188+ } ,
189+ token : 'teos:VAULTA' ,
190+ coin : 'teos' ,
191+ } ;
192+ const validTransaction = await vaultaCoin . verifyTransaction ( {
193+ txParams,
194+ txPrebuild,
195+ wallet,
196+ verification,
197+ } ) ;
198+ validTransaction . should . equal ( true ) ;
199+ } ) ;
169200 } ) ;
170201} ) ;
You can’t perform that action at this time.
0 commit comments