Explorar el Código

Add native amount setter

febo hace 8 meses
padre
commit
1b184e6e40
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      interface/src/state/account.rs

+ 5 - 0
interface/src/state/account.rs

@@ -85,6 +85,11 @@ impl Account {
         self.is_native[0] == 1
     }
 
+    #[inline(always)]
+    pub fn set_native_amount(&mut self, amount: u64) {
+        self.native_amount = amount.to_le_bytes();
+    }
+
     #[inline(always)]
     pub fn native_amount(&self) -> Option<u64> {
         if self.is_native() {