-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.8.0: adds possability to configure providers to be used for blockc…
…hain calls
- Loading branch information
1 parent
249e991
commit f59304e
Showing
6 changed files
with
82 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import DePayWidgets from '../../../src' | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { provider } from 'depay-web3-client' | ||
|
||
describe('set RPC providers', () => { | ||
|
||
it('allows to set RPC providers to use', ()=> { | ||
cy.visit('cypress/test.html').then((contentWindow) => { | ||
cy.document().then((document)=>{ | ||
DePayWidgets.Payment({ document, | ||
|
||
providers: { | ||
ethereum: ['http://localhost:8545'], | ||
bsc: ['http://localhost:8545'] | ||
}, | ||
|
||
accept: [{ | ||
blockchain: 'ethereum', | ||
amount: 20, | ||
token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb', | ||
receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045' | ||
}] | ||
}) | ||
|
||
cy.wait(200).then(()=>{ | ||
expect(provider('ethereum').connection.url).to.equal('http://localhost:8545') | ||
expect(provider('bsc').connection.url).to.equal('http://localhost:8545') | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters