Commit 867420e8 authored by Viktor Velev's avatar Viktor Velev

Small

parent 3d122005
......@@ -14,7 +14,7 @@ function init(){
var inst;
var address = "0xefc770f5275dddfc41794e7fdbcab14834c2af42";
var address = "0x18159f1a276711d3e8114d4949c1731dbf816518";
var acc;
//temp fix:
......
......@@ -29,28 +29,37 @@ export default class BetPage extends Component {
}
}
parseEvent(propArray) {
//bigInt
let ts = propArray[0].toFixed()
//strings
let home = propArray[1]
let away = propArray[2]
let sport = propArray[3]
//bigInt
let rawBetTypes = propArray[4]
parseBetTypes(rawBetTypes) {
rawBetTypes = [ rawBetTypes[0].toFixed(), rawBetTypes[1].toFixed() ]
let betTypes = []
rawBetTypes.forEach((betType) => {
betTypes.push(this.betTypes[betType])
})
return betTypes
}
parseEvent(propArray) {
//bigInt
console.log(propArray)
let id = propArray[0].toFixed()
let ts = propArray[1].toFixed()
//strings
let home = propArray[2]
let away = propArray[3]
let sport = propArray[4]
//bigInt
let betTypes = this.parseBetTypes(propArray[5])
let closedBetTypes = this.parseBetTypes(propArray[6])
//bool
let active = propArray[5]
let active = propArray[7]
return {
id: id,
timestamp: ts,
home: home,
away: away,
......@@ -91,6 +100,7 @@ export default class BetPage extends Component {
this.state.events.push(this.parseEvent(event))
})
console.log(this.state.events)
this.setState({ events: this.state.events })
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment