ethash 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b17f1635a3bfef331ddf8f10ffdf6943362355f3
4
- data.tar.gz: 2b0cdea9167e4f34dd880ce419c53e5d2681f944
3
+ metadata.gz: 063f702fa0b0e5afec451f245e6db7a7e0b603f8
4
+ data.tar.gz: 4575cbeda5b58ae4224d5a4443f0cad114fb7828
5
5
  SHA512:
6
- metadata.gz: de099a9fbf8a876796a9d193a1261d96dd444938412b42c2760b0fcdf3fa439dbd9a89348cee75e813b0d3e7d3121812dcca7fd368aedf3d083059e3c1d4def4
7
- data.tar.gz: e9d59f48c0263d024b7571e8f64ecda460fbec81c726f2663b80db168aa4c34a5bcbd8a08df724cfe31790db02a1fc0a81bcd18fedb31e3f2d6c18015ae0f1f9
6
+ metadata.gz: 78c7d839369b8be690a03ebadea50a4004f50d531c7dc3710806d89b71e47f1f0e2236257e9e02f6a5c1f5c1dd942ae7ae99d8d564cee9ce6b95cd64a4ac679e
7
+ data.tar.gz: b5eefc138398bb704969ffeade9c56f9d533a5fc205255b6af18ce012272a625d222284e6e1ec6e7ebf705a4079f2e65398f101410647a8f837c4b13f32431cd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ethash (0.1.0)
4
+ ethash (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -69,6 +69,19 @@ ethash_get_seedhash_wrapper(VALUE self, VALUE blknum) {
69
69
  void
70
70
  Init_ethash() {
71
71
  rb_mEthash = rb_define_module("Ethash");
72
+
73
+ rb_define_const(rb_mEthash, "REVISION", LONG2NUM((long) ETHASH_REVISION));
74
+ rb_define_const(rb_mEthash, "DATASET_BYTES_INIT", LONG2NUM((long) ETHASH_DATASET_BYTES_INIT));
75
+ rb_define_const(rb_mEthash, "DATASET_BYTES_GROWTH", LONG2NUM((long) ETHASH_DATASET_BYTES_GROWTH));
76
+ rb_define_const(rb_mEthash, "CACHE_BYTES_INIT", LONG2NUM((long) ETHASH_CACHE_BYTES_INIT));
77
+ rb_define_const(rb_mEthash, "CACHE_BYTES_GROWTH", LONG2NUM((long) ETHASH_CACHE_BYTES_GROWTH));
78
+ rb_define_const(rb_mEthash, "EPOCH_LENGTH", LONG2NUM((long) ETHASH_EPOCH_LENGTH));
79
+ rb_define_const(rb_mEthash, "MIX_BYTES", LONG2NUM((long) ETHASH_MIX_BYTES));
80
+ rb_define_const(rb_mEthash, "HASH_BYTES", LONG2NUM((long) ETHASH_HASH_BYTES));
81
+ rb_define_const(rb_mEthash, "DATASET_PARENTS", LONG2NUM((long) ETHASH_DATASET_PARENTS));
82
+ rb_define_const(rb_mEthash, "CACHE_ROUNDS", LONG2NUM((long) ETHASH_CACHE_ROUNDS));
83
+ rb_define_const(rb_mEthash, "ACCESSES", LONG2NUM((long) ETHASH_ACCESSES));
84
+
72
85
  rb_define_singleton_method(rb_mEthash, "mkcache_bytes", ethash_mkcache_bytes, 1);
73
86
  rb_define_singleton_method(rb_mEthash, "hashimoto_light", ethash_hashimoto_light, 4);
74
87
  rb_define_singleton_method(rb_mEthash, "get_seedhash", ethash_get_seedhash_wrapper, 1);
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : ascii-8bit -*-
2
2
 
3
3
  module Ethash
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -23,4 +23,9 @@ class EthashTest < Minitest::Test
23
23
  assert_raises(RuntimeError) { Ethash.get_seedhash(99999999) }
24
24
  end
25
25
 
26
+ def test_constants
27
+ assert Ethash::REVISION > 0
28
+ assert_equal Fixnum, Ethash::REVISION.class
29
+ end
30
+
26
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Xie