Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Jul 13, 2023
1 parent ab5e3ff commit 18f1a1e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ function onboardingFixture() {
rpcUrl: 'http://localhost:8545',
ticker: 'ETH',
networkConfigurationId: 'networkConfigurationId',
type: 'rpc',
},
},
},
Expand Down Expand Up @@ -514,6 +515,9 @@ class FixtureBuilder {

withNetworkController(data) {
merge(this.fixture.data.NetworkController, data);

console.log("network controller is: ", this.fixture.data.NetworkController);

return this;
}

Expand Down
8 changes: 5 additions & 3 deletions test/e2e/tests/custom-rpc-history.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,25 +190,27 @@ describe('Stores custom RPC history', function () {
);
});

it('finds all recent RPCs in history', async function () {
it.only('finds all recent RPCs in history', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withNetworkController({
networkConfigurations: {
networkConfigurationId: {
rpcUrl: 'http://127.0.0.1:8545/',
rpcUrl: 'http://127.0.0.1:8545/1',
chainId: '0x539',
ticker: 'ETH',
nickname: 'http://127.0.0.1:8545/1',
rpcPrefs: {},
type: 'rpc',
},
networkConfigurationId2: {
rpcUrl: 'http://127.0.0.1:8545/2',
chainId: '0x539',
ticker: 'ETH',
nickname: 'http://127.0.0.1:8545/2',
rpcPrefs: {},
type: 'rpc',
},
},
})
Expand Down Expand Up @@ -249,7 +251,7 @@ describe('Stores custom RPC history', function () {
.withNetworkController({
networkConfigurations: {
networkConfigurationId: {
rpcUrl: 'http://127.0.0.1:8545/',
rpcUrl: 'http://127.0.0.1:8545/1',
chainId: '0x539',
ticker: 'ETH',
nickname: 'http://127.0.0.1:8545/1',
Expand Down
4 changes: 4 additions & 0 deletions ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,10 @@ export function getCurrentNetwork(state) {
? (network) => network.id === providerConfig.id
: (network) => network.id === providerConfig.type;

console.log('providerConfig: ', providerConfig);
console.log('allNetworks: ', allNetworks);
console.log('allNetworks.find(filter): ', allNetworks.find(filter));

return allNetworks.find(filter);
}

Expand Down

0 comments on commit 18f1a1e

Please sign in to comment.