forked from icon-project/xcall-multi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19bdb66
commit 8818d2a
Showing
9 changed files
with
807 additions
and
1,275 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
240 changes: 65 additions & 175 deletions
240
contracts/javascore/Intent_Contracts/app/src/main/java/network/icon/intent/Intent.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
43 changes: 0 additions & 43 deletions
43
...acts/javascore/Intent_Contracts/app/src/main/java/network/icon/intent/structs/Cancel.java
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
...ore/Intent_Contracts/app/src/main/java/network/icon/intent/structs/TokenFallbackData.java
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package network.icon.intent.structs; | ||
|
||
import score.Address; | ||
import score.ByteArrayObjectWriter; | ||
import score.Context; | ||
import score.ObjectReader; | ||
import score.ObjectWriter; | ||
|
||
public class TokenFallbackData { | ||
public byte[] swapOrderData; | ||
public String type; | ||
public Address solver; | ||
|
||
public TokenFallbackData(byte[] _swapOrderData, String _type, Address _solver) { | ||
this.swapOrderData = _swapOrderData; | ||
this.type = _type; | ||
this.solver = _solver; | ||
} | ||
|
||
private TokenFallbackData() { | ||
} | ||
|
||
public static void writeObject(ObjectWriter writer, TokenFallbackData obj) { | ||
obj.writeObject(writer); | ||
} | ||
|
||
public void writeObject(ObjectWriter writer) { | ||
writer.beginList(3); | ||
writer.write(this.swapOrderData); | ||
writer.write(this.type); | ||
writer.write(this.solver); | ||
writer.end(); | ||
} | ||
|
||
public static TokenFallbackData readObject(ObjectReader reader) { | ||
TokenFallbackData obj = new TokenFallbackData(); | ||
reader.beginList(); | ||
obj.swapOrderData = reader.readByteArray(); | ||
obj.type = reader.readString(); | ||
obj.solver = reader.readAddress(); | ||
reader.end(); | ||
return obj; | ||
} | ||
|
||
public byte[] toBytes() { | ||
ByteArrayObjectWriter writer = Context.newByteArrayObjectWriter("RLPn"); | ||
TokenFallbackData.writeObject(writer, this); | ||
return writer.toByteArray(); | ||
} | ||
|
||
public static TokenFallbackData fromBytes(byte[] bytes) { | ||
ObjectReader reader = Context.newByteArrayObjectReader("RLPn", bytes); | ||
return readObject(reader); | ||
} | ||
|
||
public byte[] getSwapOrder() { | ||
return swapOrderData; | ||
} | ||
|
||
public void setSwapOrder(byte[] _swapOrderData) { | ||
this.swapOrderData = _swapOrderData; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public Address getSolver() { | ||
return solver; | ||
} | ||
|
||
public void setSolver(Address solver) { | ||
this.solver = solver; | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
...javascore/Intent_Contracts/app/src/main/java/network/icon/intent/utils/SwapOrderData.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.