solace 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/solace/errors/confirmation_timeout.rb +1 -1
- data/lib/solace/errors/connection_error.rb +23 -0
- data/lib/solace/errors/error.rb +20 -0
- data/lib/solace/errors/http_error.rb +1 -1
- data/lib/solace/errors/parse_error.rb +1 -1
- data/lib/solace/errors/rpc_error.rb +1 -1
- data/lib/solace/errors.rb +4 -1
- data/lib/solace/utils/curve25519_dalek.rb +12 -2
- data/lib/solace/utils/libcurve25519_dalek-linux/libcurve25519_dalek.so +0 -0
- data/lib/solace/utils/libcurve25519_dalek-linux-arm64/libcurve25519_dalek.so +0 -0
- data/lib/solace/utils/libcurve25519_dalek-macos/libcurve25519_dalek.dylib +0 -0
- data/lib/solace/utils/libcurve25519_dalek-macos-arm64/libcurve25519_dalek.dylib +0 -0
- data/lib/solace/utils/libcurve25519_dalek-windows/curve25519_dalek.dll +0 -0
- data/lib/solace/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18aca49d63b09deffe93ba871b65d6b816a7c81863b0b0e2b2c2bd29ce709ce6
|
|
4
|
+
data.tar.gz: 810a45b1324aa282684e4a5d62ea48738ac2b33a6eb87538e2e0458ca2f54593
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50eeac609077e873b361fdb8ed34459ccbed1b4e44d52ad911803350ea0d2f0e669fcfcb30bcddd6d20e9f54dade972a50907532a108dae7142ecca8475f42fb
|
|
7
|
+
data.tar.gz: 5fba491757746aa8fad865bae93941f3469148c6a5fc8cb5c984ebccb79934f1b1c3425184ab37ff2342f6215a1d5b1147a9d04f6d9225a96e7c6b34c38d8b0d
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Solace
|
|
4
|
+
module Errors
|
|
5
|
+
# Base error class for connection-related failures.
|
|
6
|
+
#
|
|
7
|
+
# Both {Solace::Errors::HTTPError} and {Solace::Errors::RPCError} inherit
|
|
8
|
+
# from this class, allowing consumers to rescue all connection errors with
|
|
9
|
+
# a single clause:
|
|
10
|
+
#
|
|
11
|
+
# @example Rescuing all connection errors
|
|
12
|
+
# begin
|
|
13
|
+
# connection.send_transaction(transaction)
|
|
14
|
+
# rescue Solace::Errors::ConnectionError => e
|
|
15
|
+
# puts "Connection error: #{e.message}"
|
|
16
|
+
# end
|
|
17
|
+
#
|
|
18
|
+
# @see Solace::Errors::HTTPError
|
|
19
|
+
# @see Solace::Errors::RPCError
|
|
20
|
+
# @since 0.1.4
|
|
21
|
+
class ConnectionError < Error; end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Solace
|
|
4
|
+
module Errors
|
|
5
|
+
# Base error class for all Solace errors.
|
|
6
|
+
#
|
|
7
|
+
# All Solace-specific exceptions inherit from this class, allowing consumers
|
|
8
|
+
# to rescue all Solace errors with a single clause:
|
|
9
|
+
#
|
|
10
|
+
# @example Rescuing all Solace errors
|
|
11
|
+
# begin
|
|
12
|
+
# connection.get_account_info(address)
|
|
13
|
+
# rescue Solace::Errors::Error => e
|
|
14
|
+
# puts "Solace error: #{e.message}"
|
|
15
|
+
# end
|
|
16
|
+
#
|
|
17
|
+
# @since 0.1.4
|
|
18
|
+
class Error < StandardError; end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/solace/errors.rb
CHANGED
|
@@ -5,6 +5,8 @@ module Solace
|
|
|
5
5
|
#
|
|
6
6
|
# These exceptions provide specific error handling for various failure scenarios
|
|
7
7
|
# when interacting with the Solana blockchain, including:
|
|
8
|
+
# - {Solace::Errors::Error} - Base class for all Solace errors
|
|
9
|
+
# - {Solace::Errors::ConnectionError} - Base class for connection-related errors
|
|
8
10
|
# - {Solace::Errors::HTTPError} - HTTP communication failures
|
|
9
11
|
# - {Solace::Errors::RPCError} - RPC method errors returned by the node
|
|
10
12
|
# - {Solace::Errors::ParseError} - Data parsing and deserialization errors
|
|
@@ -13,7 +15,8 @@ module Solace
|
|
|
13
15
|
# @see Solace::Connection
|
|
14
16
|
# @since 0.0.8
|
|
15
17
|
module Errors
|
|
16
|
-
|
|
18
|
+
require 'solace/errors/error'
|
|
19
|
+
require 'solace/errors/connection_error'
|
|
17
20
|
require 'solace/errors/rpc_error'
|
|
18
21
|
require 'solace/errors/http_error'
|
|
19
22
|
require 'solace/errors/parse_error'
|
|
@@ -24,8 +24,18 @@ module Solace
|
|
|
24
24
|
# @return [String] The path to the native library
|
|
25
25
|
# @raise [RuntimeError] If the platform is not supported
|
|
26
26
|
libfile = case RUBY_PLATFORM
|
|
27
|
-
when /linux/
|
|
28
|
-
|
|
27
|
+
when /linux/
|
|
28
|
+
if RUBY_PLATFORM =~ /arm|aarch64/
|
|
29
|
+
'libcurve25519_dalek-linux-arm64/libcurve25519_dalek.so'
|
|
30
|
+
else
|
|
31
|
+
'libcurve25519_dalek-linux/libcurve25519_dalek.so'
|
|
32
|
+
end
|
|
33
|
+
when /darwin/
|
|
34
|
+
if RUBY_PLATFORM =~ /arm64|aarch64/
|
|
35
|
+
'libcurve25519_dalek-macos-arm64/libcurve25519_dalek.dylib'
|
|
36
|
+
else
|
|
37
|
+
'libcurve25519_dalek-macos/libcurve25519_dalek.dylib'
|
|
38
|
+
end
|
|
29
39
|
when /mingw|mswin/ then 'libcurve25519_dalek-windows/curve25519_dalek.dll'
|
|
30
40
|
else raise 'Unsupported platform'
|
|
31
41
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/solace/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solace
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sebastian Scholl
|
|
@@ -122,6 +122,8 @@ files:
|
|
|
122
122
|
- lib/solace/constants.rb
|
|
123
123
|
- lib/solace/errors.rb
|
|
124
124
|
- lib/solace/errors/confirmation_timeout.rb
|
|
125
|
+
- lib/solace/errors/connection_error.rb
|
|
126
|
+
- lib/solace/errors/error.rb
|
|
125
127
|
- lib/solace/errors/http_error.rb
|
|
126
128
|
- lib/solace/errors/parse_error.rb
|
|
127
129
|
- lib/solace/errors/rpc_error.rb
|
|
@@ -159,7 +161,9 @@ files:
|
|
|
159
161
|
- lib/solace/utils/account_context.rb
|
|
160
162
|
- lib/solace/utils/codecs.rb
|
|
161
163
|
- lib/solace/utils/curve25519_dalek.rb
|
|
164
|
+
- lib/solace/utils/libcurve25519_dalek-linux-arm64/libcurve25519_dalek.so
|
|
162
165
|
- lib/solace/utils/libcurve25519_dalek-linux/libcurve25519_dalek.so
|
|
166
|
+
- lib/solace/utils/libcurve25519_dalek-macos-arm64/libcurve25519_dalek.dylib
|
|
163
167
|
- lib/solace/utils/libcurve25519_dalek-macos/libcurve25519_dalek.dylib
|
|
164
168
|
- lib/solace/utils/libcurve25519_dalek-windows/curve25519_dalek.dll
|
|
165
169
|
- lib/solace/utils/pda.rb
|
|
@@ -192,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
192
196
|
- !ruby/object:Gem::Version
|
|
193
197
|
version: '0'
|
|
194
198
|
requirements: []
|
|
195
|
-
rubygems_version:
|
|
199
|
+
rubygems_version: 4.0.6
|
|
196
200
|
specification_version: 4
|
|
197
201
|
summary: Solana ruby library
|
|
198
202
|
test_files: []
|