@@ -34,16 +34,17 @@ class StatelessTransaction extends React.Component {
34 txError: Nothing(),
34 txError: Nothing(),
37− this.handleCreateUnsignedTxn = this.handleCreateUnsignedTxn.bind(this)
37+ this.createUnsignedTxn = this.createUnsignedTxn.bind(this)
38− this.handleSubmit = this.handleSubmit.bind(this)
38+ this.submit = this.submit.bind(this)
39− this.handleSetUserApproval = this.handleSetUserApproval.bind(this)
39+ this.setUserApproval = this.setUserApproval.bind(this)
40− this.handleSetTxn = this.handleSetTxn.bind(this)
40+ this.setTxn = this.setTxn.bind(this)
41 this.setStx = this.setStx.bind(this)
41 this.setStx = this.setStx.bind(this)
42 this.sendTxn = this.sendTxn.bind(this)
42 this.sendTxn = this.sendTxn.bind(this)
43− this.handleSetNonce = this.handleSetNonce.bind(this)
43+ this.setNonce = this.setNonce.bind(this)
44− this.handleSetChainId = this.handleSetChainId.bind(this)
44+ this.setChainId = this.setChainId.bind(this)
45− this.handleSetGasPrice = this.handleSetGasPrice.bind(this)
45+ this.setGasPrice = this.setGasPrice.bind(this)
46− this.handleSetGasLimit = this.handleSetGasLimit.bind(this)
46+ this.setGasLimit = this.setGasLimit.bind(this)
47+ this.rangeChange = this.rangeChange.bind(this)
47 this.toggleGasDetails = this.toggleGasDetails.bind(this)
48 this.toggleGasDetails = this.toggleGasDetails.bind(this)
@@ -82,7 +83,7 @@ class StatelessTransaction extends React.Component {
85− handleSubmit(){
86+ submit(){
86 const { props, state } = this
87 const { props, state } = this
87 sendSignedTransaction(props.web3.value, state.stx)
88 sendSignedTransaction(props.web3.value, state.stx)
88 .then(sent => {
89 .then(sent => {
@@ -96,7 +97,7 @@ class StatelessTransaction extends React.Component {
99− handleSetUserApproval(){
100+ setUserApproval(){
100 const {state} = this
101 const {state} = this
101 this.setState({ userApproval: !state.userApproval })
102 this.setState({ userApproval: !state.userApproval })
@@ -114,16 +115,16 @@ class StatelessTransaction extends React.Component {
117− handleSetTxn(txn){
118+ setTxn(txn){
118 this.setState({ txn })
119 this.setState({ txn })
121− handleCreateUnsignedTxn() {
122+ createUnsignedTxn() {
122 const txn = this.props.createUnsignedTxn()
123 const txn = this.props.createUnsignedTxn()
123 this.setState({ txn })
124 this.setState({ txn })
126− handleClearTxn() {
127+ clearTxn() {
127 this.setState({
128 this.setState({
128 userApproval: false,
129 userApproval: false,
129 txn: Nothing(),
130 txn: Nothing(),
@@ -131,31 +132,31 @@ class StatelessTransaction extends React.Component {
134− handleSetNonce(nonce){
135+ setNonce(nonce){
135 this.setState({ nonce })
136 this.setState({ nonce })
136− this.handleClearStx()
137+ this.clearStx()
139− handleSetChainId(chainId){
140+ setChainId(chainId){
140 this.setState({ chainId })
141 this.setState({ chainId })
141− this.handleClearStx()
142+ this.clearStx()
144− handleSetGasPrice(gasPrice) {
145+ setGasPrice(gasPrice) {
145 this.setState({ gasPrice })
146 this.setState({ gasPrice })
146− this.handleClearStx()
147+ this.clearStx()
149− handleRangeChange(e) {
150+ rangeChange(e) {
150− this.handleSetGasPrice(e.target.value);
151+ this.setGasPrice(e.target.value);
153− handleSetGasLimit(gasLimit){
154+ setGasLimit(gasLimit){
154 this.setState({ gasLimit })
155 this.setState({ gasLimit })
155− this.handleClearStx()
156+ this.clearStx()
158− handleClearStx() {
159+ clearStx() {
159 this.setState({
160 this.setState({
160 userApproval: false,
161 userApproval: false,
161 stx: Nothing(),
162 stx: Nothing(),
@@ -163,7 +164,7 @@ class StatelessTransaction extends React.Component {
165 // TODO: Investigate
166 // TODO: Investigate
166− // setState doesn't seem to work in SetProxy/handleSubmit;
167+ // setState doesn't seem to work in SetProxy/submit;
167 // - TypeError: Cannot read property 'updater' of undefined
168 // - TypeError: Cannot read property 'updater' of undefined
168 // so just modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
169 // so just modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
@@ -171,17 +172,17 @@ class StatelessTransaction extends React.Component {
171 e.target.setAttribute("disabled", true);
172 e.target.setAttribute("disabled", true);
172 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
173 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
173 spinner.classList.remove('hide');
174 spinner.classList.remove('hide');
174− this.handleSubmit()
175+ this.submit()
177 render() {
178 render() {
178 const { web3, canGenerate } = this.props
179 const { web3, canGenerate } = this.props
179 const { gasPrice, gasLimit, nonce, chainId,
180 const { gasPrice, gasLimit, nonce, chainId,
180− txn, stx, userApproval } = this.state
181+ txn, stx, userApproval, showGasDetails } = this.state
182 const { setNonce, setChainId, setGasLimit, setGasPrice,
183 const { setNonce, setChainId, setGasLimit, setGasPrice,
183− handleSubmit, showGasDetails, toggleGasDetails, handleSetUserApproval,
184+ submit, toggleGasDetails, setUserApproval,
184− sendTxn, handleCreateUnsignedTxn } = this
185+ sendTxn, createUnsignedTxn } = this
186 const { state } = this
187 const { state } = this
@@ -205,7 +206,7 @@ class StatelessTransaction extends React.Component {
205 disabled={ !canGenerate }
206 disabled={ !canGenerate }
206 prop-color={ generateButtonColor }
207 prop-color={ generateButtonColor }
207 prop-size={ 'lg wide' }
208 prop-size={ 'lg wide' }
208− onClick={ handleCreateUnsignedTxn }
209+ onClick={ createUnsignedTxn }
210 { 'Generate Transaction' }
211 { 'Generate Transaction' }
211 </Button>
212 </Button>
@@ -243,7 +244,7 @@ class StatelessTransaction extends React.Component {
244 list="gweiVals"
245 list="gweiVals"
245 value={gasPrice}
246 value={gasPrice}
246− onChange={this.handleRangeChange}
247+ onChange={this.rangeChange}
249 <div className="flex space-between text-sm mb-8">
250 <div className="flex space-between text-sm mb-8">
@@ -345,7 +346,7 @@ class StatelessTransaction extends React.Component {
345 <CheckboxButton
346 <CheckboxButton
346 className={ 'mt-8' }
347 className={ 'mt-8' }
347 disabled={ !canApprove }
348 disabled={ !canApprove }
348− onClick={ handleSetUserApproval }
349+ onClick={ setUserApproval }
349 state={ userApproval }
350 state={ userApproval }