Skip to content

Commit

Permalink
merge w. 5.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Feb 28, 2024
2 parents e46fc2d + e7dbd1c commit 5f2ed85
Show file tree
Hide file tree
Showing 28 changed files with 131 additions and 103 deletions.
4 changes: 3 additions & 1 deletion ergo-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ val handshakeMessageSerialized = HandshakeSerializer.toBytes(handshakeMessage)
Serialize the message and send it.
If the message arrived successfully, start communicating with the peer node.

All communication is wrapped with Message headers, format described [here](https://docs.ergoplatform.com/dev/p2p/network/#message-format).
All communication is wrapped with message headers.
Format described [here](https://docs.ergoplatform.com/dev/p2p/network/#message-format).
[MessageBase](src/main/scala/org/ergoplatform/network/message/MessageBase.scala) interface to implement.

## Syncing with the node

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package org.ergoplatform.network.message

import org.ergoplatform.network.message.MessageConstants._

import scala.util.{Success, Try}

/**
* Trait for a ergo network message
*
* @param spec - message specification
* @param input - message being wrapped, whether in byte-array form (if from outside),
* or structured data (if formed locally)
* @tparam Content - message data type
*/
trait MessageBase[Content] {
val spec: MessageSpec[Content]
val input: Either[Array[Byte], Content]

/**
* Message data bytes
*/
lazy val dataBytes: Array[Byte] = input match {
case Left(db) => db
case Right(d) => spec.toBytes(d)
}

/**
* Structured message content
*/
lazy val data: Try[Content] = input match {
case Left(db) => spec.parseBytesTry(db)
case Right(d) => Success(d)
}

lazy val dataLength: Int = dataBytes.length

/**
* @return serialized message length in bytes
*/
def messageLength: Int = {
if (dataLength > 0) {
HeaderLength + ChecksumLength + dataLength
} else {
HeaderLength
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package org.ergoplatform.wallet.crypto
import org.ergoplatform.sdk.wallet.settings.EncryptionSettings

import javax.crypto.spec.{GCMParameterSpec, PBEKeySpec, SecretKeySpec}
import javax.crypto.{Cipher, SecretKeyFactory}
import scala.util.Try
import javax.crypto.{AEADBadTagException, Cipher, SecretKeyFactory}
import scala.util.{Failure, Try}

object AES {

Expand Down Expand Up @@ -51,7 +51,10 @@ object AES {
val cipher = Cipher.getInstance(CipherAlgoInstance)
cipher.init(Cipher.DECRYPT_MODE, keySpec, paramsSpec)

Try(cipher.doFinal(authTag ++ ciphertext))
Try(cipher.doFinal(authTag ++ ciphertext)).recoverWith ({
case _: AEADBadTagException => Failure(new Throwable("Bad wallet password"))
case e: Throwable => Failure(e)
})
}

private def deriveEncryptionKeySpec(pass: Array[Char], salt: Array[Byte])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ final class JsonSecretStorage(val secretFile: File, encryptionSettings: Encrypti
}
}
}
. fold(Failure(_), Success(_))
.fold(Failure(_), Success(_))
.flatten
}

Expand Down
32 changes: 16 additions & 16 deletions src/main/resources/panel/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"files": {
"main.css": "/static/css/main.82878fab.chunk.css",
"main.js": "/static/js/main.53607d9d.chunk.js",
"main.js.map": "/static/js/main.53607d9d.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.219240e0.js",
"runtime-main.js.map": "/static/js/runtime-main.219240e0.js.map",
"static/css/2.9338f6a1.chunk.css": "/static/css/2.9338f6a1.chunk.css",
"static/js/2.6c0e10bc.chunk.js": "/static/js/2.6c0e10bc.chunk.js",
"static/js/2.6c0e10bc.chunk.js.map": "/static/js/2.6c0e10bc.chunk.js.map",
"main.css": "/static/css/main.95603572.chunk.css",
"main.js": "/static/js/main.4a62f34b.chunk.js",
"main.js.map": "/static/js/main.4a62f34b.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.3929add9.js",
"runtime-main.js.map": "/static/js/runtime-main.3929add9.js.map",
"static/css/2.8e5c4313.chunk.css": "/static/css/2.8e5c4313.chunk.css",
"static/js/2.82289ad5.chunk.js": "/static/js/2.82289ad5.chunk.js",
"static/js/2.82289ad5.chunk.js.map": "/static/js/2.82289ad5.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.29a69d72b7fe06699929c489c49d7886.js": "/precache-manifest.29a69d72b7fe06699929c489c49d7886.js",
"precache-manifest.5ec1b24f55df1ee3e942e6e6777944c3.js": "/precache-manifest.5ec1b24f55df1ee3e942e6e6777944c3.js",
"service-worker.js": "/service-worker.js",
"static/css/2.9338f6a1.chunk.css.map": "/static/css/2.9338f6a1.chunk.css.map",
"static/css/main.82878fab.chunk.css.map": "/static/css/main.82878fab.chunk.css.map",
"static/css/2.8e5c4313.chunk.css.map": "/static/css/2.8e5c4313.chunk.css.map",
"static/css/main.95603572.chunk.css.map": "/static/css/main.95603572.chunk.css.map",
"static/media/index.scss": "/static/media/Roboto-Thin.89e2666c.ttf",
"static/media/close.feae5a5c.svg": "/static/media/close.feae5a5c.svg",
"static/media/copy.icon.835ebda7.svg": "/static/media/copy.icon.835ebda7.svg",
Expand All @@ -21,10 +21,10 @@
"static/media/remove.94c0849a.svg": "/static/media/remove.94c0849a.svg"
},
"entrypoints": [
"static/js/runtime-main.219240e0.js",
"static/css/2.9338f6a1.chunk.css",
"static/js/2.6c0e10bc.chunk.js",
"static/css/main.82878fab.chunk.css",
"static/js/main.53607d9d.chunk.js"
"static/js/runtime-main.3929add9.js",
"static/css/2.8e5c4313.chunk.css",
"static/js/2.82289ad5.chunk.js",
"static/css/main.95603572.chunk.css",
"static/js/main.4a62f34b.chunk.js"
]
}
2 changes: 1 addition & 1 deletion src/main/resources/panel/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.svg"/><meta name="viewport" content="minimum-scale=1,initial-scale=1,width=device-width,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Ergo node interface</title><link href="/static/css/2.9338f6a1.chunk.css" rel="stylesheet"><link href="/static/css/main.82878fab.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div id="modal-root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],Object.prototype.hasOwnProperty.call(c,t)&&c[t]&&i.push(c[t][0]),c[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return p.push.apply(p,u||[]),a()}function a(){for(var e,r=0;r<p.length;r++){for(var t=p[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==c[u]&&(n=!1)}n&&(p.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},c={1:0},p=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=this["webpackJsonpergo-node-interface"]=this["webpackJsonpergo-node-interface"]||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.6c0e10bc.chunk.js"></script><script src="/static/js/main.53607d9d.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.svg"/><meta name="viewport" content="minimum-scale=1,initial-scale=1,width=device-width,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Ergo node interface</title><link href="/static/css/2.8e5c4313.chunk.css" rel="stylesheet"><link href="/static/css/main.95603572.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div id="modal-root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],Object.prototype.hasOwnProperty.call(c,t)&&c[t]&&i.push(c[t][0]),c[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return p.push.apply(p,u||[]),a()}function a(){for(var e,r=0;r<p.length;r++){for(var t=p[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==c[u]&&(n=!1)}n&&(p.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},c={1:0},p=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=this["webpackJsonpergo-node-interface"]=this["webpackJsonpergo-node-interface"]||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.82289ad5.chunk.js"></script><script src="/static/js/main.4a62f34b.chunk.js"></script></body></html>
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "174eff469f11c8263fe5fc4ff1bebe5b",
"revision": "1595f5215a59208a4159cc3df79416b8",
"url": "/index.html"
},
{
"revision": "76067880b36d1e230601",
"url": "/static/css/2.9338f6a1.chunk.css"
"revision": "4f4f733742d655249a35",
"url": "/static/css/2.8e5c4313.chunk.css"
},
{
"revision": "e7bf098b902f4eb2e046",
"url": "/static/css/main.82878fab.chunk.css"
"revision": "6826698cbdec03cde05b",
"url": "/static/css/main.95603572.chunk.css"
},
{
"revision": "76067880b36d1e230601",
"url": "/static/js/2.6c0e10bc.chunk.js"
"revision": "4f4f733742d655249a35",
"url": "/static/js/2.82289ad5.chunk.js"
},
{
"revision": "e7bf098b902f4eb2e046",
"url": "/static/js/main.53607d9d.chunk.js"
"revision": "6826698cbdec03cde05b",
"url": "/static/js/main.4a62f34b.chunk.js"
},
{
"revision": "ce813ebd69754efed759",
"url": "/static/js/runtime-main.219240e0.js"
"revision": "130c5b8a74786bf3a1d1",
"url": "/static/js/runtime-main.3929add9.js"
},
{
"revision": "012cf6a10129e2275d79d6adac7f3b02",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/panel/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"/precache-manifest.29a69d72b7fe06699929c489c49d7886.js"
"/precache-manifest.5ec1b24f55df1ee3e942e6e6777944c3.js"
);

self.addEventListener('message', (event) => {
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/panel/static/css/2.8e5c4313.chunk.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions src/main/resources/panel/static/css/2.9338f6a1.chunk.css

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5f2ed85

Please sign in to comment.