Import codec to all files that define new types in std lib (#7028)

## Description
Codec needs to be imported to all libraries in the std lib which define
new types, or else they cannot be used in Abi functions or logged.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: K1-R1 <77465250+K1-R1@users.noreply.github.com>
This commit is contained in:
SwayStar123 2025-03-21 20:54:06 +05:30 committed by GitHub
parent 8c916c80ee
commit 516c999c15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 120 additions and 0 deletions

View file

@ -16,6 +16,7 @@ use ::inputs::{
};
use ::revert::revert;
use ::vec::Vec;
use ::codec::*;
/// The error type used when an `Identity` cannot be determined.
pub enum AuthError {

View file

@ -6,6 +6,7 @@ use ::result::Result::{self, *};
use ::logging::log;
use ::primitives::*;
use ::ops::*;
use ::codec::*;
/// Error type for when the block hash cannot be found.
pub enum BlockHashError {

View file

@ -9,6 +9,7 @@ use ::hash::*;
use ::result::Result::{self, *};
use ::option::Option::{self, *};
use ::ops::*;
use ::codec::*;
/// An ed25519 signature.
pub struct Ed25519 {

View file

@ -7,6 +7,7 @@ use ::convert::{From, TryFrom, TryInto};
use ::option::Option::{self, *};
use ::hash::*;
use ::ops::*;
use ::codec::*;
/// Normalized (hashed) message authenticated by a signature.
pub struct Message {

View file

@ -5,6 +5,7 @@ use ::bytes::{Bytes, *};
use ::option::Option::{self, *};
use ::ops::*;
use ::primitive_conversions::u256::*;
use ::codec::*;
// NOTE: Bytes are used to support numbers greater than 32 bytes for future curves.
/// A 2D point on a field.

View file

@ -8,6 +8,7 @@ use ::convert::{From, TryFrom, TryInto};
use ::option::Option::{self, *};
use ::hash::*;
use ::ops::*;
use ::codec::*;
/// Asymmetric public key, i.e. verifying key, in uncompressed form.
///

View file

@ -5,6 +5,7 @@ use ::bytes::{Bytes, *};
use ::option::Option::{self, *};
use ::ops::*;
use ::primitive_conversions::u256::*;
use ::codec::*;
// NOTE: Bytes are used to support numbers greater than 32 bytes for future curves.
/// The Scalar type used in cryptographic operations.

View file

@ -12,6 +12,8 @@ use ::result::Result::{self, *};
use ::option::Option::{self, *};
use ::vm::evm::evm_address::EvmAddress;
use ::ops::*;
use ::codec::*;
/// A secp256k1 signature.
pub struct Secp256k1 {
/// The underlying raw `[u8; 64]` data of the signature.

View file

@ -12,6 +12,8 @@ use ::result::Result::{self, *};
use ::option::Option::{self, *};
use ::vm::evm::evm_address::EvmAddress;
use ::ops::*;
use ::codec::*;
/// A secp256r1 signature.
pub struct Secp256r1 {
/// The underlying raw `[u8; 64]` data of the signature.

View file

@ -12,6 +12,7 @@ use ::crypto::{
use ::option::Option::{self, *};
use ::result::Result::{self, *};
use ::vm::evm::evm_address::EvmAddress;
use ::codec::*;
/// An ECDSA signature.
pub enum Signature {

View file

@ -1,5 +1,7 @@
library;
use ::codec::*;
/// The error type used when a cryptographic signature function fails.
pub enum SignatureError {
/// The error variant used when the recover fails.

View file

@ -7,6 +7,7 @@ use ::bytes::Bytes;
use ::registers::error;
use ::hash::*;
use ::result::Result::{self, *};
use ::codec::*;
/// The error type used when the `ec_recover` function fails.
pub enum EcRecoverError {

View file

@ -3,6 +3,7 @@ library;
use ::alloc::alloc_bytes;
use ::bytes::*;
use ::codec::*;
pub struct Hasher {
bytes: Bytes,