11import { TestBitGo , TestBitGoAPI } from '@bitgo/sdk-test' ;
22import { BitGoAPI } from '@bitgo/sdk-api' ;
33import { Celo , Tcelo } from '../../src' ;
4+ import { Wallet } from '@bitgo/sdk-core' ;
45
56describe ( 'Celo Gold' , function ( ) {
67 let bitgo : TestBitGoAPI ;
8+ let basecoin ;
79
810 before ( function ( ) {
911 bitgo = TestBitGo . decorate ( BitGoAPI , { env : 'mock' } ) ;
1012 bitgo . safeRegister ( 'tcelo' , Tcelo . createInstance ) ;
1113 bitgo . safeRegister ( 'celo' , Celo . createInstance ) ;
1214 bitgo . initializeTestVars ( ) ;
15+ basecoin = bitgo . coin ( 'celo' ) ;
1316 } ) ;
1417
1518 it ( 'should instantiate the coin' , function ( ) {
@@ -19,4 +22,25 @@ describe('Celo Gold', function () {
1922 localBasecoin = bitgo . coin ( 'celo' ) ;
2023 localBasecoin . should . be . an . instanceof ( Celo ) ;
2124 } ) ;
25+
26+ describe ( 'Verify Transaction' , function ( ) {
27+ const address1 = '5Ge59qRnZa8bxyhVFE6BDoY3kuhSrNVETRxXYLty1Hh6XTaf' ;
28+ const address2 = '5DiMLZugmcKEH3igPZP367FqummZkWeW5Z6zDCHLfxRjnPXe' ;
29+ it ( 'should reject a txPrebuild with more than one recipient' , async function ( ) {
30+ const wallet = new Wallet ( bitgo , basecoin , { } ) ;
31+
32+ const txParams = {
33+ recipients : [
34+ { amount : '1000000000000' , address : address1 } ,
35+ { amount : '2500000000000' , address : address2 } ,
36+ ] ,
37+ wallet : wallet ,
38+ walletPassphrase : 'fakeWalletPassphrase' ,
39+ } ;
40+
41+ await basecoin
42+ . verifyTransaction ( { txParams } )
43+ . should . be . rejectedWith ( 'txParams should only have 1 recipient but 2 found' ) ;
44+ } ) ;
45+ } ) ;
2246} ) ;
0 commit comments