-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exception type and other util #42
Conversation
hildr-utilities/src/main/java/io/optimism/utilities/derive/stages/Batch.java
Show resolved
Hide resolved
hildr-utilities/src/main/java/io/optimism/utilities/derive/stages/Frame.java
Show resolved
Hide resolved
hildr-utilities/src/main/java/io/optimism/utilities/digest/BytesUtil.java
Outdated
Show resolved
Hide resolved
* | ||
* @author thinkAfCod | ||
* @since 0.1.1 | ||
*/ | ||
public class CompressorFactory { | ||
public class RandomUtil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个也不需要,依赖的库里面有
hildr-utilities/src/main/java/io/optimism/utilities/ex/UnsupportedException.java
Outdated
Show resolved
Hide resolved
* @param channelId channelId | ||
* @param frameNumber channel frame number | ||
*/ | ||
public record TxData(byte[] data, byte[] channelId, int frameNumber) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个node里面有吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是frame变了一个形式,可直接使用Frame,已移除
* either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
包名不要缩写,另外exception不用都放一块,除非是会共用的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,这个是公共的,不同的包内都会使用
if (p.length > avail) { | ||
readLen = avail; | ||
} | ||
System.arraycopy(data, pos, p, 0, readLen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以用arrayUtils或者arrays简化下代码吧,你看下node里面的batches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要把数据填充到参数里的byte[]里。
ArrayUtils和Arrays工具都是返回一个新创建的数组,没办法替换System.arraycopy这个操作。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy应该也有工具方法吧
exception type and util