UnUniFi / utils

10 stars 2 forks source link

fix: hotfix pricefeed fee #194

Closed YasunoriMATSUOKA closed 2 years ago

YasunoriMATSUOKA commented 2 years ago

@KimuraYu45z レビューお願いします。

手数料計算の実装にて、stringな数字(例えば7) + numberな数字(例えば1) = (期待値8に対して71になってしまう)のようなアホみたいなバグを作りこんでしまっていました(-_-;)

ローカルからプライベートテストネット向けに動作させて動作確認済です。

YasunoriMATSUOKA commented 2 years ago

動作確認記録

$ npm run start:dev

> pricefeed@0.0.1 start:dev
> node --inspect=5859 -r ts-node/register ./src/index.ts

Debugger listening on ws://127.0.0.1:5859/7c6d99c2-abac-4537-ae14-e752ecb7549b
For help, see: https://nodejs.org/en/docs/inspector
[2022-02-02T10:30:27.967Z] denominatedPrice 4.406633105
[2022-02-02T10:30:28.033Z] posting price 4.406633105000000050 for ubtc:jpy with sequence 0
[2022-02-02T10:30:28.092Z] simulate
[2022-02-02T10:30:28.092Z] {
  status: 200,
  statusText: 'OK',
  headers: {
    'content-type': 'application/json',
    'grpc-metadata-x-cosmos-block-height': '32097',
    'x-server-time': '1643797818',
    date: 'Wed, 02 Feb 2022 10:30:18 GMT',
    'content-length': '1975',
    connection: 'close'
  },
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.23.0',
      'Content-Length': 1103
    },
    method: 'post',
    data: '{"tx":{"body":{"messages":[{"@type":"/ununifi.pricefeed.MsgPostPrice","from":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug","market_id":"ubtc:jpy","price":"4.406633105000000050","expiry":"2022-02-02T14:30:28.000Z"}],"extension_options":[],"non_critical_extension_options":[],"memo":"","timeout_height":"0"},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AsC4IkYqjMXlDiYQyPvNMtI9FM771dnaJqv6KZJVezXO"},"mode_info":{"single":{"mode":1}},"sequence":"0"}],"fee":{"amount":[{"denom":"uguu","amount":"1"}],"gas_limit":"1","payer":"","granter":""}},"signatures":["Q560r0jRsWQANtz6MSaF+KcdyPhY7KfKgQ92K2BTlv5K1m1T5o2f8rMdP76pUBAcenl/beF5EOwsnzvOxQnq7Q=="]},"tx_bytes":"Cn0KewofL3VudW5pZmkucHJpY2VmZWVkLk1zZ1Bvc3RQcmljZRJYCi51bnVuaWZpMXlyMGdwbHM2MG5zeWU5NmFkdXA5a3VoMnlyeGRsbjQ4YXNjZHVnEgh1YnRjOmpweRoUNC40MDY2MzMxMDUwMDAwMDAwNTAiBgiEq+qPBhJhClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiECwLgiRiqMxeUOJhDI+80y0j0UzvvV2domq/opklV7Nc4SBAoCCAEYABINCgkKBHVndXUSATEQARpAQ560r0jRsWQANtz6MSaF+KcdyPhY7KfKgQ92K2BTlv5K1m1T5o2f8rMdP76pUBAcenl/beF5EOwsnzvOxQnq7Q=="}',
    url: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/simulate'
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: Socket {
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'd.private-test.ununifi.cauchye.net',
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(async_id_symbol)]: 38254,
      [Symbol(kHandle)]: [TCP],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /cosmos/tx/v1beta1/simulate HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: axios/0.23.0\r\n' +
      'Content-Length: 1103\r\n' +
      'Host: d.private-test.ununifi.cauchye.net:1317\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 80,
      protocol: 'http:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/cosmos/tx/v1beta1/simulate',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [Socket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 200,
      statusMessage: 'OK',
      client: [Socket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/simulate',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 12,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'd.private-test.ununifi.cauchye.net',
    protocol: 'http:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 1103,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/simulate',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    }
  },
  data: {
    gas_info: { gas_wanted: '0', gas_used: '70895' },
    result: {
      data: 'CiEKHy91bnVuaWZpLnByaWNlZmVlZC5Nc2dQb3N0UHJpY2U=',
      log: '[{"events":[{"type":"message","attributes":[{"key":"action","value":"post_price"},{"key":"module","value":"pricefeed"},{"key":"sender","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"}]},{"type":"oracle_updated_price","attributes":[{"key":"market_id","value":"ubtc:jpy"},{"key":"oracle","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"},{"key":"market_price","value":"4.406633105000000050"},{"key":"expiry","value":"2022-02-02 14:30:28 +0000 UTC"}]}]}]',
      events: [Array]
    }
  }
}
[2022-02-02T10:30:28.094Z] {
  simulatedGasUsed: '70895',
  simulatedGasUsedWithMargin: '77985',
  simulatedFeeWithMarginNumber: 7.798500000000001,
  simulatedFeeWithMargin: '8'
}
[2022-02-02T10:30:30.040Z] broadcast
[2022-02-02T10:30:30.040Z] {
  status: 200,
  statusText: 'OK',
  headers: {
    'content-type': 'application/json',
    'x-server-time': '1643797819',
    date: 'Wed, 02 Feb 2022 10:30:20 GMT',
    connection: 'close',
    'transfer-encoding': 'chunked'
  },
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.23.0',
      'Content-Length': 437
    },
    method: 'post',
    data: '{"tx_bytes":"Cn0KewofL3VudW5pZmkucHJpY2VmZWVkLk1zZ1Bvc3RQcmljZRJYCi51bnVuaWZpMXlyMGdwbHM2MG5zeWU5NmFkdXA5a3VoMnlyeGRsbjQ4YXNjZHVnEgh1YnRjOmpweRoUNC40MDY2MzMxMDUwMDAwMDAwNTAiBgiEq+qPBhJjClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiECwLgiRiqMxeUOJhDI+80y0j0UzvvV2domq/opklV7Nc4SBAoCCAEYABIPCgkKBHVndXUSATgQoeEEGkAgtQTp/vmzzXlwhtsDZ3DAmVEX416mM/eB9RjmgQg7jgFtGs0mwGe0WyMWOR5FGKYGbQTJEwtg9sJ3+Md9Z54m","mode":"BROADCAST_MODE_BLOCK"}',
    url: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/txs'
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: Socket {
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'd.private-test.ununifi.cauchye.net',
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(async_id_symbol)]: 38279,
      [Symbol(kHandle)]: [TCP],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /cosmos/tx/v1beta1/txs HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: axios/0.23.0\r\n' +
      'Content-Length: 437\r\n' +
      'Host: d.private-test.ununifi.cauchye.net:1317\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 80,
      protocol: 'http:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/cosmos/tx/v1beta1/txs',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [Socket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 200,
      statusMessage: 'OK',
      client: [Socket],
      _consuming: true,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/txs',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 10,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'd.private-test.ununifi.cauchye.net',
    protocol: 'http:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 437,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/txs',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    }
  },
  data: {
    tx_response: {
      height: '32098',
      txhash: '05C51A4B9C83EFADA56D613DFB6C7B1A0EDFD913A5925EB577DA0DD9E11A17BA',
      codespace: '',
      code: 0,
      data: '0A210A1F2F756E756E6966692E7072696365666565642E4D7367506F73745072696365',
      raw_log: '[{"events":[{"type":"message","attributes":[{"key":"action","value":"post_price"},{"key":"module","value":"pricefeed"},{"key":"sender","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"}]},{"type":"oracle_updated_price","attributes":[{"key":"market_id","value":"ubtc:jpy"},{"key":"oracle","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"},{"key":"market_price","value":"4.406633105000000050"},{"key":"expiry","value":"2022-02-02 14:30:28 +0000 UTC"}]}]}]',
      logs: [Array],
      info: '',
      gas_wanted: '77985',
      gas_used: '70915',
      tx: null,
      timestamp: '',
      events: [Array]
    }
  }
}
[2022-02-02T10:30:48.180Z] denominatedPrice 4.401192018245214
[2022-02-02T10:30:48.272Z] posting price 4.401192018245214221 for ubtc:jpy:30 with sequence 1
[2022-02-02T10:30:48.370Z] simulate
[2022-02-02T10:30:48.370Z] {
  status: 200,
  statusText: 'OK',
  headers: {
    'content-type': 'application/json',
    'grpc-metadata-x-cosmos-block-height': '32101',
    'x-server-time': '1643797839',
    date: 'Wed, 02 Feb 2022 10:30:39 GMT',
    'content-length': '1982',
    connection: 'close'
  },
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.23.0',
      'Content-Length': 1110
    },
    method: 'post',
    data: '{"tx":{"body":{"messages":[{"@type":"/ununifi.pricefeed.MsgPostPrice","from":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug","market_id":"ubtc:jpy:30","price":"4.401192018245214221","expiry":"2022-02-02T14:30:48.000Z"}],"extension_options":[],"non_critical_extension_options":[],"memo":"","timeout_height":"0"},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AsC4IkYqjMXlDiYQyPvNMtI9FM771dnaJqv6KZJVezXO"},"mode_info":{"single":{"mode":1}},"sequence":"1"}],"fee":{"amount":[{"denom":"uguu","amount":"1"}],"gas_limit":"1","payer":"","granter":""}},"signatures":["JbtPYOzk4PxnyUjk8ReSHINCba7bbAEPvfgghHgfrqgR1LCMpU2tLUcQZwLLW/YQoAftOWLkKrLgiMumJShF8w=="]},"tx_bytes":"CoABCn4KHy91bnVuaWZpLnByaWNlZmVlZC5Nc2dQb3N0UHJpY2USWwoudW51bmlmaTF5cjBncGxzNjBuc3llOTZhZHVwOWt1aDJ5cnhkbG40OGFzY2R1ZxILdWJ0YzpqcHk6MzAaFDQuNDAxMTkyMDE4MjQ1MjE0MjIxIgYImKvqjwYSYQpQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAsC4IkYqjMXlDiYQyPvNMtI9FM771dnaJqv6KZJVezXOEgQKAggBGAESDQoJCgR1Z3V1EgExEAEaQCW7T2Ds5OD8Z8lI5PEXkhyDQm2u22wBD734IIR4H66oEdSwjKVNrS1HEGcCy1v2EKAH7Tli5Cqy4IjLpiUoRfM="}',
    url: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/simulate'
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: Socket {
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'd.private-test.ununifi.cauchye.net',
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(async_id_symbol)]: 204760,
      [Symbol(kHandle)]: [TCP],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /cosmos/tx/v1beta1/simulate HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: axios/0.23.0\r\n' +
      'Content-Length: 1110\r\n' +
      'Host: d.private-test.ununifi.cauchye.net:1317\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 80,
      protocol: 'http:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/cosmos/tx/v1beta1/simulate',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [Socket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 200,
      statusMessage: 'OK',
      client: [Socket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/simulate',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 12,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'd.private-test.ununifi.cauchye.net',
    protocol: 'http:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 1110,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/simulate',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    }
  },
  data: {
    gas_info: { gas_wanted: '0', gas_used: '65068' },
    result: {
      data: 'CiEKHy91bnVuaWZpLnByaWNlZmVlZC5Nc2dQb3N0UHJpY2U=',
      log: '[{"events":[{"type":"message","attributes":[{"key":"action","value":"post_price"},{"key":"module","value":"pricefeed"},{"key":"sender","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"}]},{"type":"oracle_updated_price","attributes":[{"key":"market_id","value":"ubtc:jpy:30"},{"key":"oracle","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"},{"key":"market_price","value":"4.401192018245214221"},{"key":"expiry","value":"2022-02-02 14:30:48 +0000 UTC"}]}]}]',
      events: [Array]
    }
  }
}
[2022-02-02T10:30:48.371Z] {
  simulatedGasUsed: '65068',
  simulatedGasUsedWithMargin: '71575',
  simulatedFeeWithMarginNumber: 7.157500000000001,
  simulatedFeeWithMargin: '8'
}
[2022-02-02T10:30:56.696Z] broadcast
[2022-02-02T10:30:56.696Z] {
  status: 200,
  statusText: 'OK',
  headers: {
    'content-type': 'application/json',
    'x-server-time': '1643797839',
    date: 'Wed, 02 Feb 2022 10:30:47 GMT',
    connection: 'close',
    'transfer-encoding': 'chunked'
  },
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.23.0',
      'Content-Length': 445
    },
    method: 'post',
    data: '{"tx_bytes":"CoABCn4KHy91bnVuaWZpLnByaWNlZmVlZC5Nc2dQb3N0UHJpY2USWwoudW51bmlmaTF5cjBncGxzNjBuc3llOTZhZHVwOWt1aDJ5cnhkbG40OGFzY2R1ZxILdWJ0YzpqcHk6MzAaFDQuNDAxMTkyMDE4MjQ1MjE0MjIxIgYImKvqjwYSYwpQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAsC4IkYqjMXlDiYQyPvNMtI9FM771dnaJqv6KZJVezXOEgQKAggBGAESDwoJCgR1Z3V1EgE4EJevBBpA+dAqImdLbJeC6e6fkySdz5gVbCeoeIbZCZ2jDtjz1/8/dh1E+0tc9rv1+wdeqE3Bko4yVdX18GX4veq4ZuZ8zQ==","mode":"BROADCAST_MODE_BLOCK"}',
    url: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/txs'
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: Socket {
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'd.private-test.ununifi.cauchye.net',
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: null,
      _server: null,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(async_id_symbol)]: 204785,
      [Symbol(kHandle)]: [TCP],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /cosmos/tx/v1beta1/txs HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: axios/0.23.0\r\n' +
      'Content-Length: 445\r\n' +
      'Host: d.private-test.ununifi.cauchye.net:1317\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 80,
      protocol: 'http:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/cosmos/tx/v1beta1/txs',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [Socket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 200,
      statusMessage: 'OK',
      client: [Socket],
      _consuming: true,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/txs',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 10,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'd.private-test.ununifi.cauchye.net',
    protocol: 'http:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 445,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'http://d.private-test.ununifi.cauchye.net:1317/cosmos/tx/v1beta1/txs',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    }
  },
  data: {
    tx_response: {
      height: '32103',
      txhash: '061270977671FCA00FC6F8EEF8F42F212F65E0D9E5FDF9173198833F70A1FB8A',
      codespace: '',
      code: 0,
      data: '0A210A1F2F756E756E6966692E7072696365666565642E4D7367506F73745072696365',
      raw_log: '[{"events":[{"type":"message","attributes":[{"key":"action","value":"post_price"},{"key":"module","value":"pricefeed"},{"key":"sender","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"}]},{"type":"oracle_updated_price","attributes":[{"key":"market_id","value":"ubtc:jpy:30"},{"key":"oracle","value":"ununifi1yr0gpls60nsye96adup9kuh2yrxdln48ascdug"},{"key":"market_price","value":"4.401192018245214221"},{"key":"expiry","value":"2022-02-02 14:30:48 +0000 UTC"}]}]}]',
      logs: [Array],
      info: '',
      gas_wanted: '71575',
      gas_used: '65088',
      tx: null,
      timestamp: '',
      events: [Array]
    }
  }
}