Skip to content

Instantly share code, notes, and snippets.

View MasashiSalvador57f's full-sized avatar
🃏
That's Life

Masashi Salvador Mitsuzawa MasashiSalvador57f

🃏
That's Life
  • null
  • Tokyo, Japan
View GitHub Profile
Traceback (most recent call last):
File "/private/var/folders/14/1c4m6rnj2yg9t092lhh65ccm0000gp/T/pip-install-uelah6cy/grpcio/src/python/grpcio/commands.py", line 281, in build_extensions
build_ext.build_ext.build_extensions(self)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/Users/masashi.mitsuzawa/dev/go/1.12.0/src/github.com/LayerXcom/link-chain/venv/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 199, in build_extension
_build_ext.build_extension(self, ext)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
{
"contractHash": "916aea0f054541c4be723790931da144787bd725",
"abi": {
"functions": [
{
"name": "Main",
"parameters": [
{
"name": "operation",
"type": ""

フロントエンドとバックエンド(コントラクト)のやりとりについて

JSONの文字列形式で返すのが難しそうなので、下記のフォーマットで返します

## 返す文字列
a,11:b,22:c,33
## フロントエンドでの解釈
{
   "a": "11",
 "b": "22",
# トークン名
NAME = 'MOONTY'
# トークンのシンボル USDとかBTCみたいなもの
SYMBOL = 'MTYT'
# 最小単位が小数点第何位まで存在するか
DECIMALS = 8
FACTOR = 100000000
# OWNERのアドレス ここを自分のアドレスに書き換えてください。
OWNER = ToScriptHash("AVP2tuBG7ZTgGrJyHyaQJh37vgvFuLBEz1")
# OWNER = bytearray(b'\x61\x6f\x2a\x4a\x38\x39\x6f\xf2\x03\xea\x01\xe6\xc0\x70\xae\x42\x1b\xb8\xce\x2d')
@MasashiSalvador57f
MasashiSalvador57f / hello.py
Created October 26, 2018 11:24
sample ont
from boa.interop.System.Runtime import Notify
def Main(operation, args):
if operation == 'Hello':
msg = args[0]
return Hello(msg)
return False
def Hello(msg):
@MasashiSalvador57f
MasashiSalvador57f / file0.txt
Last active April 28, 2017 10:54
Sample code for react-infinite using ES6 syntax without React.createClass ref: http://qiita.com/MasashiSalvador/items/8c96952bde4bb20776d8
import React, { Component } from 'react';
import Infinite from 'react-infinite';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
@MasashiSalvador57f
MasashiSalvador57f / file0.txt
Created April 25, 2017 10:07
Error in launcing app server in Heroku (and how to solve) ref: http://qiita.com/rodavlas/items/ea6839f8bdaa80bdd4d4
2017-04-25T08:46:54.321621+00:00 app[web.1]: W, [2017-04-25T08:46:54.321561 #4] WARN -- : localhost:11211 failed (count: 0) Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 11211
# Error in launcing app server in Heroku (And how to solve)
## Environments
* Heroku
* Memcachier
* Rails 5 API Mode
* MySQL ClearDB
## Error
```
2017-04-25T08:46:54.321621+00:00 app[web.1]: W, [2017-04-25T08:46:54.321561 #4] WARN -- : localhost:11211 failed (count: 0) Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 11211
@MasashiSalvador57f
MasashiSalvador57f / call_api.js
Created March 30, 2017 09:35
a small suprise about fetch-mock (with whatwg-fetch) running in Jest ref: http://qiita.com/MasashiSalvador57f/items/ee6fb08498124770e13f
import 'whatwg-fetch';
export const makeRequest = () => {
return fetch("http://httpbin.org/get").then((response) => {
const x = response.json();
return x;
});
}
export default { makeRequest }