-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #348 from icon-project/fix/additional-issues
fix: fix public mutable and format
- Loading branch information
Showing
8 changed files
with
119 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 25 additions & 28 deletions
53
contracts/sui/xcall/sources/messages/call_message_rollback.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 23 additions & 24 deletions
47
contracts/sui/xcall/sources/messages/persistent_message.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
#[allow(unused_field,unused_use,unused_const,unused_mut_parameter,unused_variable,unused_assignment)] | ||
module xcall::persistent_message { | ||
use std::string::{Self, String}; | ||
use sui_rlp::encoder::{Self}; | ||
use sui_rlp::decoder::{Self}; | ||
use std::string::{Self, String}; | ||
use sui_rlp::encoder::{Self}; | ||
use sui_rlp::decoder::{Self}; | ||
|
||
const MSG_TYPE:u8=2; | ||
public struct PersistentMessage has drop{ | ||
data:vector<u8> | ||
const MSG_TYPE:u8=2; | ||
|
||
public struct PersistentMessage has drop{ | ||
data:vector<u8> | ||
} | ||
|
||
public fun new(data:vector<u8>):PersistentMessage{ | ||
PersistentMessage { | ||
data, | ||
} | ||
PersistentMessage { | ||
data, | ||
} | ||
} | ||
|
||
public fun get_data(self: &PersistentMessage){ | ||
self.data; | ||
} | ||
|
||
public fun msg_type():u8 { | ||
MSG_TYPE | ||
} | ||
public fun encode(self:PersistentMessage):vector<u8>{ | ||
let mut list=vector::empty<vector<u8>>(); | ||
vector::push_back(&mut list,encoder::encode(&self.data)); | ||
let encoded=encoder::encode_list(&list,false); | ||
encoded | ||
|
||
public fun msg_type():u8 { | ||
MSG_TYPE | ||
} | ||
|
||
public fun encode(self:PersistentMessage):vector<u8>{ | ||
let mut list=vector::empty<vector<u8>>(); | ||
vector::push_back(&mut list,encoder::encode(&self.data)); | ||
let encoded=encoder::encode_list(&list,false); | ||
encoded | ||
|
||
|
||
} | ||
|
||
public fun decode(bytes:&vector<u8>):PersistentMessage{ | ||
let decoded=decoder::decode_list(bytes); | ||
let data= *vector::borrow(&decoded,0); | ||
PersistentMessage { | ||
data, | ||
public fun decode(bytes:&vector<u8>):PersistentMessage{ | ||
let decoded=decoder::decode_list(bytes); | ||
let data= *vector::borrow(&decoded,0); | ||
PersistentMessage { | ||
data, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters