Skip to content

Instantly share code, notes, and snippets.

@Daniel-VDM
Last active February 8, 2020 22:01
Show Gist options
  • Select an option

  • Save Daniel-VDM/1da5963b58bd7e909d082ed1a31f3794 to your computer and use it in GitHub Desktop.

Select an option

Save Daniel-VDM/1da5963b58bd7e909d082ed1a31f3794 to your computer and use it in GitHub Desktop.

Blacklist file used on testnet:

one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj # This is a comment
one1cwv3kk220ujzgvatz0h924t0hr8gkrmjc57jpm

Note that hmyTest is an alias for ./hmy --node=https://api.s0.b.hmny.io/

Testing 'from' account blacklist

$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj
[
  {
    "shard": 0,
    "amount": 0.000000114000000000
  },
  {
    "shard": 1,
    "amount": 0.000000000000000000
  },
  {
    "shard": 2,
    "amount": 0.000000000000000000
  }
]
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1skysmxdz0vu4w4fxmspkrcf9k3lacc6qydqj55
[
  {
    "shard": 0,
    "amount": 9.999893240157708115
  },
  {
    "shard": 1,
    "amount": 9.999899457678104850
  },
  {
    "shard": 2,
    "amount": 9.999893694620912495
  }
]
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest transfer --from one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj --to one1skysmxdz0vu4w4fxmspkrcf9k3lacc6qydqj55 --amount 0.0000001 --from-shard 0 --to-shard 0 --gas-limit 1 --gas-price 0.000000000001
{
  "transaction-receipt": "0xb896bcd16f9c62daa59d613894f011700010804349870f9f2032d1e7d56157bf",
  "time-signed-utc": "2020-02-08 21:38:20.408489"
}
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest failures plain | grep 0xb896bcd16f9c62daa59d613894f011700010804349870f9f2032d1e7d56157bf
      "tx-hash-id": "0xb896bcd16f9c62daa59d613894f011700010804349870f9f2032d1e7d56157bf"
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest failures plain
{
  "id": "0",
  "jsonrpc": "2.0",
  "result": [
    {
      "error-message": "transaction sender is one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj: `from` address of transaction in blacklist",
      "time-at-rejection": 1581197900,
      "tx-hash-id": "0xb896bcd16f9c62daa59d613894f011700010804349870f9f2032d1e7d56157bf"
    }
  ]
}
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj
[
  {
    "shard": 0,
    "amount": 0.000000114000000000
  },
  {
    "shard": 1,
    "amount": 0.000000000000000000
  },
  {
    "shard": 2,
    "amount": 0.000000000000000000
  }
]
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1skysmxdz0vu4w4fxmspkrcf9k3lacc6qydqj55
[
  {
    "shard": 0,
    "amount": 9.999893240157708115
  },
  {
    "shard": 1,
    "amount": 9.999899457678104850
  },
  {
    "shard": 2,
    "amount": 9.999893694620912495
  }
]

Testing 'to' account blacklisted

$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur
[
  {
    "shard": 0,
    "amount": 66895624.976762305159576000
  },
  {
    "shard": 1,
    "amount": 68856836.978623534632129000
  },
  {
    "shard": 2,
    "amount": 68956869.978744560215312000
  }
]
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj
[
  {
    "shard": 0,
    "amount": 0.000000114000000000
  },
  {
    "shard": 1,
    "amount": 0.000000000000000000
  },
  {
    "shard": 2,
    "amount": 0.000000000000000000
  }
]
$ hmyTest transfer --to one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj --from one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur --amount 10  --from-shard 0 --to-shard 0 --gas-limit 1 
{
  "transaction-receipt": "0x15553304a65f796350c8d91816bb0da26aabb97599039634c96657ede84c257d",
  "time-signed-utc": "2020-02-08 21:44:54.353625"
}
$ hmyTest failures plain | grep 0x15553304a65f796350c8d91816bb0da26aabb97599039634c96657ede84c257d
      "tx-hash-id": "0x15553304a65f796350c8d91816bb0da26aabb97599039634c96657ede84c257d"
$ hmyTest failures plain
{
  "id": "0",
  "jsonrpc": "2.0",
  "result": [
    {
      "error-message": "transaction sender is one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj: `from` address of transaction in blacklist",
      "time-at-rejection": 1581197900,
      "tx-hash-id": "0xb896bcd16f9c62daa59d613894f011700010804349870f9f2032d1e7d56157bf"
    },
    {
      "error-message": "transaction receiver is one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj: `to` address of transaction in blacklist",
      "time-at-rejection": 1581198294,
      "tx-hash-id": "0x15553304a65f796350c8d91816bb0da26aabb97599039634c96657ede84c257d"
    }
  ]
}
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur
[
  {
    "shard": 0,
    "amount": 66895624.976762305159576000
  },
  {
    "shard": 1,
    "amount": 68856836.978623534632129000
  },
  {
    "shard": 2,
    "amount": 68956869.978744560215312000
  }
]
$ (base) Daniel-MBP:go-sdk danielvdm$ hmyTest balances one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj
[
  {
    "shard": 0,
    "amount": 0.000000114000000000
  },
  {
    "shard": 1,
    "amount": 0.000000000000000000
  },
  {
    "shard": 2,
    "amount": 0.000000000000000000
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment