Skip to content

Commit

Permalink
Merge branch 'main' into gradle-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertent authored Dec 6, 2024
2 parents e7878e6 + 203a166 commit a8b2a5d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions domains/noto/internal/noto/states.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func (n *Noto) prepareOutputs(ownerAddress *tktypes.EthAddress, amount *tktypes.

func (n *Noto) prepareInfo(data tktypes.HexBytes, distributionList []string) ([]*prototk.NewState, error) {
newData := &types.TransactionData{
Salt: tktypes.RandHex(32),
Data: data,
}
newState, err := n.makeNewInfoState(newData, distributionList)
Expand Down
2 changes: 2 additions & 0 deletions domains/noto/pkg/types/states.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ var NotoCoinABI = &abi.Parameter{
}

type TransactionData struct {
Salt string `json:"salt"`
Data tktypes.HexBytes `json:"data"`
}

var TransactionDataABI = &abi.Parameter{
Type: "tuple",
InternalType: "struct TransactionData",
Components: abi.ParameterArray{
{Name: "salt", Type: "bytes32"},
{Name: "data", Type: "bytes"},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,15 @@ void testBond() throws Exception {
List<JsonNode> notoSchemas = testbed.getRpcClient().request("pstate_listSchemas",
"noto");
assertEquals(2, notoSchemas.size());
var notoSchema = mapper.convertValue(notoSchemas.getLast(), StateSchema.class);
assertEquals("type=NotoCoin(bytes32 salt,string owner,uint256 amount),labels=[owner,amount]",
notoSchema.signature());
StateSchema notoSchema = null;
for (var i = 0; i < 2; i++) {
var schema = mapper.convertValue(notoSchemas.get(i), StateSchema.class);
if (schema.signature().equals("type=NotoCoin(bytes32 salt,string owner,uint256 amount),labels=[owner,amount]")) {
notoSchema = schema;
} else {
assertEquals("type=TransactionData(bytes32 salt,bytes data),labels=[]", schema.signature());
}
}

String bondTrackerPublicBytecode = ResourceLoader.jsonResourceEntryText(
this.getClass().getClassLoader(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,15 @@ void testNotoPente() throws Exception {
List<JsonNode> notoSchemas = testbed.getRpcClient().request("pstate_listSchemas",
"noto");
assertEquals(2, notoSchemas.size());
var notoSchema = mapper.convertValue(notoSchemas.getLast(), StateSchema.class);
assertEquals("type=NotoCoin(bytes32 salt,string owner,uint256 amount),labels=[owner,amount]",
notoSchema.signature());
StateSchema notoSchema = null;
for (var i = 0; i < 2; i++) {
var schema = mapper.convertValue(notoSchemas.get(i), StateSchema.class);
if (schema.signature().equals("type=NotoCoin(bytes32 salt,string owner,uint256 amount),labels=[owner,amount]")) {
notoSchema = schema;
} else {
assertEquals("type=TransactionData(bytes32 salt,bytes data),labels=[]", schema.signature());
}
}

// Create the privacy group
String penteInstanceAddress = testbed.getRpcClient().request("testbed_deploy",
Expand Down

0 comments on commit a8b2a5d

Please sign in to comment.