Skip to content

Commit

Permalink
processed changes from comments, except from stuff in walletscreen as…
Browse files Browse the repository at this point in the history
… it is not supported yet
  • Loading branch information
DennisHouterman committed May 16, 2019
1 parent 3824d9f commit cbbc6d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ Alternatively, you can use an offline mock, which replicates the NLX environment
1. Run `docker-compose -f docker-compose-travis.yml up`

# Running validator
The validator app is made with [Expo](https://expo.io/), which is a free and open-source react-native framework for mobile development. to run this on a mobile device, connect to the same network without firewall restrictions (if all else fails, starting an hotspot on your mobile device and connecting to it usually works). In the folder "validator-frontend", issue the command:
The validator app is made with [Expo](https://expo.io/), which is a free and open-source react-native framework for mobile development. to run this on a mobile device, the expo-cli tool is required. to install this, run:
```bash
$npm install -g expo-cli
```
connect to the same network without firewall restrictions (if all else fails, starting an hotspot on your mobile device and connecting to it usually works). In the folder "validator-frontend", issue the command:
```bash
$expo start
```
Expand Down
27 changes: 9 additions & 18 deletions validator-frontend/screens/ScanScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class ScanScreen extends React.Component {
this.setState({ hasCameraPermission: status === 'granted' });
}

_storeData = async (data) => {
try {
await AsyncStorage.setItem("BRP1", data);
} catch (error) {
console.log(error.message)
}
}

render() {
const { hasCameraPermission } = this.state;

Expand All @@ -52,8 +44,6 @@ class ScanScreen extends React.Component {
}

handleBarCodeScanned = ({ type, data }) => {
this._storeData(data)
console.log(data);
this.props.navigation.navigate('Validating', {qrString: data})
}
}
Expand All @@ -66,6 +56,13 @@ class ValidatingScreen extends Component {
static navigationOptions = {
headerTitle: 'Validating screen',
};
_storeData = async (data) => {
try {
await AsyncStorage.setItem("BRP1", data);
} catch (error) {
console.log(error.message)
}
}
async _checkQR() {
const { navigation } = this.props;
const qrString = await navigation.getParam('qrString', 'String not found');
Expand Down Expand Up @@ -104,16 +101,9 @@ class ValidatingScreen extends Component {
' eyB5 ' +
' -----END CERTIFICATE----- ' +
' ' ;
let documentJson = JSON.parse(qrString);
let claimWithLink = Object.values(documentJson)[0][0];
let claimData = Object.values(claimWithLink)[0];
let tempdata = claimData[0];
let moredata = Object.values(tempdata)[0];
console.log(moredata);
paperWallet.getCore().registerConnector('ephemeral', new EphemeralConnector())
let attestorSsid = await (await paperWallet.getCore().getConnector('ephemeral')).newIdentity({'cert': cert})
let validatorSsid = await paperWallet.getCore().newSsid('ephemeral')
this.result = await paperWallet.validate(attestorSsid.did, qrString, validatorSsid.did)
this.result = await paperWallet.validate(attestorSsid.did, qrString)
console.log(this.result)
}

Expand All @@ -125,6 +115,7 @@ class ValidatingScreen extends Component {
}
else if(this.result == true){
this.setState({validatingState: "verified"})
this._storeData(this.qrString)
}
};

Expand Down

0 comments on commit cbbc6d3

Please sign in to comment.